Execution failed for task ':app:compileDebugAidl': aidl is missing - android

I installed Android Studio on my computer. I created a new project but that got me the error below. What can I do?
Error:Execution failed for task ':app:compileDebugAidl'.
> aidl is missing
My Android Studio version is 1.1.0.
This is my build.gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
And :
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "24.1.2"
defaultConfig {
applicationId "com.example.jo.cloning_a_login_screen"
minSdkVersion 13
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
}

In my case I downloaded version 22 of Android M and Android 5.1.1 using Android Studio 1.2.1.1 but when I try to do a Hello World this same error showed me
So the solution for me was doing right click in app like the image below and choose "Open Module Settings"
then there you have 2 options. I've changed both with the last version I had.
Compile SDK version to API 21 Lollipop
and Build Tools Version to 21.1.2
Finally clean the project and Build
UPDATED
TO Get Android Studio 1.3 follow these steps
Open the Settings window by choosing File > Settings.
Choose the Appearance & Behavior > System Settings > Updates panel.
On the Updates panel, choose the option Automatically check updates for: Canary Chanel.
On the Updates panel, select Check Now to check for the latest canary build. Download and install the build when you are prompted.
Then you'll have something like this to update your Androud Studio to 1.3 and with this you can test Android M
Update: Real Cause
This bug happens when the versions of SDK, Build Tools and Gradle Plugins doesn't match (in terms of compatibility). The solution is to verify whether you are using the latest version of them or not. The gradle plugins are placed in the build.gradle of the project, and the other versions are on the build.gradle of the module. For example, for SDK 23, you must use the Build Tools 23.0.1 and gradle plugins version 1.3.1.

It has been fixed two days ago, so you can use:
buildToolsVersion '23.0.0 rc2'
with the newest android gradle plugin:
classpath 'com.android.tools.build:gradle:1.3.0-beta2'
Note:
I had some weird problems with gradle 2.4 distribution, but trying to build the project again has fixed that for me.
EDIT
There is a newer version of build-tools 23, so you should probably use:
buildToolsVersion '23.0.0 rc3'
EDIT 2
And yet again, there are newer version of both gradle plugin and build-tools, so you can switch to using:
classpath 'com.android.tools.build:gradle:1.3.0'
and
buildToolsVersion '23.0.0'

I had a similar error with a fresh install of Android Studio 1.2.1.1 attempting to build a new blank app for API 22: Android 5.1 (Lollipop).
I fixed it by simply changing the Build Tools Version from "23.0.0 rc1" to "22.0.1" and then rebuilding.
On Windows, F4 opens the Project Structure and the Build Tools Version can be set in the Modules > app section:
I think all this does is change the setting in the build.gradle file in the app but I didn't want to change that manually just in case it does something more.

I tried to uninstall/install and it did not work. I am running OSX 10.10.3 with Android Studio 1.2.1.1 on JDK 1.8.0_45-b14 and the solution I found to work is similar to Jorge Casariego's recommendation. Basically, out of the box you get a build error for a missing 'aidl' module so simply changing the Build Tools Version to not be version 23.0.0 rc1 will solve your problem. It appears to have a bug.
UPDATE
After commenting on an Android issue on their tracker (https://code.google.com/p/android/issues/detail?id=175080) a project member from the Android Tools group commented that to use the Build Tools Version 23.0.0 rc1 you need to be using Android Gradle Plugin 1.3.0-beta1 (Android Studio comes configured with 1.2.3). He also noted (read the issue comments) that the IDE should have given an notification that you need to do this to make it work. For me I have not seen a notification and I've requested clarification from that project member. Nonetheless his guidance solved the issue perfectly so read on.
Solution: Open your build.gradle for your Project (not Module). Find the line classpath com.android.tools.build:gradle:xxx under dependencies where xxx is the Gradle Plugin version and make the update. Save and Rebuild your project. Here is the Android Gradle docs for managing your Gradle versions: https://developer.android.com/tools/revisions/gradle-plugin.html

I was able to get build to work with Build Tools 23.0.0 rc1 if I also opened the project level build.gradle file and set the version of the android build plugin to 1.3.0-beta1. Also, I'm tracking the canary and preview builds and just updated a few seconds before, so perhaps that helped.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0-beta1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}

Quick fix that worked for me:
Right click on project->"Open Module Settings"->Build Tools Version change to: 22.0.1

To build your application without aidl is missing error with compileSdkVersion 23 and buildToolsVersion "23.0.1" you should specify latest versions for Android Gradle plugin (and Google Play Services Gradle plugin if you are using it) in main build.gradle file:
buildscript {
repositories {
...
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.google.gms:google-services:1.3.1'
}
}

I had the same error i fixed it by going to the build.gradle (Module: app) and changed this line from :
buildToolsVersion "23.0.0 rc1"
to :
buildToolsVersion "22.0.1"
You will need to go the SDK Manager and check if you have the 22.0.1 build tools. If not, you can use the right build tools but avoid the 23.0.0 rc1.

Essentially Matt Daley/Johnny Mohseni's solution worked for me.
I faced exactly the same problem on a fresh Android Studio V 1.2.1.1 installation. I created a new project (blank activity) and straightaway god this build error.
Error:Execution failed for task ':app:compileDebugAidl'.
> aidl is missing
As suggested, changing the gradle dependency from 1.2.3 to 1.3.0-beta1 fixed it.
classpath 'com.android.tools.build:gradle:1.3.0-beta1' // <--- WORKS!
//classpath 'com.android.tools.build:gradle:1.2.3' // <--- default - failed
Once 1.3.0-beta1 change was saved, I got a prompt to upgrade dependencies. Upon accepting the request to upgrade, the gradle build status bar at the bottom tracked the packages being synced. When that completed, the build was automatically triggered and completed successfully.

Use your file browser and copy-paste the IInAppBillingService.aidl into /app/src/main/aidl/com/android/vending/billing/

The problem was actually in the version Android Studio 1.3 updated from the canary channel. I updated my studio to 1.3 and got the same error but reverting back to studio 1.2.1 made my project run fine.

buildtools layout in 23.0.0.rc2 was reverted
so to be able to use it, you need to upgrade the plugin to 1.3.0-beta2 or higher as i show below:

I am working with sdk 23.1.0 and gradle 1.3.1. I created a new project edited nothing and got the aidl error. I went into my project gradle file and changed tool to 22.0.1 instead of 23.1.0 and it worked:
compileSdkVersion 23
buildToolsVersion "22.0.1" //"23.1.0"

Check if you actually have installed the buildVersionTools you are using. In my case I tried 25.0.1 whilst I only had 25.0.2.
To check it go to the SDK Manager, clicking the icon:
Then click Launch Standalone SDK Manager at the bottom:
Now check whatever you need and install packages.
Hope it helps!

Related

After updating to android studio 3.1.1 unresolved third party imports

I updated the android studio to 3.1.1 and android sdk as follows
androidMinSdkVersion = 16
androidTargetSdkVersion = 27
androidCompileSdkVersion = 27
androidBuildToolsVersion = "27.0.3"
androidSupportV7LibraryVersion = "27.1.1"
I am able to build and run apk on device but editor not able to recognize third party imports and shows red color for imports and for usage
event after invalidating cache issue is not yet solved
Gradle version is as follows with 4.4 distribution
classpath 'com.android.tools.build:gradle:3.1.1'
dependencies are already changed from from compile to implementation
This issue is not limited to one library having same issue to all the third party dependecies such as Volley , circularimageView etc
Update
I am getting this pop up when doing installdebug which says gradle 3.1.1
Typically, this error occurs when you have a compilation error elsewhere and your cleaned project can no longer be compiled. I suggest trying a gradle build from the command line, and editing your post to include the log output.
As of this post 3.1.1 Gradle Plugin doesn't exist in the documentation.
The plugin does not always match Android Studio versions.
To match the documentation, make your top level build.gradle match this
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
Also, Gradle version as of this post is 4.6

Updated to Android Studio 3.0. Getting a "Kotlin not configured" error

I just updated to Android Studio 3.0 and I'm getting this error with an existing project:
Kotlin not configured
When I go to Tools>Kotlin>Configure Kotlin in Project, I get an error saying "no configurators available". Also get the error below with the red java:
I've also tried:
Restarting
Clean and Rebuild
Invalidate caches/restart.
I first tried with invalidate cache/ restart option but it doesn't help me.
When I updated Kotlin to 1.1.60 in project's gradle file, problem is solved.
Also, use this in app's gradle for stdlib
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.1.60"
instead of
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.60"
In Android Studio, click on File -> Invalidate Caches / Restart... , then select "Invalidated and Restart". This solved my problem.
This error also occurs if you have the mavenCentral() repository missing in allprojects.
Your build.gradle (:app) should contain at least this:
allprojects {
repositories {
google()
mavenCentral()
}
}
jcenter() would work as well (for now), but that repository reached end-of-life and shouldn't be used any more.
Closing and restarting Android Studio works for me in that case. Important is that there are no other projects opened in Android Studio before you close it. I suspect that closing Android Studio with multiple opened project windows sometimes messes up the configuration especially after plugin upgrades etc.
Important Update
You should check JDK version before setting config
Kotlin gradle config page has detailed information about this.
Step 1
Check kotlin version in project level gradle file.
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
For kotlin_version '1.2.x' Use jdk NOT jre
Step 2
Check JDK version in File > Project Structure
Or check in build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
If no JDK version is set in Project Structure, then choose by Android Studio version
JDK version is 1.7 for Android Studio Version < 2.2.1
JDK version is 1.8 for Android Studio Version < 2.2.1
Because Android Studio is bundled with jdk 1.8 since 2.2.1 version.
You have 3 options of kotlin stdlib, choose according JDK version
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" //jdk_version == 1.8
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" //jdk_version == 1.7
implementation"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" // jdk_version is < 1.7
if kotlin version is'1.1.x' Use jre NOT jdk
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" // or jre8
Update Kotlin Version?
You can update Kotlin version from Tools > Kotlin > Configure Kotlin Updates
Kotlin-stdlib-jre7 is deprecated since 1.2.0 and should be replaced with kotlin-stdlib-jdk7
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
I have faced this issue recently... when I updated to Android Studio 3.1 .
I did a few things to fix this.
First I updated the Kotlin version in my app gradle file and added
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.2.31"
in my app gradle file. But this alone didn't fix it.
Then uninstalled the kotlin plugin from settings, restarted Android Studio and installed it again.
EDIT :
This is my project gradle file
buildscript {
ext.kotlin_version = '1.2.31'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.31"
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
And this is my app gradle file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
...
}
buildTypes {
...
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
kapt { generateStubs = true }
}
repositories {
...
}
dependencies {
...
...
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.2.31"
...
...
}
apply plugin: 'com.google.gms.google-services'
just delete .idea folder from project,and run android studio again, it will resolve KOTLIN NOT CONFIGURED issue.
A common reason of the "Kotlin Not Configured" message is an internal Android Studio exception due to a bad plugin.
In order to fix that you should disable the bad plugin.
When such plugin crash occurs, on the "Wellcome screen" you'll see a small notification (see illustration image) where you can click it and disable the bad plugin:
None of the other solutions solved my problem. I ended up figuring out that the problem lied in the google services version. Just update it to the latest.
Top level gradle at dependencies:
classpath 'com.google.gms:google-services:4.1.0'
In my case, after the update of Android Studio and plugins, I could create new projects, but my old projects were having "Gradle Sync Issues".
The solution was in File/Project Structure.../App/Dependencies:
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
And then I just updated the Kotlin version in my project build.gradle:
From:
ext.kotlin_version = '1.2.30'
To:
ext.kotlin_version = '1.3.21'
Then I tried Sync again.
Obs: You can check your Kotlin version in Tools/Kotlin/Configure Kotlin Plugin Updates
I have tried all above solutions but non of them works for me.
Then finally I got success with below solution, so it may helpful for some one like me.
Delele all .iml files (in root project, libraries and modules)
Rebuild project
In my case I had to update Android studio from version 3.4.1. to 3.5 and it resolved the kotlin not configured error.
Delete .AndroidStudio3.6 folder in C:\Users\Username and re-open Android studio works for me
The only fix for me was adding
apply plugin: 'kotlin-android-extensions'
in build.gradle (:app)
One other point to check is version of your Gradle in gradle-wrapper.properties, if you use one.
Make sure that
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Has version 4.1 or higher.
You may also have the following in your build.gradle:
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
Where Gradle version is lower that 4.1
Though I see that the question already has answers that work, one might also try the following solution.
Right click on the file name (Main.kt) -> Run 'Main.kt'.
This will download a gradle file from the gradle.org website.
Wait for it to unzip. The errors were cleared.
In my case, it was a broken update of one of the plugins I've used. Check your error logs from Android Studio this will lead you to what is the problem.
Simply Create a new Activity and select its language to kotlin Android studio Automatically configured kotlin for you.

Android Studio 2.0 - Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to

I updated the Android Studio version 2.0 and was using normally. When I created a new project today, it is displaying the error Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to
I realized that this problem occurs only when I create a new project. In previous projects developed, the problem does not occur and I realized that gradle is different
classpath 'com.android.tools.build:gradle:1.3.0'.
I have to update with the same set of old projects?
My app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "luizugliano.com.br.teste"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
My build.gradle (Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
UH OH, Google Notice: "This website no longer provides downloads for Android Studio."
(Old 'channel' links no longer work. Links in this answer have been updated to the new formats, make sure to change your bookmarks if you were using them)
You need to update the version of the gradle tools you are building with. This can be found inside the dependencies section of your build.gradle. You have 3 options you can update to:
The latest stable version referenced in the release channel as of 2nd March, 2017 is
classpath 'com.android.tools.build:gradle:2.3.0'
Or the latest beta version via preview channel as of 15th February, 2017 is
classpath 'com.android.tools.build:gradle:2.3.0-beta4'
And the latest alpha version also from the preview channel as of 21st March, 2017 gives you the option to use
classpath 'com.android.tools.build:gradle:2.4.0-alpha3'
Updating requires you to also upgrade the gradle wrapper. As of 20th February '17, the newest is:
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-all.zip
On android studio you can find your wrapper by changing to the project view and looking in gradle/wrapper/gradle-wrapper.properties
Sometimes after changing wrapper the project will fail to compile with an error like “Minimum supported Gradle version is 2.14.1. Current version is 2.10. Try changing Gradle distribution version to...” despite already having the correct version in gradle-wrapper.properties. If that happens try the following:
Go to Settings > Build, Execution, Deployment > Gradle
Under Project-level settings ensure that Use default gradle wrapper (recommended) is the selected option, then re-build your project.
(Additional Note: With regards to the alpha and beta versions - there is not always a newer build than the stable version when I check, in those cases I've just given values for the previous version. This allows you to roll back to that version if you experience issues with the released version)
In new project change this part:
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'
with
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'.
If you're not experienced user, please stick with Android Studio's Updates Stable Channel. I suppose you got Android Studio from Canary Channel.
Note that:
The Canary Channel for Android Studio delivers the bleeding edge updates on a roughly weekly basis. While these builds do get tested,
they are still subject to bugs, as we want people to see what's new as
soon as possible.
From: http://tools.android.com/download/studio/canary
You don't need to change dependencies of your older projects. They should run normally on the latest version.
Same problem on update.
this Fixed it for me:[build.gradle]
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
or
classpath 'com.android.tools.build:gradle:2.0.0-beta2'
Just in Advanced System Settings in Windows Properties, add a new environment variable with the name ANDROID_DAILY_OVERRIDE and the given value in error message. Restart android studio and you will be ready to go
As of April 5, 2016 this worked for me:
classpath 'com.android.tools.build:gradle:2.0.0-rc3'
gradle version you need became
classpath 'com.android.tools.build:gradle:2.0.0-beta7'
Which requires you to use the gradle wrapper for 2.10 if you were still using previous version
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
On android studio you can find your wrapper by changing to the project view and looking in gradle/wrapper/gradle-wrapper.properties
classpath: com.android.tools.build:gradle:+
This will solve the problem by updating gradle to latest one.
However it is dangerous(will code in alpha stage) & will also give warnings.
If you are using Android Studio 2.0 Preview I can suggest using 'beta' updates channel instead of 'stable'. It will allow you to receive latest gradle configuration changes. You can change updates channel in Settings - Appearance & Behavior - System Settings - Updates. Select Automatically check updates for [Beta Channel]
In order to know actual version of gradle classpath and distributionUrl (check Nick Caroso's answer) you can create new empty project and see these values there.
You need to change your gradle-wrapper.properties file in gradle/wrapper folder of your app, change your distributionUrl as this:
distributionUrl=http\://services.gradle.org/distributions/gradle-2.8-all.zip
Use http: or https:\ as per your requirement.
Then just clean your project and you are done!!!
Side Note :
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
is available now, if you want to use latest version.
Also you can take advantage of instant run feature of android studio using this, which is not available in gradle version below 2.0.0
Android Studio 2.0 has an update project to use instant-run. For those like me with little brains:
http://tools.android.com/tech-docs/instant-run
The current version of Android Studio 2.0 is Beta 6.
try update gradle to 2.10
for mac, tha path is Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle
of course you must download gradle 2.10 before
I got the same error on 04/07/2016 with
'com.android.tools.build:gradle:2.2.0-alpha2' and gradle wrapper 2.10
then, I just changed to
'com.android.tools.build:gradle:2.2.0-alpha3'
now I have no problems.
Hope this help peple.
I have resolved this way.
Steps:
Open gradle-wrapper.properties file and change distributionUrl to https\://services.gradle.org/distributions/gradle-2.14.1-all.zip.
Open root level build.gradle and change classpath to com.android.tools.build:gradle:2.2.2.
Sync your Android studio project.
Reference screen shot:
Done.
just change
classpath 'com.android.tools.build:gradle:2.0.0-alpha '
or
classpath 'com.android.tools.build:gradle:2.1.0'
I change my classpath from 'com.android.tools.build:gradle:2.2.0-alpha4'
to classpath 'com.android.tools.build:gradle:2.2.0-alpha5'
and clicked "try_again" when the warning appears "unable to find cached classpath" you just click "sync", this worked like a breeze.
This problem occures generally when the IDE(android studio) in which project is build and the project are not in compatible gradle plug in. Please check the link below
http://tools.android.com/tech-docs/new-build-system/version-compatibility
In my case i had created a project using AS 1.0/2.0 version, and later imported in studio version new it gave me error then I opened project in older version of AS it worked.
you can also check http://tools.android.com/tech-docs/new-build-system
File -> Project Structure -> Project -> Android Plugin version = 2.2.3
Working fine of Android Studio 2.2.3

importing project from intelij 12 to android studio beta

My project worked fine in intelij and I wanted to try it in the android studio beta, however when importing it android studio says
Error: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<br>Gradle settings
This is my build.gradle file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12+'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
//compile files('libs/GoogleAdMobAds.jar')
compile files('libs/libGoogleAnalyticsV2')
compile files('libs/google-play-services.jar')
compile files 'com.android.support:appcompat-v7:+'
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
previously in intelij I had been using com.android.tools.build:gradle:.5+ and I guess this is no longer supported. So what I'm wondering is what is the correct setting I need? Changing it to .12+ like was suggested then causes "Unable to find any references to the Android Gradle plugin" when I press the suggested quick fix. Any suggestions?
Have you updated your android studio version? This happened to me but was fixed after the update. You will have to rebuild your project and ensure you've set the new target gradle build.
I fixed this issue by deleting all of the generated build and gradle files... android studio then automatically downloaded newer version of gradle and the issue was resolved.

How to get Gradle 1.9 in android-studio 0.3.6 running?

I just spend some time and failed trying to migrate an existing android studio project from gradle 1.8 to gradle 1.9 final ( which was released yesterday 19th Nov ).
I read most of the other gradle related posts here but none worked for me.
here a list of what I've tried so far:
./gradle/wrapper/gradle-wrapper.properties changed distributionUrl to gradle-1.9-all.zip
Rebuild Project
in android-studio: Tools -> Android -> Synch Project with Gradle Files
running command gradle wrapper in project dir to update the wrapper
-
build.gradle file
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 14
targetSdkVersion 16
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
dependencies {
compile 'com.android.support:appcompat-v7:18.0.0'
}
all ended with the "need gradle 1.8, change your gradle-wrapper.properties to gradle-1.8-all.zip" error message.
Gradle 1.9 isn't supported with the Android plugin 0.6.3; it requires 1.8. The plugin uses internal Gradle APIs and is tied to specific Gradle versions to ensure it works. This limitation will be lifted in the future, but will require some new features in Gradle.
The next version of the plugin will support Gradle 1.9.
EDIT:
Android Studio 0.4.0 and Android Gradle plugin 0.7.0 have been released; these support Gradle 1.9. At the time of writing, Gradle 1.10 is current, but is not supported yet in v0.7.0 of the plugin.
You could try this:
Close your Project and try to open your project, but instead of choosing the root folder of your project choose your settings.gradle file.
AS will ask you if you want to open this project -> click "Yes". Than a window appears "Import Project from Gradle". Make sure that "Use default gradle wrapper" is selected.
This helped me after upgrading AS to 0.3.1, since this version you need gradle 1.8.

Categories

Resources