Android studio isn't starting - android-studio

I have installed an Android studio from here. It worked, i wrote a hello world project and then closed it. But the IDE does not start second time. It gives me an error "caches are locked".
I installed unlocker and it says that no process blocks this folder. Does anybody know where is the problem? Thanks in advance.

I also faced this problem. I have solve my problem as follows:
Go to folder where android-studio is installed. (C:\Program Files (x86)\Android\android-studio)
Now go back to previous folder. (C:\Program Files (x86)\Android)
Right click on the android-studio folder and go to properties.
Now in Properties window, go to Security Tab.
Click the Edit Button
Now, a new window will open, here you click the Users(your-username-or-your-group-name)
Now, from the List below, Check "Allow" in front of "Full control"
Now press "OK", then again "OK"..
Its done.. Now you can use Android Studio easily instead of Running it As Administrator every time..
For details please visit this page

If you're like me, you could be trying to start a version prior to 0.2.0 (in my case 0.1.6)
Following Google's notes here: http://developer.android.com/sdk/installing/studio.html
You'll need to remove and re-install Android Studio 0.2.0 & up
"Note: There is not a patch update available from 0.1.9 to 0.2. To update from Android Studio 0.1.x to 0.2.x, you must install a new Android Studio bundle from this page. The reason for that is that we have made changes to the bundled SDK such that it includes a pre-configured local Maven repository which can serve up the v4 support library and which is required for creating new projects."
Also be aware that if you have your Android SDK files stored here:
C:\Program Files (x86)\Android\android-studio\sdk
You should move them before the uninstall or you'll need to download the SDK files again.
After the un-install and re-install now working on my Windows 7 64-bit system

Related

Not able to connect adb after upgrate Android Studio to 3.4

unable to connect to adb.check the event log for a possible issue, verify that localhost entry is pointing to 127.0.0.1 or:: 1 for ipv4 or ipv6
Tried adb kill-server, restart, invalidate restart nothing works.
Same issue reported over here https://issuetracker.google.com/issues/130791561
Note: I have not added any file or anything in studio, it's fresh installed Studio after format a full system still issue is there.
Replace your platform-tools with this one and delete the other one.
https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip
I was also facing this issue in android Studio 3.4 version, but now I have fixed it , if you are using windows then follow these steps:
Download Platform tools from here
https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip
Extract downloaded zip file
Go To location "C:\Users\your_computer_user_name\AppData\Local\Android\Sdk" and Delete "Platform tools" folder
Copy and Paste, downloaded platform tool folder to above location
Now Go to your android studio and Rebuild your project Then run.
For Mac Users, follow these simple steps :
Just simply Navigate to Tools > SDK Manager> Android SDK>, then click on the Tab of SDK Tools, then look for Android SDK Platform-tools and update it.
Then the last step, Invalidate cache and restart your IDE, after that, then finally you restart your Mac. (Sometimes it's this step is unnecessary)
It will work out successfully.
Solution for Linux Users.
System info: Linux Mint Cinnamon 19.1 , Android Studio 3.4.1
Issue description: Problem with platform tools.
Solution: Remove the folder manually and update SDK tools through Android Studio.
Step 1: Go to your Android SDK installation folder. By default under your home directory. Choose platform-tools and simply delete. (/home//Android/SDK)
Step 2: Open Android Studio and go to SDK Tools. (File -> Settings -> Appearance & Behaviour -> System Settings -> Android SDK -> SDK Tools) By the moment you should be able to see Android SDK Platform Tools line unchecked.
Step 3: Put a check to install Platform Tools and press OK. Notice it'll relocate the folder to the directory where deleted.
Now that you re-installed the platform tools, restart the Android Studio and your deployment targets should show up.
If you don't install the platform tool back and ever try to build or run a project you'll get this IDE error. Just FYI :)
So that's all. Enjoy.
Happy coding
If you use Windows, you might have a corruption in api-ms-win-crt-runtime-l1-1-0.dll.
Try to update it - you can get the update from Microsoft's website.
You should check it - path/to/sdk/platform-tools and try to run adb.exe
When you update Sdk platform tools(which contains adb.exe) to release 28.0.2 and if you are using windows 8.1 then it needs few updates from windows.
As per SDK Platform tools release notes(https://developer.android.com/studio/releases/platform-tools):
Updated Windows requirements : The platform tools now depend on the Windows Universal C Runtime, which is usually installed by default via Windows Update. If you see errors mentioning missing DLLs, you may need to manually fetch and install the runtime package."
Windows update url: https://support.microsoft.com/en-ca/help/2999226/update-for-universal-c-runtime-in-windows
Prerequisite for Windows update url: https://www.microsoft.com/en-us/download/details.aspx?id=42327
Faced the exact same issue but after updating with prerequisite url first then the other url provided now it is working perfectly fine for me.
It worked for me by selecting -> Use libusb backend
This worked for me on Windows:
Goto cmd write %temp% hit enter -> delete all data from there.
Restart your Computer.
Open Android Studio now, it will work.
Clear all cache memory (related to Android Studio)
Restart ADB manually from Android Studio (first option)
Open Command prompt and got android sdk>platform-tools> adb kill-server
press enter
and again adb start-server
press enter
Restart ADB manually form Android Stidio (second option)
go to your (SDK store path) sdk>platform-tools>adb
press enter
ex. D drive > sdk>platform-tools>adb
Restart your system
Delete the platform-tools folder from the sdk and replacing with the same from your another pc. I am also facing this problem after updating to 3.4. If you face same problem please update to Android Studio 3.5 Canary Channel.
The reason is for ADB server problem. Simply re-run your adb.
(Go to your SDK folder then inside platform-tools folder you can see adb.exe. copy the path location and paste it in your computers system Environment variable. Set a new path there and paste the adb.exe file location there. hope it will solve )
If you are using Genymotion, there is an update that fix the problem.
Genymotion 3.0.2 (April 18th, 2019)
Corrections
We have fixed an
incompatibility with the adb tool bundled in the platform-tools 28.0.2
package of the Android SDK, which caused failures to start virtual
devices.
This new version of adb changed the behavior of the “adb connect
:” command by making the “port” part mandatory. This
broke Genymotion Desktop in a few places where it did not pass the
port. We have adjusted the way we call “adb connect” and also updated
the version we ship with the product to match the one in
platform-tools 28.0.2.
If non of the above answers worked for you (as same happend to me), down grade to the old version of Android Studio by following these steps:
Uninstall current Android Studio
Go to Android Studio Archive and download any older version
After installation, Open the project. You might see an error like this
This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer.
Now, open project gradle and update classpath tools.build version. I.e. in my case Android studio version is 3.2 and classpath 3.2.1
Hope it might save someone time.
I faced this issue last night, and I tried these methods to fix:
download older platform-tools and place it in the android sdk folder.(not work for me)
adb kill-server, adb start-server.(not work for me, adb had no response with these cmd)
kill the process that occupies port 5037.(for me, there is no other .exe run at this port)
reinstall platform-tools in Android Studio.(not work)
download ADB Kits and replace them in platform-tools folder.(work!!!)
It seems that my adb file has been modified or replaced by some programs. You can try these methods, and I hope some of them can work for you.
I had this issue only after a Genymotion update, on Mac.
What worked for me: Open Genymotion preferences, Select ADB, choose "Use custom Android SDK tools" and points to your Android SDK folder.
Actually the problem is not with the android studio version 3.4
Problem is with the android platform tools version which is latest one 29.
So install the previous version of the android platform tools version it will solve your problem. as above #Ved mentioned.
Ved link:
https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip
EndTask adb.exe from Background processes (TaskManager) and Run Application again.
It works for me

How to install Android SDK on Linux after deleting earlier version? (2017 Martch)

In the past I could download and install Android SDK separately. I cannot find it any more on Google's Developer site, only Android Studio, which supposedly contains the SDK too (?). When starting the Android Studio it looks for the SDK.
I installed the Ubuntu (I'm using 16.10 Yakkety Yak) repo's Android SDK, that didn't help much because it is in /usr/lib/android-sdk with root privileges and Android Studio disses it. Now I'm scratching my head how I going to scrape all of that off as soon as I find out where can I install an SDK from.
I did check at least 2-3 Stack Overflow Questions on the topic, but all of them seems to be outdated, so please be very careful to mark this as a duplicate.
I have to add that I had both the SDK and the Studio installed before on my system. That turns out to be crucial info.
Are the "command-line tools" at https://developer.android.com/studio/index.html#downloads what you're looking for?
Go to https://developer.android.com/studio/index.html#linux-bundle and download the zip file. Extract it into your home directory(or anywhere inside your home directory).
Move into that extracted files directory, open up bin folder. You'll see a file[script] named studio.sh. Run that and Android will automatically start downloading the SDK.
Alternatively:
Set your ANDROID_HOME environment variable to /usr/lib/android-sdk:
vim /home/user/.profile
Add
export ANDROID_HOME="/usr/lib/android-sdk"
Well, after wiping the .Android-Studio-2.x and .android directories form my home, Android Studio offered the installation of the SDK. So the cause was leftover of previous installs, I haven't mentioned that fully in my question.

Can't configure SDK after installation of Android Studio

So I got my new laptop(Win 10) and installed the Android studio 2.2.3 with SDK bundle.
When I first executed Android Studio it got stuck on the splash screen. adding "Add disable.android.first.run=true" to the idea.properties file solved it.
After I got to the first screen, I needed to configure SDK in order to create new project so I clicked on Configure->Project Defaults -> project structure.
I set the location of the SDK and JDK , and then it gets stuck with the "Checking Availability" message:
Checking Availability
I also tried to configure the sdk by clicking from the first screen on
Configure -> SDK Manager.
In this screen it also gets stuck with the message :Looking for updates":
Looking for updates
I tried to install it as Administrator and also to install lower version.
It didn't help.
Thanks in advance
First of all update Android Studio to latest version(V2.3.1) with complete bundle.
Then you don't need to install jdk manually. after finish installation check "Use embedded jdk" in project structure if not checked. and if you needed Android NDK kit then you can download it later.

Internal error. Please report to https://code.google.com/p/android/issues

Anybody knows how to get around this issue while launching Android Studio?
I saw a Google ticket here, but it was not useful: https://code.google.com/p/android/issues/detail?id=164202
Internal error. Please report to https://code.google.com/p/android/issues
java.lang.AssertionError: Unexpected node Pythonid; nodes=[org.jetbrains.plugins.terminal, org.jetbrains.plugins.javaFX, org.jetbrains.plugins.gradle, org.jetbrains.plugins.github, org.jetbrains.java.decompiler, org.jetbrains.idea.maven, org.jetbrains.android, org.intellij.intelliLang, org.intellij.groovy, org.editorconfig.editorconfigjetbrains, hg4idea, com.millennialmedia.intellibot, com.jivesoftware.robot.intellij.plugin, com.intellij.ui-designer-new, com.intellij.tasks, com.intellij.properties, com.intellij.modules.xml, com.intellij.modules.xdebugger, com.intellij.modules.vcs, com.intellij.modules.python, com.intellij.modules.platform, com.intellij.modules.lang, com.intellij.modules.json, com.intellij.modules.java, com.intellij.modules.androidstudio, com.intellij.modules.all, com.intellij.java-i18n, com.intellij.copyright, com.intellij, com.google.gct.testing, com.google.gct.login, com.google.gct, amailp.intellij.robot, TestNG-J, Subversion, JUnit, Git4Idea, Coverage, CVS]
at com.intellij.util.graph.GraphGenerator.buildOuts(GraphGenerator.java:55)
at com.intellij.util.graph.GraphGenerator.<init>(GraphGenerator.java:36)
at com.intellij.util.graph.GraphGenerator.create(GraphGenerator.java:40)
at com.intellij.ide.plugins.PluginManagerCore.createPluginIdGraph(PluginManagerCore.java:543)
at com.intellij.ide.plugins.PluginManagerCore.initializePlugins(PluginManagerCore.java:1126)
at com.intellij.ide.plugins.PluginManagerCore.initPlugins(PluginManagerCore.java:1256)
at com.intellij.openapi.application.impl.ApplicationImpl.loadApplicationComponents(ApplicationImpl.java:348)
at com.intellij.openapi.application.impl.ApplicationImpl.<init>(ApplicationImpl.java:215)
at com.intellij.openapi.application.ex.ApplicationManagerEx.createApplication(ApplicationManagerEx.java:45)
at com.intellij.idea.IdeaApplication.<init>(IdeaApplication.java:112)
at com.intellij.idea.MainImpl$1$1.run(MainImpl.java:47)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
It looks like you have a corrupted installation file - completely uninstall Android Studio and download it again from the website.
Install the newly downloaded version of Android Studio on your system - the one you had previously downloaded is likely corrupt.
Here are the instructions to uninstall Android Studio completely. Note that some files may be located in a different location depending on where you chose to install and the versions you've been using so if something is not in its normal place, please let me know.
Please follow all of the steps below in order.
Run the uninstaller
The first step is to run the uninstaller. Open Control Panel by accessing it from the menu when you right-click the Start Button (This applies for Windows 8 systems). Then, under Programs, select Uninstall a Program. After that, click on Android Studio and press Uninstall. If you have multiple versions, uninstall them as well.
After you have uninstalled Android Studio, it is recommended that you restart before proceeding with the steps below.
Remove the Android Studio files
To delete any remains of Android Studio setting files, in Windows Explorer (The file browser in Windows), type this as the File Path:
C:\Users[YOUR WINDOWS USERNAME]
Replacing [YOUR WINDOWS USERNAME] with the username of your account on Windows. If you don't know your username, navigate to C:\Users and it will list all users on the system.
Here, delete .android, .AndroidStudio and any versions of this directory with versions on the end, .gradle and .m2.
Then, go to
C:\Users\Harry[YOUR WINDOWS USERNAME]\Roaming
and delete the JetBrains directory.
Finally, go to
C:\Program Files
and delete the Android directory.
Remove the SDK
To delete any remains of the SDK, in Windows Explorer, type this in as the File Path:
C:\Users[YOUR WINDOWS USERNAME]\AppData\Local
Here, delete the Android directory.
(Optional) Delete all previous projects
If you want to delete any of your previous projects, the directory where your projects are found is the AndroidStudioProjects directory. It is located in your root user file, C:\Users[YOUR WINDOWS USERNAME].
Hopefully this will now have deleted the Android Studio files and you can now try reinstalling the tools.
If you have any problems doing so, give me a shout :)
1st step please disconnect your internet connection and restart the studio.
If it is not working??? Do the following steps.
Open the folder bin under the directory where you installed your Android Studio.
Find the file idea.properties and open it with Notepad++/UltraEdit/other_edit_tools.
Add disable.android.first.run=true as the final line and save the file.
Restart Android Studio.
Remove lib folder .local/share/Google/AndroidStudio4.1/marketplace
or execute command
rm -rf ~/.local/share/Google/AndroidStudio4.1/marketplace/lib
To recover from this state, you need to remove the "python" folder that you find here:
~./AndroidStudio1.2/config/plugins
(Found at https://code.google.com/p/android/issues/detail?id=164202, worked for me)
I have this problem in android studio in linux OS after install a plugin,i resolved this issue with deleted.AndroidStudio3.2 folder from Home Directory and other way you can go to this directory and delete the plugin that caused it .
Directory : /home/your system's name/.AndroidStudio3.2/config/plugins .
and for windows OS you must go to this Directory :
C:\Users\your system's name.AndroidStudioPreview3.2\config\plugins
Note : this directory is hidden and you must visible befor use it .
I did faced this issue too, where it says to do this in my windows 10:
please report to https://code.google.com/p/android/issues in a windows error message.
It happened when i added some plugins in Android studio in Windows.
It persisted in my machine until i opened my Android Studio as an administrator and then uninstalled the most recent Plugins from File > Settings > Plugins > Installed Plugins.
What went wrong may be I added many plugins and applied all of them at once. May be i should have added one plugin at a time. Like install a plugin > apply that plugin and restart my Android Studio IDE in order to see it's effects.
MacOS
My issue was with a plugin. I tried all sorts of ways of deleting Android folders using terminal. Nothing was working for me until I searched all instances of AndroidStudio in Finder and deleted each of them. After reinstalling everything worked great!
I solved it by removing an incompatile plugin located here: ~\AppData\Roaming\Google\AndroidStudio4.1\plugins.
I deleted the folder "marketplace"
Open the folder bin under the directory where you installed your Android Studio.
Find the file idea.properties and open it with Notepad++/UltraEdit/other_edit_tools.
Add disable.android.first.run=true as the final line and save the file.
Restart Android Studio.
It information helped for me
<<~ ~ ~ Quick Solution for Windows 10, Hope it will help ~ ~ ~>>
Download the latest Android Studio from the official website
Uninstall the existing Android Studio from your computer. NB: Remove Settings Preferences too while uninstalling.
Restart your computer
Install the newly downloaded Android Studio
Delete the old directories which will show when run the Android Studio the first time after installation of the new Android Studio.
NB: Do not remove your SDK files after uninstalling the Android Studio, if you want to save your time in installing the Android Studio.
I have solved this problem, depending on the system you use delete the following files:
Linux:
~/.local/share/Google/AndroidStudioPreview4.1
Windows:
C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudioPreview4.1
MacOS:
~/Library/Application Support/Google/AndroidStudioPreview4.1
Thanks #Jonilson Coelho dos Anjos
For Ubuntu users
go to home
press ctrl+h to show hidden folder .local
now go to .local folder
you will find share folder, go inside share folder
find Google folder and delete it
Open Android Studio
Enjoy !!
delete paid plugin in android studio plugin folder (C:\Users\your_computer_name\AppData\Roaming\Google\AndroidStudio4.1\plugins) and will work correctly. it works for me.
paid plugin should have to activate otherwise it will conflict.
1) Go to
'C:\Users\your-user-name\AppData\Roaming\Google\'
2) Delete folder
'AndroidStudio4.1'
3) Then restart Android studio.
I hope this works for you.
I came with a new solution. Instead of uninstalling Android Studio and removing all related folders and losing your programming state on Android studio, and beside all these wasting your time, you should try this solution first which worked for me:
In my case the problem was the Windows. As it has crashed recently, I figured out the problem could be it, so I decided to restore the windows to the most recent point before Android Studio crashed. But the system restore tool didn't allow me to restore my system at all, and it said I should repair missing or corrupted system files first.
I first used Microsoft System File Checker tool thread to fix the case, and guess what? after restarting the windows 10, all problems gone. No need for uninstalling the Android Studio or removing any plugins or even restoring the windows to an stable state.
Hope this work for you too.
error Android studio
Hi everyone, I have this problem recently and I found the solution by deleting plugins which was corrupted in:
~AppData\Roaming\Google\AndroidStudio2021.1\plugins
-EmmyLua
-Luanalysis
My solution is:
Delete folder C:\Users\[user]\AppData\Roaming\Google\AndroidStudio
Delete folder C:\Users\[user]\AppData\Local\Google\AndroidStudio
Run AndroidStudio.
Note:
Android Studio will be opened like fresh install.
100 % solved
1st go to
C:\Users\your-user-name\AppData\Roaming\Google\
2nd Delete folder
List item
'AndroidStudio4.1'
'AndroidStudio4.1-backup'
DELETE ALL ALL ANDROID STDIO VERSION AND BACKUP RELATED FOLDER
3rd Start again android studio

Error running android: Gradle project sync failed. Please fix your project and try again

Android Studio (1.2 RC0) keeps telling me
Error running android: Gradle project sync failed. Please fix your project and try again.
How can I find out what the problem is? Unfortunately the solutions from this SO thread did not help.
Goto File -> Invalidate caches / Restart
Shutdown Android Studio
Rename/remove .gradle folder in the user home directory
Restart Android Studio (It will download gradle metadata and data)
Gradle build succeed
Rebuild project. Done.
Solution is
Connect your computer to the internet
Click
Sync project with Gradle files
On toolbar
It will automatically sync the gradle.
Just ignore the error and try running the project anyway.
It will fail, but this time you will get a link in the error description. Clicking the link will trigger the automatic update/download of the outdated/missing component.
In my scenario, the project failed to launch two times, each time another API/SDK component being the culprit.
In my case I was just trying to launch a sample project I downloaded, having no clue what API level was being targeted or where to look for this information.
Download the latest Gradle package distribution for example (gradle-2.11-all.zip).
Extract this zip file in a folder as for example (D://Gradle)
Load your project in Android Studio and go to File->Settings->Gradle. Click on Use local Gradle distribution and point it to the folder where you unzipped the latest Gradle project.
Restart your project
It is a very common issue and the solution is very easy...
Just update the SDK in SDK manager(see full instructions below)
Open Android Studio and go to your SDK Manager(File>Settings>SDK
Manager)
Check for (-) icon in front of any package and click on it.
Click OK to start updating the SDK.
Thanks for asking that question :)
Delete "build" folder from project's root folder. Then do "invalidate cache and restart". This will restart your Android Studio and then build the app again, will solve the issue.
Go to
file->settings->build,execution,deployment->gradle.
(and set gradle home path from your directory)
If no error messages are shown: sometimes the command-line gradle shows them. Just go the the command-line, change to the app directory and type
gradle installDebug
or, if the details are missing
gradle --info installDebug
This can provide additional information how to debug the problem.
I had the same issue yesterday. After opening the "Android SDK Manager", updating all packages and restarting Android Studio, the project compiled again.
For me, the problem was the SDK Tools License had not been accepted. Clicking on the "Build" tab at the bottom uncovered the issue.
From there, I went into the AVD, uninstalled the tools and then reinstalled them, which prompted to accept the license.
All of these have not worked for me, what did is reading the very bottom of the log file located around here
C:\Users\madri\AppData\Local\Google\AndroidStudio2020.3\log\idea.log
and it said the following
So i fixed the problem by going into Tools > SDK Manager and installing the required SDK version
it looks different from one situation to another.
for me i did an installation and update a lot of things that the sdk manager said to then i had this problem.
all i did was:
from file -> Invalidate caches/Restart
(a dialog will pop-up) choose Invalidate and restart.
after the restart is done. everything was fixed but i needed to create a new emulator and delete the old one.
(android studio 1.3.1)
(one professional must edit this to be more understandable)
.
.
.
Here everything was fine, but your machines also needs restart because some system files are changed, to sync them we have to restart the system.
This could be due to Android Studio version conflict of v3 and v4 especially when you import a project in android stdio v4 which was previously built in v3.
Here are the few things you need to do:
remove the .gradle and .idea folders from the main Application folder.
import the project in the android studio.
after the sync finished, it will ask you to update the android studio supported version.
click update.
done.
I had the exact same error message
Error running android: Gradle project sync failed. Please fix your project and try again
Steps to solve:
Close Android Studio.
Remove the .gradle and .idea folders from the Application folder.
Open Android studio with your project.
After these steps android studio gradle will sync and download the required files to run the project (don't forget to disable offline mode).
I got this error going from Gradle 3.5.3 to 5.4.1 (Android Studio prompted and I clicked "Upgrade".)
Gradle proceeded to upgrade but yielded some errors such as:
ONFIGURE SUCCESSFUL in 1m 27s
ERROR: The Android Gradle plugin supports only Crashlytics Gradle plugin version 1.25.4 and higher.
The following dependencies do not satisfy the required version:
root project 'Android%20App' -> io.fabric.tools:gradle:1.25.1
Update plugins
Affected Modules: app
INFO: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: app
INFO: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Install Build Tools 28.0.3, update version in build file and sync project
Affected Modules: app
The thing that fixed it was opening Settings --> Appearance & Behavior --> System Settings --> Android SDK and I then selected some recent versions of Android SDK like 8, 9, and 10. (I had only had 5.1, 6.0, and Android N Preview installed.)
Once that's installed, I had to modify my build.gradle file for my Module: app
Removed buildToolsVersion '27.0.3'
Then I clicked the "Sync Project with Gradle Files" button on the toolbar. The Sync output window offered an option to "Update Plugins" and once I clicked through that everything seemed to work. For good measure I again clicked "Sync Project with Gradle Files" followed by Build --> Clean Project, and finally I was able to run my project again.
Resolution is simple. Open the "Android SDK Manager", update all packages and then restart your Android Studio. After that you project should compile without any issues.
It took me some time to resolve this.
Updated SDK Build-Tool [Didn't help]
Updated CMake [Didn't help]
Updated Android SDK Platform-Tools [Didn't help]
Updated Android SDK Tools [Didn't help]
Updated NDK [Problem solved]
There was a reason, I didn't want to update NDK. When all else failed, I updated NDK and that did the trick.
If your got timeout, Check Gradle Scripts -> gradle.properties in Android Studio, I found that I do have set a socket proxy in Android Studio settings, but in this gradle.properties file, my proxy became to http, so I just removed this http proxy setting lines, and finally works.
I got this problem on Android studio, there in either sync or build square were this link like blue text about this issue, press that button and it download something that fix this problem
I ran into the same issue, but then did the following, and my issue was resolved:
updated Gradle
installed the latest version of Android studio (mine was out of date)
And that solved my problem.
Note: It also helped me to click on the event log, because it has more detailed info about errors. https://developer.android.com/studio/releases/gradle-plugin#updating-plugin also has great info.
I've installed Android SDK Command-Line Tools from SDK Manager and after, juste Sync again and all is worked well.
it was hard to solve but i did it
look go to
C:\Users(user name)
delete .gradle file
its you didn't see it it may be in hidden files so if you use windows 7
right click then click on properties and click on hidden to be not checked
then the file will appear then delete it
i hope this works
It could be that you are using gradle in offline mode.
To uncheck it go to File > Settings > Gradle, uncheck the Offline Work checkbox, and click Apply
Make sure you have internet connection and sync the project again.
Its because the gradle is not synced because of many reasons.
Go to project folder and remove .gradle folder and start sync. It will work
Apparently, some platforms could be missing. This is how I solved the problem:
Do you see an error message that is shown at the bottom of your Android Studio window? It could be a smaller window on the bottom right also.., which looks like:
Now, Click on that blue link, do as the dialog boxes say (if any)...
That solved the problem. Hope it helps...
Download grade files from this url and extract all in a folder:
 https://gradle.org/releases
Open file -> Setting in windows OS or Preferences in mac OS and in "Build, Execution, Deployment"
Click on "Gradle"
Check “Use local cradle distribution” and give that extracted folder path.
Run gradle.bat for Windows OS and gradle file for mac OS in that folder.
Then check “Offline work”.
"your extracted folder path"/gradle-4.10.2/bin/.gradle (for version 4.1.2 you can set your version)
Press OK and enjoy it.
I had the exact same error message
Error running android: Gradle project sync failed. Please fix your project and try again
, but if none of the above fixes your error, then I would highly suggest for you to check your syntax inside the AndroidManifest.xml file.
That fixed if for me. I don't understand why the error-message is so misleading, since it had nothing to do with the build gradle directly.
Please also see this SO-answer here, which has lead many of us in the right direction.
It was yelling at me about a line in my xml file (which was perfectly valid and never had problems the entire time I've worked on the project). I deleted the line and even after running again and cleaning and rebuilding it kept yelling at me about the completely blank line. I restarted android studio and removed the .gradle folder and it finally worked. Hopefully someone in my shoes that had all of the other answers in this thread fail them will see this answer and save a few hours.
I had this problem (clicked a prompt to "sync with gradle" on my perfectly valid and working project and it killed everything) and I researched for hours trying to figure out how to fix this, including this thread among many others. I finally found my solution, so hopefully, it'll help somebody (and hopefully they fix this terrible system)
I encountered this in a unique situation: had refactored the word "time" to "distance" for one of my variables. And when I did the refactor, accidentally had it change the name of one of my gradle dependencies / implementations.
This is a rare cause of the error, but a possibility. So make sure all your dependencies are properly implemented in build.gradle
Delete .gradle folder(root directory) and build folder(project directory) and then invalidate caches/restart android studio, run your project again hopefully it will work. It might take some time for the background tasks. In some countries, you may need to turn on the VPN to download.

Resources