Cannot resolve symbol 'CordovaActivity'
07 Jan 2015After I imported a cordova project into Android Studio, symbols of cordova classes cannot be resolved.
Softwares:
- Android Studio: 1.0.2
- Ionic: 1.3.0-beta1
Problem:
Somehow, android studio cannot figure out the library project.
How to solve this:
ionic platform add android
- Open android studio, and choose Import Non-Android Studio Project
- Select the root folder(usually platform/android)
- Use Gradle Wrapper? YES
- Change gradle plugin version from 0.10.+ to 1.0.0 in both build.gradle files
- Change buildToolsVersion from 19.0.0 to 19.1.0 in both build.gradle files
- Remove the for loop in dependencies section of build.gradle, then add
compile project(':CordovaLib')
- Remove the for loop in settings.gradle, then add
include ':CordovaLib'
- Resync the gradle, and it should work