I' using Gradle 2.9 in my Android Studio Project.
And today I try to update Gradle to 2.10, but got an error :
I follow the tip and change it to 2.2, but it doesn't work, 2.10 neither.
I use local gradle distribution not the wrapper, so I think this tip looks useless.
It has been marked as bug, which will be fixed in next Android Studio version (1.5.x).
Until then, temporary fix is adding following line in top-level build.gradle:
buildscript {
System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
...
}
Related
I have just updated to Android Studio 4.0 and trying to build my project. I keep on getting the below error
Unsupported method: AndroidArtifact.getBuildConfigFields().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
I am already using the latest version of Gradle and Gradle Plugin
Gradle version:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-milestone-1-all.zip
Gradle plugin tools version:
classpath 'com.android.tools.build:gradle:4.1.0-alpha10'
Any solution or fix for this problem would be helpful. Thanks in advance.
Use Android studio 4.1 preview
or
classpath 'com.android.tools.build:gradle:4.0.0'
This is usually due to a mismatch between your Android Studio versions and the Android Gradle plugin.
You can find the version of Android Studio on the project selection window when you first open it (or in "Android Studio > About Android Studio" on Mac, and similar location on other platforms). For example, you might be using Android Studio 4.0.1.
You can find the Android Gradle plugin version for your project in the top-level build.gradle file.
You should find something like the following:
buildscript {
[...]
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
[...]
}
[...]
}
You need to make sure that the two version numbers match (in this case they do).
When I sync my project in Android Studio, I got this error
ERROR: Cause: https://downloads.gradle-dn.com/distributions/gradle-3.4.2-all.zip
I think you have added wrong dependency package.
So Go to gradle > wrapper > gradle-wrapper.properties and checkout your "distributionUrl" has the correct value or not.
You have added a wrong package gradle-3.4.2-all.zip. try changing it to gradle-4.10.2-all.zip
I hope this helps.
Don't confuse gradle with the Android Gradle plugin.
classpath 'com.android.tools.build:gradle:3.4.2'
It is the Android Gradle plugin.
Check the release notes for other versions.
The gradle version is defined in gradle/wrapper/gradle-wrapper.properties.
Use:
distributionUrl = https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
I added
apply plugin: 'com.google.firebase.firebase-perf'
and when I ran build script I got
/transforms/FirebasePerformancePlugin/dev/debug/174/module-info.class:
D8: Unsupported source file type
What kind of problem it could be?
I updated all plugins, play services, and Android Studio, but with no luck
I Solve This issue by updating gradle version
classpath 'com.android.tools.build:gradle:3.5.3'
Update: Android Gradle Plugin 3.5.0 fixes this. See this issue and this one issue, both fixed.
(Unfortunately, in my project, this other issue still remains even in 3.5.3.)
I started getting the same error after updating a (company internal) library dependency, but then I kept getting it even after reverting that update. Very strange!
> Task :app:transformClassesAndResourcesWithR8ForBetaRelease FAILED
R8 is the new Android code shrinker. If you experience any issues, please file a bug at
https://issuetracker.google.com, using 'Shrinker (R8)' as component name. You can
disable R8 by updating gradle.properties with 'android.enableR8=false'.
.../transforms/FirebasePerformancePlugin/beta/release/66/module-info.class:
D8: Unsupported source file type
The only thing I found that helped was to do what the Gradle build output says and temporarily switch back to ProGuard, with:
android.enableR8=false
in gradle.properties.
This issue was fixed somewhere between Android Studio 3.5 Beta 2 and Android Studio 3.6 Canary 5, there were a bunch of similar issues with module-info.class.
In my case to fix issue I had not only update Android Studio, but also update gradle plugin.
Steps is:
Install new version alongside your stable version (You also can configure current version to use updates from canary chanel)
More info here
Download link (I downloaded 3.6 Canary 5)
After you installed new Android Studio update grade plugin:
in
gradle/wrapper/gradle-wrapper.properties
chande distributionUrl to
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
Don't forget Build->Clean Project
Turn off Firebase-performance plugin.
Android Studio 3.6 Canary 1 has this issue too.
I didn't find another way to release build my project.
i solve this problem with 3 steps:
1.update the "distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip"
2.update the "classpath "com.android.tools.build:gradle:3.6.3"
3.update the Studio 3.6.3
in other way(i don't like it)
//apply plugin: 'com.google.firebase.firebase-perf'
...
//classpath "com.google.firebase:perf-plugin:1.3.1"
I just upgrade Android studio to the last version (3.2.1) and an issue occurred while charging my project. The Kotlin Gradle plugin seems to be incompatible with the current Android Gradle plugin version, or something like that.
Here's the message displayed:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.2.51 and higher. Project 'Projetpelican' is using version 1.2.41.
I can't find any satisfying answer on the web so please enlight me with your knowledge.
PS. A similar topic had already been created but it does not fully answer the question...
in your build gradle
change 1.2.41 to following
buildscript {
ext {
kotlin_version = '1.3.10'
I hope this help you
Update your Kotlin version.
Under your project-level build.gradle (the one outside of the app folder), find the ext.kotlin_version variable and set it to '1.3.11'.
When maintaining an Android project, you need to keep an eye out for yellow-highlighted dependencies. Android Studio doesn't update them for you.
The latest version of gradle is 3.1 enter link description here
but Android Studio is only using 2.2?
enter link description here
This seems likes a huge discrepancy. My configuration:
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2'
classpath 'de.felixschulze.gradle:gradle-hockeyapp-plugin:3.2'
classpath 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
}
}
allprojects {
repositories {
jcenter()
}
}
When I try to find gradle 3.1, I get an error that it cannot find it. Same now with 2.2 > Could not find com.android.tools.build:gradle:2.2.
But gradle -v shows
gradle -v
------------------------------------------------------------
Gradle 2.2
how do I resolve this?
You are confusing Gradle with the Android gradle plugin, which generally matches the version of Android Studio. The latest version (at time of writing) is 2.2.2. It is generally set in your project's base build.gradle as you have shown above.
The Gradle wrapper is what you're looking for. You can change the wrapper's settings in your project's gradle/wrapper/gradle-wrapper.properties file.
Change
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip
Again, this is separate from the Android gradle plugin, which simply marries Gradle with Android Studio.
Find all distributions here
Here is the Gradle Version Compatibility for Android Studio
Gradle
refer to link
A problem occurred research project ': sample'.
Failed to apply plugin [id 'com.android.application']
Minimum supported Gradle version is 3.3. Current version is 3.2.1.
The current gradle configuration is also changed to 3.3. The project is running without problems, but can not use the command line (gradle and ./gradlew).
Refer to the online program:
1. Modify gradle-wrapper.properties, and Invalidate Caches / Restart ..., or do not work.
Later in the gradle forum to find a program: Thank you Henry
As new release with the fix not available yet, the former walk-around works fine.
Buildscript {
System.properties ['com.android.build.gradle.overrideVersionCheck'] = 'true'
...
}
. So mark what.
Correction statement : I later found that I installed the sdkman tool,
the tool installed 3.2.1 version, and this should be related (⊙ o ⊙)!
. At the beginning of the show gradle version, will show 3.2.1
version (I am still very depressed, change or show 3.2.1), I have
changed to the environment variable 3.3. I set the gradle environment
variable first, the following is set sdkman environment variable (this
order may also affect). So the final reason is still installed 3.2.1
version.