Gradle Issue Android Studio - android

I am having issues with gradle in my android application.
android {
compileSdkVersion 27
defaultConfig {
applicationId "za.co.gtsolutions.vivachoc"
minSdkVersion 15
targetSdkVersion 27
versionCode 2
versionName "1.5"
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.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.1'
implementation 'com.github.bumptech.glide:glide:4.6.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.stripe:stripe-android:6.1.2'
implementation 'com.google.code.gson:gson:2.8.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
implementation 'testfairy:testfairy-android-sdk:1.+#aar'
testImplementation "org.robolectric:robolectric:3.8"
implementation 'com.facebook.android:facebook-login:4.32.0'
android {
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
compile 'com.android.support:cardview-v7:27.1.1'
compile 'com.android.support.test.espresso:espresso-contrib:3.0.1'
}
I get the following error: all com.android.support libraries should use the same version and my application will not run because of this. I have changed the minimumSDK Version and targetVersion to apply to the project that i am working on.
I am totaly lost on what the issue could be ?

use 27.0.2 instead of 27.1.1 like below
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'

The answer after sometime is guided by the following answer: All com.android.support libraries must use the exact same version specification was the following:
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation "com.android.support:customtabs:27.1.1"
The application needs to use the customtabs library which was missing

Related

Failed to resolve: recyclerview

While adding dependency implementation 'com.android.support:recyclerview-v7:28.0.0' to my project, Android Studio throws exception ERROR: Failed to resolve: recyclerview. Then I tried adding dependency for recyclerview. Still getting same error.
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.itook.myapplication"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.background.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.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.android.support:design:28.0.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.10'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.florent37:bubbletab:1.0.2'
implementation 'com.android.support:design:28.0.0'
implementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.ss.bannerslider:bannerslider:1.8.0'
implementation 'com.github.hamsaadev:Persian-Date-Picker-Dialog:V1.2'
implementation 'com.anton46:stepsview:0.0.2'
implementation 'pub.devrel:easypermissions:2.0.1'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.zarinpal:purchase:0.0.8-beta'
implementation 'com.github.bumptech.glide:glide:3.7.0'
}
Try this
implementation 'androidx.recyclerview:recyclerview:1.1.0'
Your project migrated to android x
Use this:
implementation 'com.google.android.material:material:1.0.0'
Instead of
implementation 'com.android.support:design:28.0.0'
Then you don't have to implmenet different library of Design. It will add all library.

resource linking failed, error: resource android:attr/dialogCornerRadius not found

When I integrate the Stripe library it creates linking resources
problems due to the SDK version. While when I upgrade my SDK version
from v7:27.1.1 to v7:28.0.0 and change my compile SDK version to 28
the problem is resolved then it causes the problem in the Manifest file.
add this library for the SDK version but not solve the problem.
build.gradle file:
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.1'
}}
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.goldtech.linkbreed"
minSdkVersion 19
targetSdkVersion 27
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:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'de.hdodenhof:circleimageview:3.0.0'
// for slider images
implementation 'com.github.smarteist:autoimageslider:1.3.2-appcompat'
implementation 'com.stripe:stripe-android:11.2.0' // stripe payment
implementation 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
implementation 'com.github.shts:StoriesProgressView:3.0.0' // for stories
implementation 'com.allattentionhere:autoplayvideos:0.2.0' // for video in recyclerview
// indicator //
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'com.android.volley:volley:1.1.1'
////////////// exoplayer //////////////////////
implementation 'com.google.android.exoplayer:exoplayer:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-core:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-dash:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-hls:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:r2.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.1.1'
//implementation 'com.google.firebase:firebase-crash:11.8.0'
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'
This error occurs because of mismatched compileSdkVersion and library version.
Change the compileSdkVersion to 28.
android {
compileSdkVersion 28
...
}

How do i fix Authentication error android app

image
Hi, how do i fix Firebase authentication error - "failed to resolve: firebase-auth-15.0.0"
`apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.anton1111.azot2.antonio_chat"
minSdkVersion 17
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.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.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'
implementation 'com.google.firebase:firebase-auth:16.0.1'
}`
you have the same implementation twice at your dependencies
implementation 'com.google.firebase:firebase-auth:16.1.0'
and
implementation 'com.google.firebase:firebase-auth:16.0.1'
remove the last one and just let firebase-auth:16.1.0
The one you posted in your photo has two versions, and that is causing the error
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0' <--- 16.0.1 and 15.0.0
delete one version and just use the latest one
implementation 'com.google.firebase:firebase-auth:16.1.0'
The stable version for gradle on Firebase website is:
implementation 'com.google.firebase:firebase-auth:16.0.5'
You should give it a try to see if this works.
Latest stable version for gradle on FireBAse is:
implementation 'com.google.firebase:firebase-auth:16.0.5'
You should give it and for more details please see link

Cannot find GlideApp after adding the Room compiler

compile project failed with error "cannot find symbol class GlideApp" after added room components to the gradle config file. Project compile without error if comment out "annotation processor "android.arch.persistence.room:compiler:$room_version". Any ideas?
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.otpuskarche.onleave"
minSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
def room_version = "1.1.1"
def archLifecycleVersion = '1.1.1'
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:design:27.1.1'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.code.gson:gson:2.8.3'
implementation 'com.android.support:support-v4:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
// Room components
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
androidTestImplementation "android.arch.persistence.room:testing:$room_version"
// Lifecycle components
implementation "android.arch.lifecycle:extensions:$archLifecycleVersion"
annotationProcessor "android.arch.lifecycle:compiler:$archLifecycleVersion"
testImplementation 'junit:junit:4.12'
}
The problem was with room. The schema export directory was not set. Build log feint me as the error appeared on the bottom of the log.
reference to real issue - room-schema-export
Create a call like
#GlideModule
public final class GlideLoader extends AppGlideModule{
}
And Build Project.Then You will access glide by GlideApp.
You need to add the annotationProcessor dependency:
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'
You also need to add an AppGlideModule. See the generated API documentation for details.

Getting this update when trying to update proile pic firebaseAuth on Android

I keep getting the same error and the app stops working when I try and select an image to upload for user using google firease firebaseAuth on android. Here is the error I keep getting: Caused by:
java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq"
gradle build is as follows :
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.dissertation.studentscanner"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-annotations:26.1.0'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
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.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.0.3'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'me.dm7.barcodescanner:zxing:1.9'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.google.firebase:firebase-ml-vision:16.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
To solve this, please change the following lines of code:
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-firestore:17.0.3'
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
to
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.0.4'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
Don't also forget to add in your top level build.gradle file, the following Google Service plugin:
classpath 'com.google.gms:google-services:4.0.2'

Categories

Resources