esox
esox

Reputation: 13

Android Studio 0.4.3 - Unable to compile official Android Samples

I've got Android Studio 0.4.3 installed on my system and try to import and run the official samples from the Android Developers site:

http://developer.android.com/samples/index.html

Unfortunately when I try to compile I get the following error:

FAILURE: Could not determine which tasks to execute.

  • What went wrong: Task 'assemble' not found in root project 'ActionBarCompat-Basic'.

  • Try: Run gradle tasks to get a list of available tasks.

As you can see I tried to compile the ActionBarCompat-Basic example, but the result is the same for all samples.

I already tried to delete the <component name="FacetManager"> ... </component> from my iml file and deleted the .idea folder like suggested in this thread:

Gradle: FAILURE: Could not determine which tasks to execute

This did not solve the problem. After removal of the files I imported the project to Android Studio and tried to compile. As a consequence the iml file and the .idea folder are generated again and the error message stays the same.

Anyone else got this problem? Any help is greatly appreciated!

Upvotes: 1

Views: 2022

Answers (1)

Piyush Agarwal
Piyush Agarwal

Reputation: 25858

Sample projects are using old version of gradle plugin which is no longer supported by Android Studio 0.4.3

Please do the following changes

Go to your module's build.gradle(like ActionBarCompat-BasicSample/build.gradle) file inside the project and replace dependency classpath at beginning by this

dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
    }

Change the distrubutionUrl in ActionBarCopat-Basic/gradle/gradle-wrapper.properties file to this

distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip

If you are using gradle version 1.10 replace 0.7.+ to 0.8.+ and 1.9 to 1.10 in above configurations .

I am assuming you have already removed component FacetManager from ActionBarCopat-Basic.iml file and re-imported the project.

This worked perfectly for me.

Upvotes: 6

Related Questions