No incremental compile snapshot data available gradle error - android-studio

I am launching a Gradle task and it gives me an error like No incremental compile snapshot data available. I've searched online and I can't find a sufficient description for this. Do you know what exactly raises this error?

What gradle version are you using, found an old bug in v4.10: https://github.com/gradle/gradle/issues/6612

My project is using gradle 4.10 version. However, gradlew.bat clean build --refresh-dependencies solved this problem for me.

By Deleting the .gradle folder of Android Project.
Then do gradle sync and build apk.
It will solve this problem

Related

Minimum supported Gradle version is 6.7.1. Current version is 5.1.1 [duplicate]

I updated android studio from 3.3 to 3.4 version and after install and do ./gradlew lint I am getting the next error:
Deprecated Gradle features were used in this build, making it
incompatible with Gradle 6.0.
Then I use the next command to get more details:
./gradlwe build --warning-mode=all
And I get the next message:
Failed to apply plugin [id 'com.android.application']
Minimum supported Gradle version is 5.1.1. Current version is 4.4.1. If using the gradle wrapper, try editing the distributionUrl in .gradle/daemon/4.4.1/gradle/wrapper/gradle-wrapper.properties
to gradle-5.1.1-all.zip
And when I edited my gradle-wrapper.properties, I see that the changes were already done, I.E. the version of the distributionUrl already was gradle-5.1.1.-all.zip
Any idea that how can resolve this?
You could just edit YOUR_APPLICATION_FOLDER/gradle/wrapper/gradle-wrapper.properties and change the last line to:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
Android Studio will download necessary library.
This was my solution.
My_project
/gradle
/wrapper
/gradle-wrapper.properties
Modify this line with the Gradle 5.1.1
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
Finally, I was able to solve this dropping the folders of the oldest version in ~/.gradle/wrapper/dists and leave only the gradle-5.1.1-all
In my case, gradle failed to download the version I specified though I tried all previous solutions.
Apparently, I was opening my project by selecting "MyProject/App" directory. Gradle successfully updated when I opened the same project by selecting the "MyProject" folder.
Check your full project and find all "Gradle-wrapper.properties" files. If your project has multiple modules then there are chances of having multiple. and set -
distributionUrl=https://services.gradle.org/distributions/gradle-5.1.1-all.zip
Gradle sync
If not done then invalidate the cache and restart the project.
Still not working then go to your root directory on Linux and find .gradle folder. Delete it and restart the android studio.
If you use Ubuntu and all above answers didn't solve your problem try to upgrade gradle on your Ubuntu with this commands from this answer https://askubuntu.com/a/975018/714791
sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get update
sudo apt upgrade gradle
It will help I hope
I resolved by two below steps.
delete gradle folder
check your classpath 'com.android.tools.build:gradle:{$gradleVersion}
My gradleVersion is 3.5.3.
I solved this by changing the distributionUrl in gradle-wrapper.properties in gradle/wrapper, not gradle.properties
Maybe it's your gradle environment variable.
execute 'gradle -v'
Check that the gradle version of the project matches the gradle environment variable version
those who are still facing issue with Cordova/Ionic, this is due to CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL which is being checked at platforms/android/cordova/lib/builders/GradleBuilder.js
set CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL to desired distributional
for MacOs
export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL = https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
I think it's very important to mention which IDE you're using and what are the configurations.
What made me upset was, I had a setting in gradle-wrapper.properties file which was "ignored" to my mind.
I've found the settings in the IDEA application settings, there:
and then selecting:
and everything works as expected.
Deleting 'all other' locally cached versions can never be the right solution ;)
Good luck!
My app is using Cordova v9.0.0
distributionUrl is set at platforms\android\cordova\lib\builders\ProjectBuilder.js
You can set distributionUrl from the command line with
set CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="https://services.gradle.org/distributions/gradle-[version]-all.zip"
Replace [version] with your preference
it solved for me
get the flutter SDK directory
this is my flutter Sdk
C:\flutter\.pub-cache\hosted\pub.dartlang.org\connectivity_macos-0.1.0+2\android\gradle\wrapper
change gradle-wrapper.properties
Modify this line with the Gradle 5.1.1
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
I had the same error: Error "Minimum supported Gradle version is 6.1.1. Current version is 5.1.1" but when I opened the gradle.properties and I found this "distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip" which was correct but wasn't working. To solve this, I deleted the ".gradle" file in the explorer, reopened the app and found out the distributionUrl had change to 5.2.2-all.zip in gradle.properties; I then edited to 6.1.1-all.zip and sync and everything worked like a charm. I hope this can help someone else.
Try to download manually Gradle-5.1.1 from https://gradle.org/releases then go to file/project structure/project and put the new version in gradle version. (You can also use this link - jenv.io/candidate/gradle)
I was having the same problem after migrating from android.support library to androidx where junit library start with androidTestImplementation and not
testImplementation.
So i changed
testImplementation "junit:junit:$rootProject.junitVersion"
to
androidTestImplementation androidx.test.ext:junit:1.0.0-beta01
or
androidTestImplementation "junit:junit:$rootProject.junitVersion"
Remember to append android before testImplementation
also, try removing all older/unwanted versions of gradle using:
cd usr/local/Cellar/gradle/
Don't forget to run the gradle wrapper in your project: https://docs.gradle.org/6.4.1/userguide/gradle_wrapper.html#sec:adding_wrapper
Delete gradle folder from your project directory as well as from the app directory.
restart Adroid studio and resync gradle.
it will solve your problem. If not you might be opened the project yourproject/app. close Android studio and import your project after selecting yourproject. Then resync gradle. This will solve your problem.
For Windows 10:
Go to C:\Users\<user-name>\.gradle\wrapper\dists and delete everything there. Android studio will download the appropriate version afterwards.
If anyone is still searching for a solution after trying literally everything, here's what worked for me.
In the .gitlab-ci.yml file, my image: key was outdated and was writing in the script that Gradle was set to 5.1.1 even though everything in my Android Studio was 7.0.2. After talking to the guy who wrote the image script, I just had to increment the version of that.
https://forum.gitlab.com/t/set-specific-version-of-gradle-for-ci-build/41716/4
This error was solved by restarting Android Studio.

After Android Studio update. Could not parse POM, Could not resolve all files for configuration ':app:_internal_aapt2_binary'

Hello I've been looking to other similar questions about this problem but none has helped me so far, after I updated to android studio to the new version 3.6.2 I have this error when I try to run any project.
Run info:
Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Required by:
project :app
Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Could not parse POM https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/3.6.2-6040484/aapt2-3.6.2-6040484.pom
Content is not allowed in prolog.
Before the update the project was able to build now none of my projects build.
I tried invalidate cache and restart, I checked that I was not running in offline mode. still have the same failure. Any idea whay this could be and how I could fix it?
if you have problem with gradle
change your android stadio version to 3.6.2 or lower
file>project Strcture>
change to 3.6.2 and OK
I fixed the Error by going to my username and deleting .gradle, .AndroidStudio3.6 and .AndroidStudio3.5 folders. after I restarted android studio to download the folders again and resetting them. It worked.

Error:This project does not use the Gradle build system, even though it was build in gradle system before

My project was build initally with bradle build system in android studio after I switching branches in git I got the following error.
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
When i try exetuting gradle task I get error :
Error:Android Source Generator: [project-name] AndroidManifest.xml file not found , Even though I have the file in proper place.
I have been trying to fix this from several days. I have tried re-importing the project, clone the project again. Any help is gladly welcome.
Thanks,

Gradle complains: "TaskSelectionException: Task 'generateDebugTestSources' not found in project"

Updating Android Studio from 1.1.0 to 1.2 RC0 broke my (previously flawlessly running) project. The error message is:
TaskSelectionException: Task 'generateDebugTestSources' not found in project ':libraries:android-simple-facebook:Simple Facebook'. Some candidates are: 'generateDebugResources'.
What does that mean? And how can it be fixed?
Any advice is appreciated.
Thank you.
I got this error after I renamed the project.
Solution is: Press on the "Sync Project With Gradle Files" once.
After this the error will be gone.
I got the same error,too. It's seems like when I update gradle to 1.3, AS missing something. I tried run ./gradlew clean in project root directory, it will install all requires and finally build success.

Android studio preview 0.4.5: The project is using an unsupported version of the Android Gradle plug-in

I got the following error message when I was importing a project from github:
Failed to refresh Gradle project 'XXX'
The project is using an unsupported version of the Android Gradle plug-in.
Fix plug-in version and re-import project
This is not a duplicate of this because your get thee error message before
gradle/wrapper/gradle-wrapper.properties
is generated.
The problem appeared after updates. The updated Android Gradle plug-in did not support the outdated version of Gradle I had. But the error message is misleading, if you don't attempt different build options you won't see what the problem is.
After downloading a newer version of Gradle, Imported the project again, then:
Use local gradle distribution
Then Gradle home set to the folder where the new version of gradle was downloaded
that solved it
Edit: From Scott (below comments) : It's preferable to use the wrapper and to change the Gradle version in gradle-wrapper.properties instead of downloading and installing Gradle yourself. As for the Android-Gradle plugin, that's set in the dependencies.classpath block in your build file; see this
I get this gradle-errors in 4 Studio updates! My solution: I copy the Studio-folder, and if gralde throws an error, I copy the old version back. It's not a good way, but until google is not able to deliver an update without producing always the same errors (even if mentioned in many forums), I stay on 4.9 and wait for the first final release.

Resources