I've added ActionBarSherlock to an existing android app that includes three of my own libraries. It was super easy to add the maven reference to the build.gradle files of the main project and the libraries that needed it, so that the main project now has:
dependencies {
compile project(':ads')
compile project(':core')
compile project(':iap')
compile files('libs/libGoogleAnalyticsServices.jar')
compile 'com.android.support:support-v4:18.0.+'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
}
I can go to the command line and do a ./gradlew assembleRelease
and everything builds and runs as expected. However, when I'm inside Android Studio (0.4.2), it won't recognise the import statement, e.g.
import com.actionbarsherlock.app.SherlockActivity;
will get a nice red underline below "app". Accordingly the IDE shows errors for the unrecognised references. I've tried:
- clicking the "Sync Project with Gradle Files" button
- using the GUI to add the library reference (Open Module Settings, "Dependences" tab, "+")
- restarting Android Studio
- reading a lot of Stack Overflow articles!
Any suggestions on next steps? The ability to import via the compile / maven dependency was awesome, but being able to edit cleanly in the GUI would be nice :-).