I've just updated in Android Studio the Gradle version from 7.2 to 7.4.2 and as soon as it tries to build the project it fails with an exception:
A problem occurred configuring project ':app'.
> The value for property 'buildConfigFields' cannot be changed any further.
Rolling back to 7.2 fixes the issues.
Any ideas?
SOLVED
I was using a deprecated gradle plugin.
Deprecated: com.google.secrets_gradle_plugin
New: com.google.android.libraries.mapsplatform.secrets-gradle-plugin
Here is the most recent solution update.
https://developers.google.com/maps/documentation/android-sdk/secrets-gradle-plugin
Related
I'm trying to upgrade to the latest version of React Native. When I run my Android app (npx react-native run-android) it gives this error:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.version-check'.
> Minimum supported Gradle version is 7.4. Current version is 7.3.1. If using the gradle wrapper, try editing the distributionUrl in /Users/justintoth/Dev/m365-mobile-app/android/gradle/wrapper/gradle-wrapper.properties to gradle-7.4-all.zip
Seems simple enough, that I need to upgrade Gradle from version 7.3.1 to version 7.4. However, when I make the following changes:
android/build.gradle (dependencies section):
classpath("com.android.tools.build:gradle:7.4")
android/gradle/wrapper/gradle-wrapper.properties:
distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip
Then it gives this error:
> Could not find com.android.tools.build:gradle:7.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.4/gradle-7.4.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/7.4/gradle-7.4.pom
- https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.4/gradle-7.4.pom
Required by:
project :
So what gives? It errors if I use version 7.3.1 and insists I use 7.4, and yet when I use 7.4 it says it can't find it. The distributionUrl that I specified in gradle-wrapper.properties is correct, so it's clearly ignoring it and just trying to look in google, jcenter and mavenCentral.
An error occurred after I downloaded version 6.8 and the latest version of Gradle.
A problem occurred evaluating project ':launcher'.
< Failed to apply plugin 'com.android.internal.version-check'.
<< Minimum supported Gradle version is 7.0.2. Current version is 6.8. If using the gradle wrapper, try editing the distributionUrl...
What do I have to do?
I'm attaching more details in the added pictures.
The error:
Minimum supported Gradle version is 7.0.2. Current version is 6.8.
Likely means:
Your "\gradle"-folder is missing from your project folder:
(Note: Not to be mistaken for the ".gradle"-folder which is a different folder)
Solution:
Get a copy of the "\gradle"-folder from another working project (or create a new project).
Or:
Your "\gradle\wrapper\gradle-wrapper.properties" has an incorrect value in the "distributionUrl=":
Solution:
Change the value in "\gradle\wrapper\gradle-wrapper.properties" to
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
I hade the same problem after moving my project to another computer:
Minimum supported Gradle version is 7.0.2. Current version is 6.8.
Please fix the project's Gradle settings.
Gradle Settings.
Clicking on the "Gradle Settings"-link opened the Gradle settings Window, but the Gradle JDK was already correctly set to version 11:
So my next step was to check the Project Structure:
And update the Gradle Version to 7.0.2:
But that led to this error instead:
¤ What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
» Failed to apply plugin 'com.android.internal.version-check'.
» Minimum supported Gradle version is 7.0.2. Current version is 6.8. If using the gradle wrapper, try editing the distributionUrl in D:\Files\Code-Project\gradle\wrapper\gradle-wrapper.properties to gradle-7.0.2-all.zip
Now the error points me towards a problem within the "\gradle\wrapper\gradle-wrapper.properties"-file.
Looking into that I found out the real problem - the "\gradle"-folder was completely missing.
(Note: The "\.gradle"-folder is not the same as the "\gradle"-folder)
Copying the "\gradle"-folder from another project solved my problems.
Now my "\gradle\wrapper\gradle-wrapper.properties"-file looks like this:
Next update the Gradle Version in Android Studio select invalidate cache and restart solve the issue.
Go to Menu File->Invalidate cache..-> Invalidate and Restart.
Go to gradle wrapper properties
In the distribution url line change gradle version from 6.5 to 7.0.2 or the current version when you see this
The error says that the gradle version in your system is less than your project's gradle verion. That's the reason why it is unable to compile your project.
System gradle version < Project's gradle version
So there are 2 solutions here,
Change the distribution URL in the gradle-wrapper.properties file in the android/gradle/wrapper directory to distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip.
Update your gradle plugin. If you use some environment variable, download the latest verion from Gradle | Manual Installation and replace it with your current one. Don't forget to update the path variable in system properties.
I use the productFlavors
returns error
Cannot add task ':app:reportSourceSetTransformTest' as a task with that name already exists.
at gradle 4.4 or earlier version doesn't have this problem.
When I updated it to gradle 4.5 yesterday, it returns error, clean project is the same problem. Why?
android studio version:3.2 canary 3
I can't find the reason, I can only lower the Gradle version and the plugin version first. Gradle decreased from 4.6 to 4.4, and plugin decreased from 3.2 to 3.1.4
I'm trying to build an Android project but the following error occurred
Error:(10, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Gradle version 2.8 is required. Current version is 2.4. If using the gradle wrapper, try editing the distributionUrl in C:\Users\...\gradle\wrapper\gradle-wrapper.properties to gradle-2.8-all.zip
It seem something's wrong with the Gradle version, however I checked the gradle-wrapper-property and it's already 2.10.
Also in File-Project Structure-Project, gradle-version is also 2.10
No idea how this happened, I've also restarted android-studio many times.
For those that still need help, an answer on another post did it for me link.
You need to change Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home path
Or set Use default gradle wrapper and edit Project\gradle\wrapper\gradle-wrapper.properties files field distributionUrl like this
distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
I don't think that changing Gradle tools to version 1.5.0 is necessary, but if you're using 2.0-snapshot or beta version of gradle, I recommend you to change it to 1.5.0.
This error:
Error:(10, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Gradle version 2.8 is required. Current version is 2.4. If using the gradle wrapper, try editing the distributionUrl in
C:\Users...\gradle\wrapper\gradle-wrapper.properties to
gradle-2.8-all.zip
only tells you that your project's Gradle system is a bit outdated and need to be updated to newer version.
Open your project Android Studio and in navigator on the left find file called gradle-wrapper.properties. It should have a content like this:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
Change the last line with distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
It should work.
Go To Android Preference and Just change Project level Settings to Use default gradle wrapper (recommended).
There is a bug in version checking in older android plugins. To fix this you can either go back to gradle 2.9 or use the newer plugin
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
But I see from your error message that it tries to run with gradle 2.4 so this is maybe another problem.
Updating the version of android studio from 1.4 to 1.5.1 fixed this problem for me.
After updating from com.android.tools.build:gradle:2.0.0-alpha3 to com.android.tools.build:gradle:2.0.0-alpha6 I got this error:
Error:Execution failed for task ':MyApp:transformClassesWithMultidexlistForDebug'.
> java.util.NoSuchElementException (no error message)
I have multiDexEnabled true, which worked so far (up to alpha3); if I remove it I get another error:
Error:A problem was found with the configuration of task ':MyApp:zipalignDebug'.
> File '/Users/myuser/dev/projects/my-app/MyApp/build/outputs/apk/MyApp-debug-unaligned.apk' specified for property 'inputFile' does not exist.
Any clue?
Note: after updating to alpha6 I also updated distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip in gradle-wrapper.properties and did a project clean + rebuild.
I'll add the answer, since it seems to work for some people.
I discovered that my Android Studio 2.0 Preview was outdated (I was in stable channel). I updated it to the latest version (canary channel). At the moment is the Preview 6.
I also had to disable "instant run" due to other problem I had after updating Android Studio.
Hope it helps!