Android Studio - Gradle Sync Failed - ToolingRegistryProvider - android

Hi looking for some help as I am not having much luck trying to develop in AndroidStudio. A couple of months ago I had android studio running and I updated it. Ever since I have been getting the follow error when ever I build any project.
Gradle sync failed: Cause: com.android.build.gradle.internal.ToolingRegistryProvider.
When I clean the project I see the following message.
Error:(1, 1) A problem occurred evaluating project ':app'.
> java.lang.NoClassDefFoundError: com/android/build/gradle/internal/ToolingRegistryProvider
I have tried the following to resolve the issue.
Uninstall and try again.
Unistall and manually remove left behind files.
Download latest gradle version and manually use those files when building.
If anyone could point me in hte right direct I would be very grateful is this is driving me up the wall.
Thanks.

According to this SO post you have to remove Gradle module cache like so:
rm -r ~/.gradle/caches/modules-2

I followed the instructions here while uninstalling and reinstalling Android studio and my problem was resolved.
How to completely uninstall Android Studio from windows(v10)?
Thanks

Related

Cordova build error: "Could not resolve all dependencies for configuration ':_debugApkCopy' > Could not find com.android.support:appcompat-v7:27.0.2."

It's been now two days I'm fighting with this issue.
I'm trying to build a cordova project that built marvelously like 1 month ago.
In between these time periods I had to change my PC so I installed again Java, Android Studio and Cordova, setting it up as usual.
I installed Google Repository (v58) as well as Android Support Repository (v47.0.0) in the SDKManager.
They appears to be the latest since I tried to uninstall and reinstall them twice.
I didn't change my project's configuration since I took a backup of it when it was working to start again.
When I run cordova build android, I got this error:
A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugApkCopy'.
Could not find com.android.support:appcompat-v7:27.0.2.
Searched in the following locations:
file:/C:/Users/Pierrick/AppData/Local/Android1/extras/android/m2repository/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom
file:/C:/Users/Pierrick/AppData/Local/Android1/extras/android/m2repository/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.jar
file:/C:/Users/Pierrick/Desktop/hAz4rd0uS-uphair-1af95815ef72/hAz4rd0uS-uphair-1af95815ef72/platforms/android/sdk-manager/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.jar
These files are needed by plugins cordova-plugin-mapbox (v1.2.3) and cordova-plugin-facebook4 (v1.9.1). Obviously, I checked the "extras" folder in my Android SDK directory, and the last version of Android support I got is 26.0.0-alpha1.
How can I manage to download the requested files in the good location ?
Is it supposed to be done automatically ?
I really don't see what I am missing here, some help would really be appreciated.
I tried to:
-Reinstall cordova-android by cordova platform rm android and cordova platform add android#6.2.3;
-Delete gradle's android support's cache and metadatas as stated here;
-Reinstall Google repository and Android Support repository twice from Android Studio SDK Manager as stated here.
This is drivin' me nuts.
I just cam accross my problem and since I didn't see doublons of this thread I'm posting the answer here.
As stated in this thread the issue is caused by the facebook sdk. If you run in cordova CLI you simply have to modify the platforms/android/project.properties file.
Change this line:
cordova.system.library.1=com.facebook.android:facebook-android-sdk:4.+
into this line:
cordova.system.library.1=com.facebook.android:facebook-android-sdk:4.26.0
As stated in the relative thread, this is a hack.

How to resolve Android Studio cannot find JAR 'core-3.1.1.jar' required by module 'gradle-jetty?

I opened up Android Studio today and for the first time I saw this error:
Error:Cannot find JAR 'core-3.1.1.jar' required by module 'gradle-jetty' using classpath or distribution directory '/Applications/Android Studio.app/Contents/gradle/gradle-2.14.1'
I have tried, restarted both my Mac and Android Studio but yet I still get this error. Can anyone help me?
I had the same problem, follow the answered detailed here to uninstall, and then just re-install. Before importing any existing projects just create a dummy project to ensure that everything finishes installing correctly.
Then simply just tell your antivirus that the project folder for android studio is excluded from the virus searches.
It turns out my antivirus had removed the file.
An uninstall and fresh install of Android Studio was able to solve my problem.
I have the same problem. Yeah, my Antivirus deleted the file too but it's seem uninstall and re-install Android Studio didn't work for me.
After re-install Android Studio, I can work normal with 1 project but when i try to open other project even create a new one, the 'core-3.1.1 jar' error show up again.
Just remove ./gradle folder compeletely.
Let Android Studio install Gradle from new or do it yourself.

android studio gradle sync error

After trying a preview version that gave me odd errors, i just did a fresh install of Android Studio 1.1.0 on Ubuntu Linux.
I also removed the preferences directory to start from scratch.
Now even with new projects gradle sync fails with this error and i cannot find the cause or other informations that can give me hints about the cause:
Error:Cause: org.jetbrains.plugins.gradle.tooling.ModelBuilderService: Provider org.jetbrains.plugins.gradle.tooling.builder.ExternalProjectBuilderImpl not found
Does anybody knows how to fix this?
Solved by deleting the $HOME/.gradle folder.
I guess executing the preview version messed up something there.
I had to delete the .AndroidStudioPreview, .gradle/ and the .android. Basically it's like to uninstall android studio, but it worked for me.

Android Studio - Failed to complete Gradle execution - getPid()

I just installed Android Studio, I installed the recommended packages from the SDK Manager, now I am trying to build a sample app. I got this error message:
Failed to complete Gradle execution:
Cause:
net.rubygrapefruit.platform.internal.jni.PosixProcessFunctions.getPid()
Any ideas how to solve this?
I got same issue, I restarted IDE. It started working fine after that.
Personally, I have updated the version of the Gradle Wrapper to the latest.
Open the file gradle-wrapper.properties.
Change the url of distributionUrl.
Example:
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip
Refresh the Gragle project and you should be good to go.

Android Studio update broke Gradle

I just updated my Android Studio 135.14 etc to 135.15.
First, I get an SDK not found error, since now the SDK cannot be in the Android Studio folder any more due to checksum problems. I fixed this as instructed, but now when I try to run my app I get the following message.
Failed to complete Gradle execution.
Cause: tried to access method
com.google.common.base.Stopwatch.()V from class
com.android.tools.idea.gradle.invoker.GradleTasksExecutor$3
I've already tried a clean and to delete .gradle from home. I don't see anything in build.gradle that has anything remotely to do with this and I am unsure on how to proceed.
I am not familiar with gradle at all since it just worked for months until the update.

Categories

Resources