I updated my Android Studio version to 3.2. Now I am facing following error for my project - com.novoda.gradle.release.AndroidLibrary$LibraryUsage.getDependencyConstraints()Ljava/util/Set;
Currently I am using gradle version 4.6.
Issue link https://github.com/novoda/bintray-release/issues/177 says to downgrade gradle version to 4.4 but minimum supported version for Android Studio 3.2 is 4.6.
How to resolve this error.
I solved the same error by changing the order of the plugins in your build.gradle file to :
//has to be BEFORE 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'com.android.library'
The solution is stated here - Take a look at : Issue III.
While keeping the distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip in my gradle-wrapper.properties file.
This solution worked for me:
As Bintray has fixed the issue in its new release i.e. 0.9 so adding that in build.gradle (project) files removes the error.
classpath 'com.novoda:bintray-release:0.9'
You will either need to downgrade back to AS 3.1.x or attempt the workarounds described on the Novoda issue you linked. Namely this plugin...
Related
After update to Android Studio Chimpmunk, I get the error message on Gradle sync:
Minimum supported Gradle version is 7.3.3. Current version is 7.2.'
In my gradle-wrapper.properties, I have got :
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
In my build.gradle, I have :
classpath 'com.android.tools.build:gradle:7.2.0'
I can't change it to:
classpath 'com.android.tools.build:gradle:7.3.3'
the latest version being found by Android Studio being 7.2.0
If I set:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2.0-bin.zip
I also get the same error (stangely).
I to fix this problem?
Thanks.
ANSWER TO MY QUESTION :
For now, I downgraded both to 7.0.4. Update will probably be possible soon.
I just had this problem and invalidating cache fixed the issue.
Image: Invalidate Cache and restart
file/sync project with Gradle Files
I got this problem too after accepting an auto-update prompt from Android Studio. Weirdly, my machine synced OK but other people's didn't.
The gradle version requirement seems to be imposed by the Android gradle plugin (AGP) versions. So also look in your build.gradle files for this kind of thing:
plugins {
id 'com.android.application' version '7.2.0'
id 'com.android.library' version '7.2.0'
}
I found that the AGP version had got bumped to 7.2.0 by the update, and that must have a requirement of Gradle 7.3.3 (confusing!). Anyway, when I edited the AGP back to 7.1.3, then I could downgrade the base gradle distributionUrl to 7.2 and it all worked again.
So this is a compatible set of versions:
build.gradle
plugins {
id 'com.android.application' version '7.1.3'
id 'com.android.library' version '7.1.3'
}
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
I have invalidated cache but it didnt help.
The problem of my setup was a two gradle-wrapper.properties files. Both of them should have same Gradle version but they had different.
yourproject/gradle/wrapper/gradle-wrapper.properties
and
gradle/wrapper/gradle-wrapper.properties
I set the same Gradle version for both of them to the
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
After that issue has gone.
I had the same problem for a project that i havent opened since december 2021, i fixed it by updating the gradle version to 7.4.2 in gradle.wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
and used 7.2.1 for the android gradle plugin version, i've also updated Android Studio to Chipmunk 2021.2.1 Patch 1.
I faced the same issue for Gradle version 7.3.0 (Stable). This is how I solved the issue:
I changed the distribution URL present inside gradle-wrapper.properties file:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
Then removed the following plugin present inside the build.gradle (app module)
apply plugin: 'com.google.gms.google-services'
Finally added this line to the main/AndroidManifest.xml to the activity section:
android:exported="true"
So I've just had the same problem with the incompatible required and current Gradle versions(followed the suggested AGP update). Going back to v7.0.4 has fixed the issue.
However, the answer given by #Khaled has also worked for me.
File > Invalidate Caches > Invalidate and Restart
You have to update to android studio dolphin first (was on chipmunk).
This update support gradle version : 3.2 to 7.3, link here https://developer.android.com/studio/releases/gradle-plugin
Then update gradle-wrapper.properties :
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
Then update your module dependencies as below
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
}
Optional : You will be asked to update gradle plugin to 7.3.1 so you can do it then your will have -> 'com.android.tools.build:gradle:7.3.1'
That's all you need, no invalidate cache and restart or something else.
Install new version Android Studio. It's working for me.
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"
DataBinding worked very well in my project, But after upgrade Android Studio 2.3 today . Run 'app' failed because following error :
Error:(15, 40) Error: package com.javan.myrecorder.databinding not exist.
import com.javan.myrecorder.databinding.FragmentEventsBinding;
:app:compileMockDebugJavaWithJavac FAILED
I just upgrade android studio and didn't change anything. all plugin is latest! Now my question is, why occurs this error and how could I solve it? any help is welcome!
English is not my mother tongue; please excuse any errors on my part.
EDIT1
Like android project googlesamples/android-architecture
git checkout todo-databinding
and then run ./gradlew assembleDebug to build, build failed because of following error:
complete log of build
EDIT2 I have fixed this problem by following Data Binding broke after upgrade to Gradle 2.3.
in build.gradle(app) add
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
..balabala
dependencies {
apt 'com.android.databinding:compiler:2.3.0'
}
some file in my project:
gradle-wrapper.properties
#Mon Mar 06 10:59:04 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
#petrnohejl #George Mount #Sa-Zad Prasla, Thanks!
android-apt and hence using apt has been deprecated since Android Studio 2.2.
Following the android-apt migration guide, instead add the following to your build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0' // use same gradle version!
annotationProcessor 'com.android.databinding:compiler:2.3.0'
}
If you are using Kolin, instead use:
apply plugin: 'kotlin-kapt'
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0' // use same gradle version!
kapt 'com.android.databinding:compiler:2.3.0'
}
The problem comes in a warning that is difficult to see amongst all of the errors:
Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior.
If you remove apt, data binding works.
I have also faced the same issue.
I was using ButterKnife and Dagger!!
Solved as follow
1) Remove from app level gradle file:
apply plugin: 'android-apt'
or apply plugin: 'com.neenbedankt.android-apt'
2) Remove from project level gradle file:
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
3) And simply change "apt to annotationProcessor" as following dependencies:
apt 'com.jakewharton:butterknife-compiler:8.5.1',
apt "com.google.dagger:dagger-compiler:2.5"
To:
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1',
annotationProcessor "com.google.dagger:dagger-compiler:2.5"
Data binding also broke for us following the update to Android Studio v2.3. The GoLang Bind plugin became unable to generate library .aar files
Our problem was resolved via a combination of GoMobile version "+eb90329 Mar 7 2017" update and GoBind plugin revert to version "0.2.6" (although the current version is "0.2.8")
Update GoMobile:
$ go get -u -x golang.org/x/mobile/cmd/gomobile
$ gomobile init -x
Revert GoBind plugin in build.gradle:
plugins {
id "org.golang.mobile.bind" version "0.2.6"
}
This solution is working on systems with go version 1.7.1 and 1.8 as well as Android Studio versions 2.1.2, 2.2.3, and 2.3.
Two things
Revert back your gradel-wrapper.properties distributionUrl to "https://services.gradle.org/distributions/gradle-2.14.1-all.zip"
Change the gradle version classpath to previous version "'com.android.tools.build:gradle:2.2.3'"
P.S. Instant run will stop working on ADT with older gradle version.
I too recently downloaded the latest version of android studio 2.3.3, because I was getting the same error in version 2.2.3 i.e Error:Failed to resolve: com.android.databinding:compiler:2.2.3 ,even in the latest version, I was getting the same error,I checked the project structure, In the File>Project Structure>Project , the Android Plugin version was still 2.2.3, I changed it to 2.3.3 and the build is successful and everything is working smoothly.
I solved this problem by changing my version of gradle to:
classpath 'com.android.tools.build:gradle:3.0.1'
Since I am using Android Studio 3.0.1
I need gradle ver 2.1.4 so I tried changing
classpath 'com.android.tools.build:gradle:2.1.3'
to
classpath 'com.android.tools.build:gradle:2.1.4'
but it didn't work. I also tried this method http://devdeeds.com/update-gradle-plugin-android-studio/ but that didn't work either.
This is the error that I am getting
Error:Could not find com.android.tools.build:gradle:2.1.4. Searched in
the following locations:
file:/C:/Users/Reimu/Downloads/android-studio-ide-145.3200535-windows/android-studio/gradle/m2repository/com/android/tools/build/gradle/2.1.4/gradle-2.1.4.pom
file:/C:/Users/Reimu/Downloads/android-studio-ide-145.3200535-windows/android-studio/gradle/m2repository/com/android/tools/build/gradle/2.1.4/gradle-2.1.4.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.4/gradle-2.1.4.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.4/gradle-2.1.4.jar
Required by:
:MyApp:unspecified
I can't run any projects without this being updated apparently.
Any help is appreciated
The classpath 'com.android.tools.build:gradle:2.1.3' is not for Gradle itself, but the Gradle Android build plugin that you apply with the apply plugin: 'com.android.application' or apply plugin: 'com.android.library' in your module's build.gradle file.
If you want to use another version of gradle in your project, reconfigure your gradle wrapper. Search for the /gradle/wrapper/gradle-wrapper.properties file in your project root, and apply the correct distributionUrl, for example:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
For the 2.14.1 version of gradle. This is probably what you need, because there is no such thing as Gradle v. 2.1.4. There is also no Android Gradle plugin v. 2.1.4.
And if it turns out, that you need the newest android grade build plugin, then change your class path to 'com.android.tools.build:gradle:2.2.0-beta2'. Version 2.1.3 is currently the newest stable version.
I tried to upload my code to bintry so that I can connect it to jcenter but the problem occurs when I add this line to my library build.gradle:
apply plugin: 'com.github.dcendents.android-maven'
gradle can not be build, what did I wrong?
I had the same issue. I was using gradle 2.4.
I don't know why but by downgrading gradle to 2.2.1 it get solved.
Just go to File then Project Settings and write in gradle field 2.2.1.