I've tried so many things from invalidate cache/restart to clean re installing android studio multiple times now. nothing seems to work.
in my build.gradle (project level)
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
...
build.gradle (app level)
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
testImplementation "junit:junit:4.13.2"
androidTestImplementation "androidx.test.ext:junit:1.1.3"
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
}
I've enabled corretto-1.8 version of the gradle jdk in settings and the plugins for JUint is enabled.
I cannot seems to find any solution to this issue.
P.S. I have update the windows to windows 11 recently. The above issue was persisting before that.
Related
It pushes to upgrade Gradle plugin, but once I did it, the whole bunch of errors pop up.
It looks like my project build.gradle:
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
}
module build.gradle:
dependencies {
...
testImplementation 'junit:junit:4.+'
testImplementation 'org.mockito:mockito-core:2.4.0'
testImplementation 'org.powermock:powermock-core:1.7.0RC2'
testImplementation 'org.powermock:powermock-module-junit4:1.7.0RC2'
testImplementation 'org.powermock:powermock-api-mockito2:1.7.0RC2'
}
and gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
do not work anymore.
I tried to change them, but could not bring my powermock back.
What is the right combination of versions?
Hello iam trying to add this library :compile 'com.android.support:cardview-v7:28.0.0\n'
but getting error: Version 28 (intended for Android Pie and below) is the last version of the legacy support library, so we recommend that you migrate to AndroidX libraries when using Android Q and moving forward. The IDE can help with this: Refactor > Migrate to AndroidX...
any fix?
Bro its very simple just change
com.android.support:cardview-v7:(your targetsdkversion digits).0.0
instead of com.android.support:cardview-v7:28.0.0...it will work
Use the following dependencies instead of old ones in gradle scripts on Module level
dependencies {
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
So I tried to connect my firebase database to my android studio application.I get this error:
Please fix the version conflict either by updating the version of the
google-services plugin (information about the latest version is
available at
https://bintray.com/android/android-tools/com.google.gms.google-services/)
or updating the version of com.google.android.gms to 9.0.0.
I changed the version but it still does not work. As you can see I changed the version 16.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
I don't see the problem. I am stuck on this for hours.
Make sure You have gms classpath provided in your Project build.gradle, like this:
dependencies {
...
classpath 'com.google.gms:google-services:4.3.2'
}
I'm getting an error in my implementation 'com.android.support:appcompat-v7:28.0.0' at build.gradle file after implementing implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
I've already tried using
android.useAndroidX=true and
android.enableJetifier=true
Inside gradle.properties file but then I got another error in my MainActivity.kt file
Here's the error message :
Dependencies using groupId com.android.support and androidx.* can not be combined but found IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='cardview-v7', myVersion='28.0.0', myPacking='aar', myClassifier='null'} and IdeMavenCoordinates{myGroupId='androidx.lifecycle', myArtifactId='lifecycle-viewmodel', myVersion='2.0.0', myPacking='aar', myClassifier='null'} incompatible dependencies less... (Ctrl+F1)
Inspection info:There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion). Issue id: GradleCompatible
Is there a way to fix this error? thank you!
AndroidX and Compat shouldn't be used together,AndroidX library was introduced to remove Compat Libraries.
Turn off
android.useAndroidX=false and
android.enableJetifier=true
Post your complete app gradle file. There is a library in your dependency that is using a version lower than your targetSdkVersion.
I have updated my Android studio to 3.2.1 since then am getting error as below
Unable to resolve dependency for ':app#debug/compileClasspath': Could
not resolve com.android.support:appcompat-v7:28.0.0.
hence unable to build my application
I have unchecked offline too
my dependencies in gradle file
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
kindly suggest a solution for this
Regards.
Nagendra
I think you are using old version of build tool in project level build.gradle.
Try
classpath 'com.android.tools.build:gradle:3.2.1'
Update your Android Gradle plugin
1- Upade the classpath in top-level build.gradle to:
buildscript {
....
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
2- Update the Gradle version to 4.6 in the gradle-wrapper.properties file by changing the distributionUrl to:
...
distributionUrl = https\://services.gradle.org/distributions/gradle-4.6-all.zip
...
3- Go to ReBuild Project
classpath 'com.android.tools.build:gradle:3.2.1'
add this to the dependencies of buildscript. then Sync the project.
Thanks for the response,
Isuue was with proxy blocking the downloads,i have commented the proxy in gradle.properties then its started working, i was trying in the office network.
Regards.
Nagendra