In Android Studio, I simply created a new project, and it says that:
Gradle project sync failed. Basic functionality will not work properly.
I have searched the web and tried everything, but nothing worked. I have v0.4.6 of Android Studio using Gradle 1.11.
The Error Message Is:
FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\Vinnie\AndroidStudioProjects\MyFirstAppProject\MyFirstApp\build.gradle' line: 9 * What went wrong: A problem occurred evaluating project ':MyFirstApp'. > Gradle version 1.10 is required. Current version is 1.11. If using the gradle wrapper, try editing the distributionUrl in C:\Users\Vinnie\AndroidStudioProjects\MyFirstAppProject\MyFirstApp\gradle\wrapper\gradle-wrapper.properties to gradle-1.10-all.zip * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 1 mins 7.011 secs
This question is related to
android
gradle
android-gradle-plugin
Remove the dependency "junit:junit:4.12" from app modules...!!! This solution is for gradle to sync all files.
I know this is an old thread but I ended up here with the same issue.
I solved it by comparing the dependencies classpath in the build.gradle script(Project) to the installed version.
The error message was pointing to the following folder
C:\Program Files\Android\android-studio3 preview\gradle\m2repository\com\android\tools\build\gradle
It turned out that the alpha2 version was installed but the classpath was still pointing to alpaha1. A simple change to the classpath ('com.android.tools.build:gradle:3.0.0-alpha2') was all that was needed.
This may not help everyone, but I do hope it help most people out.
Here is the solution I found: On the project tree "app", right click mouse button to get the context menu. Select "open module setting", on the tree "app" - "properties" tab, select the existing "build tools version" you have. The gradle will start to build.
Update gradle to the latest available version and implement libraries to the latest version available, also check if google play services is latest if used.
Each version of the Android Gradle Plugin now has a default version of the build tools. For the best performance, you should use the latest possible version of both Gradle and the plugin. You recive this warning in case if you use latest gradle plugin but not use latest SDK version. For example for Gradle plugin 3.2.0 (September 2018) you requires Gradle 4.6 or higher and SDK Build Tools 28.0.3 or higher.
Although you typically don't need to specify the build tools version, when using Android Gradle plugin 3.2.0 with renderscriptSupportModeEnabled set to true, you need to include the following in each module's build.gradle file: android.buildToolsVersion "28.0.3"
see more https://developer.android.com/studio/releases/gradle-plugin
I was behind firewall|proxy
.
In my case with Studio, ERROR: Gradle sync failed
& Cannot find symbol
.
I have used
repositories {
jcenter(); // Points to HTTPS://jcenter.bintray.com
}
Replace it with http and maven
repositories {
maven { url "http://jcenter.bintray.com" }
}
After applying this fix that was found here... https://code.google.com/p/android/issues/detail?id=208295
in file $SDK/ndk_bundle/source.properties replace "12.0.2753695 beta 1" to "12.0.2753695-beta1"
My project was built successfully and ran on device and emulators although 5 warnings still remains.
In my case NDK location was the issue.
go to File->Project Structure->SDK Location
and add NDK location
Update for 2018:
I have faced this issue recently and it was resolved by updating android studio & updating gradle when prompted then rebuilding the project
Use this line to your Build gradle app
repositories {
maven { url "http://jcenter.bintray.com" }}
I have encountered this problem And I solved it as follows: File->Sync Project with Gradle Files
good luck!
Using an outdated gradle version may also result to fail in synchronization. Download latest version from https://gradle.org/releases/ and download the "complete" latest version. Now replace it with the outdated version which is located C:\Program Files\Android\Android Studio\gradle. Go to settings(ctrl+alt+s) ,go to gradle and add the the new gradle directory in "use local gradle distribution" "Gradle home:C:\Program Files\Android\Android Studio\gradle\gradle4.4.1 ."
It Worked for me. Hope u understand.
I had a "Install build tools and sync" link in the lower right hand corner of my screen. I clicked on that and it fixed the issue.
This may be helpful for some.
My problem exactly is incomplete gradle-1.12-all
file download.
Below is screen shot of the Error
path/to/the/gradle
, in my case was in C:\Users\maneeOsman\.gradle\wrapper\dists\gradle-1.12-all\2apkk7d25miauqf1pdjp1bm0uo
The android studio starts downloading the necessary files for building and debugging. You can notice that from bottom-left indicator bar.
After this, it is working fine.
See the screen shot below
it was hard to solve but i did it look go to C:\Users\Vinnie\ 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
Source: Stackoverflow.com