I am trying to build my first app with react-native.
I am following these 2 tutorial:
https://facebook.github.io/react-native/docs/getting-started.html#content
https://facebook.github.io/react-native/docs/android-setup.html
I am sure that I installed all the requirements from the second link but when I try running my app with react-native run-android, I get the following error:
I executed this command while running genymotion.
This is all that I have installed in Android SDK:
I tried to install Android build tools 23.0.1 but I get this error:
What should I do?
You should install Android SDK Build Tools 23.0.1 via Android SDK. Don't forget to check Show Packages Details.
I faced the same problem and I solved it doing the following:
Go to /home/[USER]/Android/Sdk/tools
and execute:
$android list sdk -a
Which will show a list like:
Android SDK Tools, revision 24.0.2
Android SDK Platform-tools, revision 23.0.2
Android SDK Platform-tools, revision 23.0.1
... and many more
Then, execute the command (attention! at your computer the third option may be different):
$android update sdk -a -u -t 3
It will install the 23.0.1 SDK Platform-tools components.
Try to build your project again.
Either install v23.0.1 of the build tools (the fifth row in your screenshot), or change your code to use the build tools version you already have installed (v23.0.3). This can be specified in your app's build.gradle file:
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
...
}
}
As per duncanc4's comment below,
The build.gradle file you want to edit is in the android/app folder
within your project directory.
The error you're getting seems to be related to system's permissions, since it's not able to create a folder.
Try running the sdk-manager using root (with su or sudo commands).
I had this error:
Failed to find Build Tools revision 23.0.2
When you got updated/installed:
Android SDK Build Tools
Android SDK Tools
Change version number in build.gradle
FROM
buildToolsVersion "23.0.2"
TO
buildToolsVersion "25.0.2"
How to find what Build Tools version you have
Check your $ANDROID_HOME, sometimes is /usr/local/opt/android, but it's not your install sdk path, change it and fix this problem
Nothing helped until I found this solution : https://stackoverflow.com/a/39068538/3995091
In Android SDK, the build tools with the correct version where shown as installed, but still I got the same error saying they couldn't be found. When I used the above solution, I found out they were indeed not installed, although Android SDK thought they were. Installing them solved it for me.
While running react-native In case you have installed 23.0.3 and it is asking for 23.0.1 simply in your application project directory. Open anroid/app/build.gradle and change buildToolsVersion "23.0.3"
In the Gradle Console (link available in the window bottom right), you have two tabs: the error is shown in Gradle Build tab. Click on the Gradle Sync tab, then click on the Install Build Tools XX.X.X and sync project link. This will download the build version required by your project.
You may also change your project SDK version but you don't always have this option if it is imposed.
If you already install the correct Android SDK Platform-Tools (Build Tool) and you still get an error, try to invalidate the cache; File -> Invalidate caches / Restart....
On my system, Android SDK Manager showed /usr/local/Cellar/android-sdk as the SDK path, when $ANDROID_HOME was /Users/james/Library/Android/sdk. I just added a symlink for the correct build tools version.
Two solutions: You have to instal the required buildToolVersion or set it as described above.
Notice that if you are trying to set the buildToolsVersion "23.0.3" using Android Studio 3.0 or more it won't work until you remove all builversion you have keeping just one last version you use.
I read this somewhere else and this works for me.
Hope this helps.
As the error says
Failed to find build Tools revision 23.0.1
This means that in your project you have used
buildToolsVersion "23.0.3"
So,You need to download the exact same version this makes the error disappear
**Step 1:**
GO to Tools and click SDK Manager
**Step 2:**
you can see SDK Platforms ,SDK Tools and SDK update Sites
**Step3:**
Click SDK Tools and click show package details
**Step 4:**
Select the version that you have mentioned in your Project
These Steps has solved my issue.
If anyone can't build their downloaded source code (probably google codelabs source code) with Android Studio, try simply remove the buildToolsVersion from the build.gradle file, and Android Studio will build the project with it's default latest buildToolVersion
¯_(ツ)_/¯
Each version of the Android Gradle Plugin now has a default version of the build tools.
So, probably you specified build tool version explicitly in the build file.
Just remove buildToolsVersion = "x.y.z" from your build.gradle script.
If, for some reason, you need that specific revision, follow the other answer.
Just install it from Android Studio ;)
Related
As of today I've been running into an error setting up new projects in Android Studio. Right after creating a blank project the log mentions "Gradle sync failed: failed to find Build Tools revision 24.0.0 rc1."
First I looked online to see how to resolve this and came across this similar question, and followed the solution given (setting the build tools version in the module settings). However, this results in Android Studio telling me that the method "android()" cannot be found and "The project 'TestBlankApplication' may be using a version of Gradle that does not contain the method."
Additionally, the SDK Manager informs me that I have Build-tools 24 rc1 installed. So I do not know why Android Studio cannot find it.
Screencap of SDK Manager showing 24 rc1 installed:
Does anyone know how this can be resolved? Thank you.
Why you got this error:
Android studio does not come with build tools for different android versions when you download it. It also does not make sense since there are multiple versions of build tools and each of them will take hundreds of megabytes on your hard drive. This is why Android Studio installation package is 1 GB while Xcode, which has all the build tools, is 6 GB
When you choose a specific build version in the build.gradle file, your android studio may or may not have that version of build tool installed. And if not, you will see the error complaining about it.
How to fix it
You just need to install the specific version of build tool mentioned in build.gradle like this:
Click File > Settings (on a Mac, Android Studio > Preferences) to
open the Settings dialog.
Go to Appearance & Behavior > System Settings > Android SDK (Or
simply search for Android SDK on the search bar)
Go to SDK Tools tab > Check the Show Package Details check box
Select the specific version of the build tool and click on the Apply
button
After the installation, sync the project
Demos
(I choose a different version just to show you how to apply the changes by that apply button :) )
And then sync the project. The error is gone now!
Try to change the buildToolsVersion for 23.0.2
in Gradle Script build.gradle (Module App)
and set buildToolsVersion "23.0.2"
then rebuild
Follow the below procedure to solve the error.
Go to File -> Project structure.
From the drop down box, you will know all the version of build tools that are installed in your android studio.
Look for a higher version. If Gradle cannot find 24.0.0, check if 24.0.1 is present in drop down.
Do a complete code search. Find all the places where "24.0.0" is found. Replace it with "24.0.1"
Do a gradle sync.
I had same problem and eventually found out that in file build.gradle the version does not match the version of buildTools in my installed sdk.
(because I imported project done at home on different computed with updated sdk)
before:
build.gradle(app): buildToolsVersion "24.0.2"
Android\sdk\build-tools: file "25.0.1"
fixed:
build.gradle(app): buildToolsVersion "25.0.1"
Then just sync your project with gradle files and it should work.
SDK tools required build tool version installation helped me.
You just need to install required build tool version from,
SDK Manager -> SDK tool -> Show Package details -> Select required build tool version and install it.
Go to Build Gradle (Module:app)
Change the following.
In my case, I choose 25.0.3
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.cesarhcq.viisolutions"
minSdkVersion 15
targetSdkVersion 25
After that, it works fine!
Android Studio updating didn't work for me. So I updated it manually. Go to your sdk location, run SDK Manager, mark desired build tools version and install.
I ran into this problem after a fresh install of Android Studio (in GNU/Linux). I also used the installation wizard for Android SDK, and the Build Tools 28.0.3 were installed, although Android Studio tried to use 28.0.2 instead.
But the problem was not the build tools version but the license. I had not accepted the Android SDK license (the wizard does not ask for it), and Android Studio refused to use the build tools; the error message just is wrong.
In order to solve the problem, I manually accepted the license. In a terminal, I launched $ANDROID_SDK/tools/bin/sdkmanager --licenses and answered "Yes" for the SDK license. The other ones can be refused.
faced the same problem: Gradle sync failed: failed to find Build Tools revision x.x.x
reason: the build tools for that version was not down loaded properly
solution:
Click File > Settings (on a Mac, Android Studio > Preferences) to open the Settings dialog.
Go to Appearance & Behavior > System Settings > Android SDK (Or simply search for Android SDK on the search bar)
Go to SDK Tools tab > Check the Show Package Details checkbox
uncheck the specific version to remove it.
click apply.
then follow the steps 1 to 3 and 6.
Select the specific version of the build tool and click on the Apply button
After the installation, sync the project
Another thing is that all libraries from google (e.g. support lib, CardView and etc.) should have identical versions
I ran into a same problem.
I was running portable version of android studio so downloaded a package from https://developer.android.com/studio/#downloads
and installed it, and like that, done!
1) You need to change to version that is available on you studio
2) Here is how you find out version that is available for your studio
Go to File -> Project structure.
source is from #Siddarth Kanted Thanks to Siddarth Kanted.
3) And when you want to install more versions of build tool you can learn it from #Fangming user from this post.
easy working solution.
I been developing my project in my MacBook pro using Android Studio. I stored my project in a GitHub repo. But now I’m using Windows laptop so I cloned my project and try to run in Android Studio and I am getting the following error:
Error:failed to find Build Tools revision 23.0.0 rc2
Install Build Tools 23.0.0 rc2 and sync project
I clicked on
Install Build Tools 23.0.0 rc2 and sync project” but I’m getting another error:
Loading SDK information...
Ignoring unknown package filter 'build-tools-23.0.0-preview'Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
Install Failed. Please check your network connection and try again. You may continue with creating your project, but it will not compile correctly without the missing components. (I have already checked my network connection, I’m connected to the internet using a wired connection).
When I clone my project in a Macbook everything works fine, so I'm not sure why it's not working in Windows.
Here is the screenshot:
You can use
compileSdkVersion 23
buildToolsVersion "23.0.0"
Then
Clicking the button Sync Project With Gradle Files should do the trick:
Tools -> Android -> Sync Project with Gradle Files
If that fails, try running Rebuild project:
Build -> Rebuild Project
For more details ,you can visit
AndroidStudio: Failed to sync Install build tools
AS far as your this error line concern
Error:failed to find Build Tools revision 23.0.0 rc2 Install Build
Tools 23.0.0 rc2 and sync project
It clearly says that you need to install the above mention package to build the project I mean to see the project according to new build version and techniques. So you need to update your sdk .
now come to the second error , There are couple of posibilites which I can think of
1. Make sure you are not behind any type of proxy, if so then set that proxy in your AS too.
if you have not any real issue in your network such as As I described above, then You are better to delete the folder of 23.0.0 rc2 and respective folder I mean 23XX folders. and then try launching the sdk manager again
I hope this would solve your problem , mean while if you want to see your project on different build version , please see the image below and try this
I hope this would solve your problem.
Edit 2: As I read your comment after posting this answer
You should change the build tool version in your build.gradle file in the Android studio. I think that this would work
I have changed compileSdkVersion and buildToolsVersion in gradle settings like below.It works.
compileSdkVersion 23
buildToolsVersion "23.0.0"
By
Kalaimani.R
Going crazy with this error from about a couple of hours.
The error is:
failed to find Build Tools revision 23.0.0 rc1
But I think to have all update (also the release candidate!)
This is the image: thank you.
Go to File > Project Structure > Select Module > Properties you will landing to this screen
Select Build Tools Version same as version selected in Compile Sdk Version.
Hope this will resolve your issue.
I could fix it by changing it to
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
}
in build.gradle file
I had the same issue, with Build Tools revision 24.0.0-rc4. The fix was to install the package using the command line.
~/Android/Sdk| ls -1 build-tools/
23.0.3
24.0.0-rc4
~/Android/Sdk| ./tools/android list sdk -a | grep "SDK Build-tools"
4- Android SDK Build-tools, revision 24 rc4
5- Android SDK Build-tools, revision 23.0.3
6- Android SDK Build-tools, revision 23.0.2
7- Android SDK Build-tools, revision 23.0.1
8- Android SDK Build-tools, revision 23 (Obsolete)
...
~/Android/Sdk| ./tools/android update sdk -a -u -t 4
...
~/Android/Sdk| ls -1 build-tools/
23.0.3
24.0.0-preview
24.0.0-rc4
(note that 4 in the android update sdk command above refers to the preceding list's number for the desired version, found at the beginning of the line).
The directory build-tools/24.0.0-rc4/ had been created when I installed the package from Android Studio's SDK Manager. The above method created build-tools/24.0.0-preview/.
My app-level build.gradle script uses the -rc4 version, as specified in the setup guide:
android {
compileSdkVersion 'android-N'
buildToolsVersion '24.0.0-rc4'
}
I do not understand the correlation between -rc4 and -preview or why specifying 24.0.0-rc4 picks up the -preview package, but it did fix the issue for me.
I have the same problem.
i have solved this issue by the following point.
First one is go to inside build.gradle app file and change this
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"
}
with this one
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
}
I hope this will solve your issue.
I had the same problem and fixed it by going to File->Project Structure->Project and changing the Android Plugin Version to 1.3.0-beta1
Hope this helps!
I faced the same issue today,
And solved it easily by following points
1) Start the StandAlone SDK manager (To open the standalone sdk manager - Tools>Android>SDKManager> at Bottom YOu will see a link to launch StandAlone SDK manager)
2) Delete tha package of SDK Build Tools that you have already installed for e.g 24.0.0 rc4.
3) Close the standalone SDK manager then Restart Android Studio.
4) Once after restart the gradle will start building the project and you will get an alert download the package of SDK build tool and Sync. CLick on that and you will start downloading like that...
I hope this helps
I had the same problem, in my cases this happened because I changed the time on my computer to load .apk on google play. I spent a few hours to fix "this" problem until I remembered and changed the time back.
One of the answers ask you to use buildToolsVersion 23.0.0, but you would get buildToolsVersion 23.0.0 has serious bugs use buildToolsVersion 23.0.3. I did that then I started getting message buildToolsVersion 23.0.3 is too low from project app update to buildToolsVersion 25.0.0 and sync again. So I did that and it worked , So here are the final changes.
Inside app's build.gradle change this
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"
}
with this one
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
}
based on your screenshot I can see you have BuildTools ver 23.0.0 rc2 installed. So to get it right open up your gradle build file "build.gradle(Module:app)" and edit buildToolsVersion part like that:
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"
}
In case you have multiple SDKs locations (might happen if you play around with multiple Android Studio versions and create new location for SDK, what I did), make sure to check the local.properties file (both of the project and of your module, if you have such structure) and check if the line sdk.dir=/home/yourSdkLocation points indeed to the SDK you want to use.
This was the reason it wasn't working for me and it has fixed this.
There may be some file access permission/restriction problems. First check to access the below directory manually, check whether your TARGET_VERSION exists, Then check the android sdk manager.
sdk/build-tools/{TARGET_VERSION}
Had the same problem. I my case the build.gradel(app) was missing buildToolsVersion "27.0.0". So I open a previously working project to determine the version and added this line buildToolsVersion "27.0.0". Now it works fine.
Hope this helps.
I was also facing the same problem with gradle. Now I have solved by installing the highlighted in red. To navigate on this page Open Android studio > Tool > Android > SDK Manager > Appearance & Behavior > System Settings > Android SDK > SDK Tools (from tab options) > Show Package details(check box on the right bottom corner). After installing these just refresh the gradle everything will be resolved.
In case you have error regarding 'SDK build-tools failed' while installing Android Studio, Then you can Download build-tools from - https://androidsdkmanager.azurewebsites.net/Buildtools
Go to File > Project Structure > Select Module > Properties
After that CLICK on your project which will shown in LEFT PANEL
Then Select Properties
Change Build Tool Version to 22.0.1
It works for sure
problem:
Error:failed to find Build Tools revision 23.0.0 rc2
solution:
File > Project Structure > click on Modules > Properties
Change Build Tool Version to 23.0.1
its work for me
enter image description here
Start the project structure( file>structure)
You can see:
on the left, modules list;
on the right, Properties>Build Tools Version
there maybe are more than one modules.
change "Build Tools Version" for every Module.
it works.
I'm trying to import my Eclipse based Android project using the build.gradle file. I get the following message: "failed to find Build Tools revision 18.0.0". However, according to the Android SDK Manager, I have Android SDK Build-tools 18.0.1 installed.
I am doing all this on a 64-bit Windows 7 machine, if that's relevant.
How do I fix this?
UPDATE: I actually only updated to Build-tools 18.0.1 this morning. I then noticed that, when making a new project in Android Studio, it wouldn't allow me to create a project using Android 4.3 (4.2.2 was the latest allowable version). I tried dropping the target version of my project to Android 4.2.2, and re-exporting it. Now Android Studio complains about not being able to find Build-tools 18.0.1 when I try to import this project.
I was an Android Studio virgin too up until 10 minutes ago. I ran into the same problem. If you check your SDK Manager in Android Studio (or Eclipse I believe) it will show which tools you have installed. I am/was missing build tools 18.0.1 too and getting the error....but it was because I hadn't installed them.
So without modifying the Gradle build files, I was able to install the build tools using the SDK Manager and get everything up and running.
See this image:
As an aside, I also had to update the API version as well because it selected an API version that wasn't installed (which I don't get because it was when I compiled with Eclipse).
Hope this helps.
This did the trick for me.
In build.gradle file inside the main module modify the line
buildToolsVersion "18.0.0"
to
buildToolsVersion "18.0.1"
I'm very new to Android Studio (as of last night). I encountered the same problem. I opened up the 'build.gradle' file and modified the lines with: "compileSdkVersion 18" and "buildToolsVersion 18.0.1" to 17 and 17.0.0 respectively. It seems to do the trick!
you must make sure the build.gradle file contains the same version of the installed build tools.
you can find this out by looking in the /sdk/build-tools/android-X.Y.Z/source.properties file under the Android Studio installation
e.g.
Pkg.UserSrc=false
Pkg.Revision=18.1.1
then plug that revision number into the gradle build file:
android {
compileSdkVersion 18
buildToolsVersion "18.1.1"
...
}
I had issues with Gradle too. A full delete and install the latest version fixed it.
I also had the same problem then I have checked my Enviornment Variable and it is pointing to my old sdk which does not have Build tool 18.0.x After pointing it to new sdk everything goes well.
When I boot up Android Studio and select "New Project..." and go through creating a new project, I get this popup error:
Failed to import new Gradle project: failed to find Build Tools revision 17.0.0
Consult IDE log for more details (Help | Show Log)
I would love to consult the IDE log, but I haven't even managed to get into the application to do much of anything. I've went through the preferences multiple times to see if I can set a path for the Build Tools, but I can't find much of anything. How do I fix this, or how do I get into the application without opening a project so I can at least see the logs?
After spending a few hours: I restarted the Android SDK Manager and at this time I noticed that I got Android SDK Platform-tools (upgrade) and Android SDK Build-tools (new).
After installing those, I was finally able to fully compile my project.
Note: The latest ADT (Version 22) should be installed.
As of May 2020, A really straightforward solution using Android Studio:
Open Android Studio
From the top, choose File > Settings > Appearance & Behavior > System Settings > Android SDK
click on the tab SDK Tools at the top. Then highlight Android SDK Build Tools from the list.
Check "Show Package Details" check box, choose the build tools version you need and then click Apply.
Look in the SDK Manager what is your highest Android SDK Build-tools version, and copy this version number in your project build.gradle file, in the android/buildToolsVersion property (for me, version was "18.1.1").
Hope it help!
This is what I had to do:
Install the latest Android SDK Manager (22.0.1)
Install Gradle (1.6)
Update my environment variables:
ANDROID_HOME=C:\...\android-sdk
GRADLE_HOME=C:\...\gradle-1.6
Update/dobblecheck my PATH variable:
PATH=...;%GRADLE_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
Start Android SDK Manager and download necessary SDK API's
It happens because Build Tools revision x doesn't exist.
Today, the latest version is 23.0.2 (subject to change all the time).
The buildToolsVersions you want are included in the Android SDK, normally installed in the <sdk>/build-tools/<buildToolsVersion> directory.
Don't confuse the Android SDK Tools with SDK Build Tools.
Change in your build.gradle's buildToolsVersion to some version installed in <sdk>/build-tools
android {
buildToolsVersion "23.0.2"
// ...
}
Whenever you will try to run a project with build tool version not present in studio, You will face this error.
As of now in 2017, It has been made really simple by Android Studio.
It will prompt you about this issue, along with something like this
You just have to click on it and the system will download to the build version required to run the project.
I had the API 17 installed but that was not enough. What I really need installed is the "Android SDK Build-Tools 17".
You can locate your "Android SDK Build-Tools X" inside the first child, named "Tools", in the "Android SDK Manager".
in your Project perspective, look for Application --> build.gradle and edit this lines
android {
compileSdkVersion "android-N"
buildToolsVersion "24.0.0 rc1"
like this:
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
I had this problem recently, my project didn't include local.properties file.
Check local.properties file if it includes sdk.dir with correct path to sdk
i think you can download the latest android SDK and use it.i do this and fixed the problem and work well.
here is the link:
http://developer.android.com/sdk/index.html#download
Try to run gradle at the command line first. It might prompt you to setup and environment variable:
export _JAVA_OPTIONS="-Xms256m -Xmx1024m"
Read more here: 1, 2
Further make sure that the Android SDK build tools (adb, aapt, dx, dx.jar) are available in the PATH. If not you can create symlinks at the appropriate locations. They changed with the release of new SDK versions. Here is a shell script which creates the symlinks within the $ANDROID_HOME folder for you.
Basically error saying your are missing "Android SDK Build-tools" installed.
This worked for me after I tried many solutions:
For some reason the adb process didn't restart itself after installing new packages. Manually killing adb.exe and attempting to import the project another time solved this problem for me.
Uninstall the Android SDK Tools and then reinstall them from Tools > SDK Manager.