I'm a starter at android developing and am currently really stuck with implementing actionbarsherlock. I know this has been discussed before, but I'm getting really confused regarding dependencies and how to set up the project structure. I tried following all the instructions, but it's not working out. I keep getting a different problem with the gradle. I'm using Android Studio 0.2.0.
My current error says:
>Gradle 'MyAppProject' project refresh failed: >Could not fetch model of type 'IdeaProject' using Gradle distribution "http://services.gradle.org/distributions/gradle-1.6-bin.zip". >Error: Gradle: A problem occurred configuring project ':MyApp'. >Failed to notify project evaluation listener. >A problem occurred configuring project ':Libraries:ActionBarSherlock'. >Failed to notify project evaluation listener. >Main Manifest missing from C:\Users\JJ2\AndroidStudioProjects\MyAppProject\Libraries\ActionBarSherlock\src\main\AndroidManifest.xml My project is build as follows:
-MyAppProject |+.idea |+gradle |-Libraries ||-ActionBarSherlock |||+gen |||+libs |||+res |||-src ||||-android.support.v4.app |||||-Watson ||||+com.actionbarsherlock |||-ActionBarSherlock.iml |||-AndroidManifest.xml |||-build.gradle |||-lint.xml |||-pom.xml |||-project.properties |||-README.md |-MyApp ||+build ||+libs ||-src |||-main ||||-java |||||+com.mywebsite.myapp ||||+res ||||-AndroidManifest.xml ||||-ic_launcher-web.png ||-build.gradle ||-MyApp.iml |-build.gradle |-gradlew |-gradlew.bat |-local.properties |-settings.gradle |-MyAppProject.iml -External Libraries |-<Android 4.2.2> ||+android.jar ||+annotations.jar ||+res The content of the build.gradle in the MyAppProject directory:
task assemble{} The build.gradle in the MyApp directory:
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.0' } } apply plugin: 'android' dependencies { compile project(":Libraries:ActionBarSherlock") } android { compileSdkVersion 17 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 9 targetSdkVersion 17 } } And the build.gradle in the Libraries\ActionBarSherlock directory:
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.0' } } apply plugin: 'android-library' dependencies { compile files('libs/android-support-v4.jar') } android { compileSdkVersion 17 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 9 targetSdkVersion 17 } } Lastly, my Project Structure looks as follows:
Modules
-ActionBarSherlock (Dependencies: Android 4.2.2, [v]android-support-v4) -Android -MyApp (Dependencies: Android 4.2.2, [ ]ActionBarSherlock) -Android -Android-Gradle -MyAppProject (Dependencies: Android 4.2.2) -Android-Gradle Libraries
None Global Libraries
-android-support-v4 (Classes: ...\MyAppProject\MyApp\libs\android-support-v4.jar) I hope somebody can notice anything wrong with the code, although a lot of people seem to have uresolved issues since the new Android Studio release. Thanks in advance!