Android Studio (0.5.3) is driving me crazy.
I have never had any serious issues with Eclipse and ADT. Android Studio is another story: I have not been able to get a single project to build correctly with it.
So, I am trying to import an Android sample project (which I suppose has correct Gradle settings and should ready to be imported):
C:\pathToMyAndroidSDK\sdk\samples\android-19\content\StorageProvider
The first error I get is the following:
Failed to refresh Gradle project 'StorageProvider'
The project is using an unsupported version of Gradle. Please use version 1.10.
Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
Fix Gradle wrapper and re-import project Gradle settings
OK, so I download Gradle 1.10, and change the project Gradle settings, so that it uses this local Gradle distribution instead of the default gradle wrapper (which seems to be included in the sample project).
I get a different error this time:
Failed to refresh Gradle project 'StorageProvider'
The project is using an unsupported version of the Android Gradle plug-in (0.8.3).
Version 0.9.0 introduced incompatible changes in the build language.
Please read the migration guide to learn how to update your project.
I don't know Gradle enough to migrate the configuration myself, and I don't really want to.
How can I simply use the gradle wrapper without gettting summoned to use Gradle 1.10 (which is not compatible with the project) ? Any other solution is also welcome.
Note: I have tried with other sample projects in the android-19 folder, only to get the same errors.
EDIT:
I have had more luck trying to build under Linux with the command line (gradlew build
).
The build succeeded, regardless of what I set in build.gradle
:
classpath 'com.android.tools.build:gradle:0.9.+'
or
classpath 'com.android.tools.build:gradle:0.8.+' #(the original configuration of the sample project)
So my problem seems to be caused by bugs in Android Studio.