Gradle error android studio 'AsmBackedClassGenerator' - android

I am using IntelIJ IDEA with android-studio plugins and Gradle.
I have checkout an old branch and intelIJ said that it required to sync.
That's what I did and an error appeared:
...project refresh failed:
Error:Cause: org/gradle/api/internal/AsmBackedClassGenerator
Does anyone knows about it ?
I can't see it reported on the web.
more informations here: https://discuss.gradle.org/t/android-studio-sync-failed-error-asmbackgenerator/11082
Thanks in advance!

I faced some sort of similar sync failure problem. I just found the gradle version used by my android studio, downloaded it and mapped gradle settings to the location of the downloaded zip.
You can download the gradle in the following link.
Gradle distributions
You can map by File > Settings > gradle.

Related

Gradle sync failed in Android studio 3.6.1

after upgrading my android studio to version 3.6.1 I cant sync Gradle with the android studio I try a lot of ways,
like change Gradle version and sync or download directly Gradle from gradle blog
but still, I see this error
Gradle sync failed: Could not find transform-api.jar (com.android.tools.build:transform-api:2.0.0-
deprecated-use-gradle-api).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/transform-api/2.0.0-deprecated-
use-
gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.jar
Consult IDE log for more details (Help | Show Log)
even I download transform-api from above link and put it in the folder of Gradle
and this is my screenshot
First clearly declare google maven repo like this
If it didn't work, Try these answers
Open project structure enter image description here
then, open Gradle version drop down and select latest gradle version
and click on Apply. it did work

Android Studio Bug Gradle sync failed: Could not find com.android.tools.build:gradle:3.1.3

Hello Everyone I've got a problem with starting a new project with android studio and it's about Could not find com.android.tools.build:gradle:3.1.3 and I have searched for the package but I didn't find anything.
You can put your version of android studio in gradle classpath! Or you can find the latest version of gradle in the gradle site and put it in the gradle.build file in the gradle scripts!
Make sure that your gradile isn't offline checkout this .
If your country blocked from Google connect the vpn and try.

Android Studio - Gradle Sync Failed - ToolingRegistryProvider

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

Gradle is failing on syncing my project in the new Android Studio 2.0

I have just upgraded (i.e., installed a full new version) my Android Studio from 1.5 to 2.0. The upgrade seemed to go smoothly, but I am having trouble with my project when I open it, when Gradle is syncing my project.
After Gradle sync runs for a couple of minutes I get this error:
Failed to sync Gradle project MyProject
Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle.
Error: Enable Gradle "offline mode' and sync project
Learn about configuring HTTP proxies in Gradle
So, I click on the link that says:
Enable Gradle "offline mode' and sync project
Then Gradle spins for a second or two, and I now have this message:
Failed to sync Gradle project MyProject
Error: No cached version of com.android.tools.build:gradle:1.3.0 available for offline mode.
Disable Gradle 'offline mode' and sync project
So, I click on this link:
Disable Gradle 'offline mode' and sync project
And I am back to my first error again.
The machine I am working on is 100% off line. It does not have, nor will it ever have any kind of network connection whatsoever. I figure I need to disable some kind of check that requires the internet, but I am not sure what. Is this fixable, or do I have to downgrade back to Android Studio 1.5?
UPDATE
I am also getting this error message:
Gradle sync failed: Unknown host 'services.gradle.org'. You may need to adjust the proxy settings in Gradle.
Ok, I fixed my issue so I wanted to post how I did it in case somebody else runs into this situation.
I was googling around and found a statement regarding working offline with Android Studio that read:
You can, however you won't be able to use any Gradle dependency. Gradle search into the repositories for dependencies using internet, so if you're completely unable to work online. Try not to include anything in the Gradle files, if you do, you'll have to sync it and it'll fail. Bascially just don't touch Gradle files and you'll be good to go.
So, I looked at my gradle files, specifically the build.gradle for the Project (not for the Module). Once there, I noticed a line:
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
So, I replaced 1.3.0 with 2.0.0 and the project built just fine.
I hope this helps somebody else in the future. Good luck.
I got same problem when I downloaded "BackboneExampleApp" source code from guithub Click Here For Code. I have done following process by watching settings of my old projects and found these errors. I resolved both errors, run my app and got errors to upgrade project and finally when I updated then no more problems exist. Just see pictures for help.
build.gradle (Project:BackboneExampleApp-master)-->
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
}
I also come with the same problem in my application. I have Done invalidate caches/restart then the problem is resolved.
I had the same problem as yours. Fortunately, I managed to solve it. You need to go to File >> Settings >> Build, Execution, Deployment >> Build Tools >> Gradle. You need to change the Gradle Home. Mine was "C:/Program Files/Android/Android Studio/gradle/gradle-2.08" and it said the path is invalid. So, just recheck your path in your file explorer and change it. I changed mine to "C:/Program Files/Android/Android Studio/gradle/gradle-2.10".
I had a similar problem. I was trying to build one of the media samples. I tried to use gradle 2.0.0 as you suggested but it didn't work. Got me on the right track though. gradle 2.1.0, along with deactivating offline mode got it to work.
For me it was a connection issue, that I have checked my connection is working in the same second I have enabled and disabled offline Gradle, then Android Studio download the needed files
NB: My Connection was disconnecting and reconnecting many times, so i figured out that this error was caused by the connection specially it was not the same time it takes when trying to sync my Gradle
For those have issues with error message: Learn to configure HTTP settings, below is the solution that worked for me. Am using Android studio 2.3.3:
Go to http://developer.android.com/studio/intro/studio-config.html
Step 1: Follow the instructions on: Set up Android studio proxy.
Step 2: Follow the instructions on : Android plugin for gradle HTTP proxy setting. You will see proxy settings under : # project wide gradle settings, copy the code there and paste it into the empty space in gradle properties file which is under the build gradle in Android studio. Make sure you are connected to internet while on this process. Wait until the the error disappears.
Step 3: you may see another message pop up stating: some folders may have been missing syn now. Just click on syn now.
I hope this help, thanks all.
I was fallen the same trouble, you mentioned. But I solved it myself. I connected my pc to the internet and rebulit the project using PROJECT>>REBUILT PROJECT.
Then some downloads could be seen below with the name of jcenter.......
THEN THE PROBLEM SOLVED...😃
Gradle build became successful..
I faced the same issue. Make sure that you have made an entry in path in environment variable for gradle
C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin
After disable offline mode and setting the path in environment variables, the issue was fixed and Gradle was build cleanly.
It seems there are multiple reasons for this issue. I fixed it by changing the "Gradle version" and "Android plugin version".
It might be helpful to someone. Go to File->Project Structure. Select Project and update your gradle and android plugin versions.
I also came with the same problem in my application..The application Gradle version is 2.3.3 .I just update the Gradle to 3.0.1 .and the problem is solved.
My problem was different from all answers; gradle distribution url was wrong..
It might be the problem that distributionUrl can be wrong in gradle-wrapper.properties file.

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.

Categories

Resources