How to fix build tools (22.0.0/1) dependency issues - android

Before last month, I have been using Eclipse for android development. But now I am trying to use android studio because of the google's policy.
I am so tired.
I ran across this error
I don't understand this message. Because I don't use "Build Tools revision 23.0.0 rc" I am using 22.0.0.
compileSdkVersion 22
buildToolsVersion "22.0.0"
But I met that's error continue. So I downloaded and Installed Build Tools 23.0.0 rc2. But I met network error.
Solutions please. I am tired.

it happens because of build tools inconsistency. Firstly make sure 22 is installed then 23rc is not installed.
After that in your Android Studio Open Gradle Scripts >> build.gradle (Module:app). Make sure the installed build tool which is 22.0.1 in me is declared here. After changing the numbers make sure you rebuild/sync/refresh the project. And you are done.
Note: Make sure this is done to all of your projects

I am new to the Android programming. But I now get this error.
On 8/28/2015, I have with the SDK Manager on the Android Studio (1.3.2 Build 141.2178183), while my current project was opened, installed new, previously not installed packages and also I have done other recommended update. Subsequently, I received the error message "Install Build Tool revision 23.0.0. rc2" and "Gradle project sync failed. Basic functionality (e.g... Try Again Open 'Messages' View Show Log in Explorer".
I have tried it without success.
Uninstall/new install Build-Tools in the SDK manager brought no change. There was a "Build Tools revsion 232.0 rc2" also not to be found.
Therefore, I have looked at the Grandle files accurately. The file build.gradle (Module: app) in
C: \ Users \ \ AndroidStudioProjects \ \ app \ build.gradle contained the following entry:
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
I have changed this with an editor:
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
Then I could call up the project again without errors and also perform a synchronization.

I tried above solution it seemed not to work at first but try looking into all build files. For example if your project has got multiple modules say wearable module or like update its gradle build file too.

It seems to be answered perfectly here:
https://stackoverflow.com/a/28159380/3436166
Just install the required version of Build Tools and the dependency issue will be solved.

Related

Failed to find target with hash string 'android-25'

I have Android Studio 2.2. I am trying to open a project, but I get the error "Failed to find target with hash string 'android-25'". Below the error message I see a link "Install missing platform(s) and sync project". If I click this link, I get another error, which says
"The following packages are not available: - Package id
platforms;android-25".
In the Android SDK tool, I can see "Android 7.0" (API level 24) already installed. On checking the details about Android verisons and its API levels, I found that Android Nougat has API levels 24-25. I would like to know how I can update the SDK from API24 to 25?
You don't need to update anything. Just download the SDK for API 25 from Android SDK Manager or by launching Android standalone SDK manager. The error is for missing platform and not for missing tool.
Well, I was suffering with this Issue but finally I found the solution.
Problem Starts Here:
["Install missing platform(s) and sync project" (link) doesn't work & gradle sync failed]
Problem Source: Just check out the app -> src-build.gradle and you will find the parameters
compileSdkVersion 25
buildToolsVersion "25.0.1"
targetSdkVersion 25
Note: You might find these parameters with different values e.g
compileSdkVersion 23 etc.
These above parameters in build.gradle creates error because their values are not compatible with your current SDK version.
The solution to This error is simple, just open a new project in your Android Studio, In that new project goto app -> src-build.gradle.
In build.gradle file of new project find these parameters:
In my case these are:
compileSdkVersion "26"
buildToolsVersion "26.0.1"
targetSdkVersion 26
Now copy these parameters from your new project build.gradle file and post them in the same file of the other project(having Error).
I got similar problem
1: I tried to resolve with the answer which is marked correct above But I was not able to get the system setting which was quit amazing (On MacBook).
Most of the time such errors & issues comes because of replacing your grade file with other grade file ,due which gradel does not sync properly and while building the project issue comes . The issue is bascially related to non syncing for platform tools
Solution a: Go to File and then to Your project strucutre -modules -app-Properties -build tool version -click on options which is required for your project (if required build tool version not there chose any other). This will sync the grade file and now you can go to gradel and change target version and build tool version as per your requirement .you will prompted to download the required platform tool to sync it , now click on install tool version and let project to build
Solution b: Try Anuja Ans if you can get option of system setting and install platform tool.
Make sure your computer is connected to the internet, then click on the link that comes with the error message i.e "install missing platform(s) and sync project". Give it a few seconds especially if your computer has low specs, it will bring up a window called SDK Quickfix Installation and everything is straightforward from there.
I got same exception while running gradle build for my android project.
Caused by: java.lang.IllegalStateException: Failed to find target with hash string 'android-27'
This issue related to android SDK version enable for your Android Studio.
Please find the solution of this problem from attached screen.
You can open the SDK standalone by going to installation directory, just right click on the SDK Manager.exe and click on run as Administrator. i hope it will help.
the default gradle version 3.3 may have some bugs, I switched to gradle 3.5 and everything got ok
I have got same error for Android-28. In SDK manager - SDK Platform it shows me that Android API 28 is partially installed and no further updates available. so that I updated ANDROID-SDK-BUILD-TOOLS from SDK Tools and after restarting project. It will work. This might be helpful for other who faces same issue as I faced.
It seems like that it is only me who are so clumsy, because i have yet to found a solution that my case required.
I am developing a multi-modular project, thus base android module configuration is extracted in single gradle script. All the concrete versions of sdks/libs are also extracted in a script.
A script containing versions looked like this:
...
ext.androidVersions = [
compile_sdk_version : '27',
min_sdk_version : '19',
target_sdk_version : '27',
build_tool_version : '27.0.3',
application_id : 'com.test.test',
]
...
Not accustomed to groovy syntax my eye has not spotted that the values for compile, min and target sdks were not integers but STRINGS! Therefore a compiler rightfully complained about not being able to find an sdk a version of which would match HASH STRING '27'.
So the solution would be to make sdk's versions integers:
...
ext.androidVersions = [
compile_sdk_version : 27,
min_sdk_version : 19,
target_sdk_version : 27,
build_tool_version : '27.0.3',
application_id : 'com.test.test',
]
...
I had similar issue for android-29. My issue occurred because when AS was unzipping one downloaded SDK I had stopped it. For solving the issue disable gradle offline mode then sync with gradle files. You may need to set proxy and enable it.

Gradle 2.2.0 execution failed: SymbolForDebug

After upgrading gradle of my project (and library attached to it) from 2.1.3 -> 2.2.0 it doesn't build anymore and it says:
Error:Execution failed for task ':app:transformNative_libsWithStripDebugSymbolForDebug'.
java.lang.NullPointerException (no error message)
Anyone have a clue on why this is?
I found answer here:
https://stackoverflow.com/a/40117446/1088975
The point is to set both targetSdkVersion and compileSdkVersion to 22"
You need to change the following lines in build.gradle file:
android {
// SDK 24 worked for me - make sure you have the latest and update it accordingly.
compileSdkVersion 24
buildToolsVersion "24.0.2"
...
}
Maybe you can update the ndk version.
I update the ndk version from r10 to r13,and finally it worked.
You might want to check if the location of your NDK folder has any white space in it...if it has you can move your ndk folder to the c:\ drive and rebuild
Also, check the gradle versiom of your app and either upgrade or download later version, because some ndk versions do not support later gradle version

Always "aidl" is missing on Android Studio 1.2.1.1

I am using Android Studio version 1.2.1.1,and every time when create a new app ,error log shows "Error:Execution failed for task ':app:compileDebugAidl'.
aidl is missing" ,I know the solution for this problem is ,to write click on the app directory and select open module settings ,and compiled sdk version and build tool version must set accordingly.I need a proper solution for this problem and i don't want to repeat all these steps on every app creation.Can anybody help me out plz???
You have an invalid combination of project settings in your Gradle build files, probably caused by your installing the M Developer Preview bits from the SDK Manager.
Unless you are specifically trying to test the M Developer Preview, change your buildToolsVersion to be 22.0.1 in your app module's build.gradle file. Right now, it is probably something like 23.0.0_rc1.
May be you are using the Build Tools 23.0.0_rc1. In this case you have to use the gradle plugin 1.3.0-beta1.
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0-beta1'
...
}
}
If you are using the build tools 22.0.1, you can use the gradle plugin 1.1.x or 1.2.x
I was also facing the same problem.
Select the app folder and press F4. It'll open the Modular Settings.
(Right-clicking and selecting 'Open Modular Settings' will also do.)
Change 'Build tool version to "22.0.1" from "23.0.0 rc1".
Now this should work.
Downgrading "Build tool version" is a workaround, not a solution.
Please check this answer: https://stackoverflow.com/a/32495797/4160928

How to Get Cordova to Work With Android Studio?

I have the newest everything, node, npm, android studio, cordova.
I created a new project with:
cordova create test
cd test
cordova platform add android
I go into Android Studio, import project, go to test/platforms/android it finds the build.gradle file, works on it for awhile then spits out:
Gradle version 1.10 is required. Current version is 2.2.1
So I go to my build.gradle file, and update the line
dependencies {
classpath 'com.android.tools.build:gradle:0.10.+'
}
to:
dependencies {
classpath 'com.android.tools.build:gradle:0.14.+'
}
And then I re-import my project, it chugs on it for awhile, then spits out:
Error:failed to find Build Tools revision 19.0.0
So I install Build Tools 19.0.0
And it tells me:
Error:The SDK Build Tools revision (19.0.0) is too low for project 'android'. Minimum required is 19.1.0
So I look at my SDK Manager and I have 19.1.0 installed
So I go back into my build.gradle file:
and I change:
buildToolsVersion "19.0.0"
to
buildToolsVersion "19.1.0"
And re-import again,
And still tells me:
Error:The SDK Build Tools revision (19.0.0) is too low for project ':CordovaLib'. Minimum required is 19.1.0
I even try and delete SDK Build Tools revision 19, and keep 19.1 but it still tells me that.
Can anyone that has done this song and dance please help me?
I had exactly the same problem and just fixed it. What you need to do is complete the same buildToolsVersion "19.1.0" change to the build.gradle file in the CordovaLib folder within your platform project folder e.g. platforms/android/CordovaLib.
I solved the problem, modifing gradle file App and gradle file CordovaLib, with the following information:
changed dependencies {
classpath 'com.android.tools.build:gradle:1.1.0+'
}
}
and
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
}
Tested on Android Studio 1.1
I had same problem. In the end choosing "Import Non-Android Studio project" and navigating to the android folder platforms/android worked. Wasn't sure if you initially choose the "Import Non-Android Studio project" option.
I had the same problem and corrected the content of build.gradle directly in Android Studio (replacing 19.0.0 with 19.1.0). The build was succeful after that. Of course, this is only a workaround until the Cordova team fixes the problem permanently. Good luck.

How to make my Gradle build file to always use the newest available Android Build Tools

I have a Gradle build file that contains the following section:
android {
compileSdkVersion 18
buildToolsVersion "18.0.0"
This defines the exact version of build tools to use. Is it possible to specify this as a min requirement as it is for dependencies?
I tried:
android {
compileSdkVersion 18
buildToolsVersion "18.0.+"
to automatically use minor updates of the build tools if available but that isn't working.
It produces the following error:
A problem occurred evaluating root project '####'.
Invalid full revision: 18.0.+
This is an intentional choice. The idea is that your build should be perfectly repeatable, and if you build on a different machine that may have a later version of the build tools, it won't suddenly start having errors. I could see an argument for wildcarding to the latest bugfix release ala 18.0.+ the way it does for other version strings in Gradle, but even then that breaks repeatability if there's a regression in the newer version of the build tools.
The relevant feature request for this is at https://code.google.com/p/android/issues/detail?id=59550

Categories

Resources