Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve javax.annotation:javax.annotation-api:1.2.
i tried this and it worked..
you just need to reset dependencies in app.gradle file like old one as
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
to this...
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
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?
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.
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'
}
When I insert implementation of google play service ad to gradle, then My app got crashed.. and my dependencies looks like this:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
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'
implementation 'com.google.android.gms:play-services-ads:17.1.1'
}
I got those and imported ...
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
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'
implementation 'com.google.android.gms:play-services-ads:17.1.1'
implementation'com.android.support:animated-vector-drawable:27.1.1'
implementation'com.android.support:customtabs:27.1.1'
implementation'com.android.support:support-media-compat:27.1.1'
implementation'com.android.support:support-v4:27.1.1'
After implementing 'com.google.android.gms:play-services-ads:17.1.1', you must also insert the following into your AndroidManifest.xml.
For more information about App ID (a-app-pub-3940256099942544~3347511713) refer to https://developers.google.com/admob/android/quick-start.
<application
...
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
...
</application>