When I hover over my 'com.android.support:appcompat-v7:28.0.0' in my build.gradle , it says that the support libaries must use the exact same version specifications. I got this error out of no where where after pulling in some files from my repo on github. I first referred to All com.android.support libraries must use the exact same version specification where many of the solutions were posted but after trying many of them, I could not still resolve my issue. I will list the steps below that I took to try to resolve the issue. Any help would be great on this. I will also post my build.gradle below.
steps taken to resolve issue
Sync project with Gradle File
Invalidate caches and Restart
Created a new project and basically copied everything from the one with issues into it
I also added the following code into my build.gradle and it did not work either.
configurations.all {
resolutionStrategy.eachDependency {
DependencyResolveDetails details ->
def requested = details.requested
if (requested.group ==
'com.android.support') {
if
(!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0'
}
}
}
}
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "losdos.help4hire"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0 '
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-auth:12.0.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'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-firestore:17.1.2'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.firebase:firebase-client-android:2.5.2+'
implementation 'com.google.firebase:firebase-auth:16.0.5'
}
apply plugin: 'com.google.gms.google-services'
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0 '
}
}
}
}
Related
Hi i am trying to use some external libraries, the things is thats their are aparently detected in compile time
Because i can go to the reference
But when i try to run it i get the following error
What is strange to me is that the file that contains the method does not appear in my external files
When i search for it in the files it supposed to appear here
as rememberLottieComposition.kt
but instead only appear RememberLottieCompositionKT.class
BTW, when i look in my files the file that contains the missing method exist
So no idea how to solve it, i have tried a lot but no results.
Any idea of what may it be will really help!
Thank you in advance
This is my build gradle:App
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdkVersion 30
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.perri"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
//de 1.5.1
}
}
//compose_version = '1.0.0-beta01'
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0' // appcompat library
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "com.airbnb.android:lottie:4.0.0"
implementation "com.airbnb.android:lottie-compose:4.0.0"
implementation "androidx.compose.runtime:runtime:1.0.0-beta01"
implementation 'androidx.recyclerview:recyclerview:1.0.0'
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:25.3.1'
//swipe
implementation 'it.xabaras.android:recyclerview-swipedecorator:1.2.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.compose:compose-runtime:0.1.0-dev10'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
}
And this is the other build Gradle
i'm developing an Android Studio App and trying to create a user register activity. I already added firebase into the project but when i try to add the firebase database dependencies, the app crashes instantly and not a single error is reported. However, when i remove the 3 implements from the build gradle, it runs correctly. Here i leave both build gradle codes. Thanks.
Build gradle project:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.4'
classpath 'com.google.gms:google-services:4.3.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build gradle app (this works properly):
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.jota02"
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//new implements
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.android.material:material:1.4.0-beta01'
implementation platform('com.google.firebase:firebase-bom:28.0.1')
}
Build gradle app (this crashes):
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.jota02"
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//new implements
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.android.material:material:1.4.0-beta01'
implementation platform('com.google.firebase:firebase-bom:28.0.1')
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'com.google.firebase:firebase-core:19.0.0'
implementation 'com.google.firebase:firebase-database:20.0.0'
}
SOLVED
The problem just was that i was running an old Android Studio version. I updated Android Studio and checked the gradle versions and now it's all working properly, thanks.
When you use firebase-bom dependency, you no need to mention version for firebase-database and other firebase library.
firebase-bom will choose right version for you or if you want particular version of firebase remove firebase-bom.so add dependency like below
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:28.0.1')
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-database'
I am using JSoup to parse my HTML response in my Java application but when I add the implementation I get the following:
Program type already present: org.jsoup.Connection$KeyVal
Message{kind=ERROR, text=Program type already present:
org.jsoup.Connection$KeyVal, sources=[Unknown source file], tool
name=Optional.of(D8)}
I am wondering has anyone experienced this before? I will add my full build.gradle below, I am running the most current SDK.
apply plugin: 'com.android.application'
android { compileSdkVersion 28 defaultConfig {
applicationId "uareloadedapp"
minSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} } productFlavors { } }
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation (name: 'wikitudesdk', ext:'aar') implementation 'com.google.ar:core:1.1.0' implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'org.altbeacon:android-beacon-library:2.15.2' 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.android.support:recyclerview-v7:28.0.0' implementation 'com.squareup.picasso:picasso:2.5.2' implementation "com.android.support:support-core-utils:28.0.0" implementation 'com.android.support:support-v4:28.0.0' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.+' implementation 'org.jsoup:jsoup:1.11.3'
} repositories { flatDir{
dirs 'libs' } }
Check if there is anything that you have added as a dependency and is also in the libs folder. That was my problem. deleting the file from the lib folder fixed it
I am getting this error, Failed to resolve: com.android.support:appcompat-v7.28.0.0 I have been looking on here and tried changing it to other variations of that line but so far no luck, why do I keep getting this error?
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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'
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.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'
}
apply plugin: 'com.google.gms.google-services'
The issue is with the appcompat-v7 dependency that you have added to the build.gradle.
Change implementation 'com.android.support:appcompat-v7.28.0.0' to implementation 'com.android.support:appcompat-v7:28.0.0'
Notice the : between appcompat-v7 and 28.0.0 that separates the artifact name and the version.
If we don't consider the typo in :
implementation 'com.android.support:appcompat-v7.28.0.0'
Change it to:
implementation 'com.android.support:appcompat-v7:28.0.0'
Then, you probably should use the latest version for the Firebase dependencies to avoid those Please fix the version errors:
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
Then rebuild the project. Also, remember to use latest gradle to avoid couldn't found such dependency or etc.
Inside build.gradle of the project (inside your project root directory):
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// replace it with the 3.2.0 version
...
classpath 'com.google.gms:google-services:4.1.0' // update this too
}
I have an existing application that uses SQLiteOpenHelper for communicating between the database and app but I decided to migrate to Room. I try every way to add Room component but all of them return to me the same error I make a new project and implement that Room library and worked! but in this project that has SQLiteOpenHelper I gave error .when I add Room Library Code ,I receive this error:
Failed to resolve: support-core-utils
and my build.gradle(module) that I add Room components:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.yasin.taksmssender"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// used by Room, to test migrations
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation":
"$projectDir/schemas".toString()]
}
}
sourceSets {
androidTest.assets.srcDirs +=
files("$projectDir/schemas".toString())
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.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'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
implementation 'com.github.pchmn:MaterialChipsInput:1.0.8'
implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'
implementation 'pub.devrel:easypermissions:1.1.3'
// Room components
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
androidTestImplementation "android.arch.persistence.room:testing:$rootProject.roomVersion"
}
and build.gradle(project):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
ext {
roomVersion = '1.1.1'
archLifecycleVersion = '1.1.1'
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Reason probably is that Room does not yet support support-core-utils 27.1.1, but 26.1.0.
https://mvnrepository.com/artifact/android.arch.persistence.room/runtime/1.1.1
solved this issue by changing
implementation ('android.arch.persistence.room:runtime:$rootProject.roomVersion',{
exclude group: 'com.android.support', module: 'support-core-utils'
})