Unable to resolve dependency for retrofit2 - android

I try to import a retrofit library to my gradle file but unfortunately, I am facing too many errors.
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.squareup.retrofit2:retrofit:2.4.0.
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.squareup.retrofit2:retrofit:2.4.0.
Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve com.squareup.retrofit2:retrofit:2.4.0.
Unable to resolve dependency for ':app#release/compileClasspath': Could not resolve com.squareup.retrofit2:retrofit:2.4.0.
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve com.squareup.retrofit2:retrofit:2.4.0.
EDIT
This is my app build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.practice"
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
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'
implementation 'com.android.support:design:27.1.1'
implementation 'com.dinuscxj:recyclerrefreshlayout:2.0.5'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.firebaseui:firebase-ui-database:4.1.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.jakewharton:butterknife:8.8.1'
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.squareup.picasso:picasso:2.71828'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.vanniktech:emoji-one:0.5.1'
implementation 'net.danlew:android.joda:2.9.9.3'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
}
apply plugin: 'com.google.gms.google-services'
This is my project build.gradle
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
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I added the latest version of the retrofit2 but still get these errors. I have search for possible solutions but I can't find anything. Can someone help me with this problem?

Can you add this plugins are your app build.gradle file
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
And Can u change project build.gradle file like below code in allprojects
allprojects {
repositories {
google()
maven { url "https://jitpack.io" }
jcenter()
} }

Try this
implementation('com.squareup.retrofit2:retrofit:2.1.0') {
// exclude Retrofit’s OkHttp dependency module and define your own module import
exclude module: 'okhttp'
}
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
and project build.gradle
allprojects {
repositories {
jcenter()
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}

Add your build Gradle file
'com.squareup.retrofit2:retrofit:2.4.0'

Try adding this to the module (i.e. app) level gradle:
repositories {
maven {
mavenCentral()
}
}
Also you can try:
Go to File/Invalidate Cache-Restart

I have found a solution. I forgot to uncheck the offline work in Settings -> Build, Execution, Deployment -> Gradle -> Offline Work

Related

Unable to resolve dependency for ':app#debug/compileClasspath':Could not resolve project :PGSDKVR4.AggrePay-android

This is my gradle file :
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 26
defaultConfig {
applicationId "apps.com.athulyacustomer"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation project(":PGSDKVR4")
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
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.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
implementation 'com.github.nipun-birla:BoxLoaderView:0.0.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
}
repositories {
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
}
Getting the below mentioned error after syncing the gradle with the project folder.
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve project :PGSDKVR4.
ERROR: Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve project :PGSDKVR4.
Have added the plugin according to the documentation and sample app present on the below mentioned links.
https://github.com/paymentgatewayintegration/sampleapp
Please do let me know how can i can find a solution to this error.
Awaiting for your replies.
update dependencies in your projects build.gradle file
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:3.2.1'
}

Android Studio Gradle - Unable to solve dependency

I'm getting the following errors when trying to add implementation 'com.android.support:cardview-v7:27.1.1' to my build.gradle (app):
Unable to resolve dependency for ':app#debug/compileClasspath': Could not
resolve com.android.support:cardview-v7:27.1.1.
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath':
Could not resolve com.android.support:cardview-v7:27.1.1.
Unable to resolve dependency for ':app#debugUnitTest/compileClasspath':
Could not resolve com.android.support:cardview-v7:27.1.1.
Unable to resolve dependency for ':app#release/compileClasspath': Could not
resolve com.android.support:cardview-v7:27.1.1.
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath':
Could not resolve com.android.support:cardview-v7:27.1.1.
Here is my App gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
applicationId "afinal.recipe.p.recipe1"
minSdkVersion 22
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(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design: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.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
}
apply plugin: 'com.google.gms.google-services'
And my Project gradle:
// 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.2.1'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they
belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I've already been stuck on this for a while and tried a variety of solutions with no success such as ensuring offline mode isn't checked and changing
apply plugin: 'com.android.application'
to:
apply plugin: 'com.android.library'
and, without success, deleting:
applicationId "afinal.recipe.p.recipe1"
Thanks in advance for any help, would be greatly appreciated.

ClassNotFoundException: unable to find class "android.support.v4.util.ArrayMap"

The signed apk of my app runs on the android versions higher than 5.0.1 but I am facing this issue that my app crashes immediately after launching the app on version 5.0.1 and this is the error I get -
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.*****1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
please note that the app is not crashing when I run using android studio but it crashes when I run the signed apk.
I don't know what to do, I have gone through a lot of stackoverflow questions but found nothing that can solve my issue. This is my app.gradle file -
**buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' } // for crashlytics
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "*****"
minSdkVersion 21
targetSdkVersion 26
flavorDimensions "default"
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
versionCode 3
multiDexEnabled true
versionName "1.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
android {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
dexOptions {
javaMaxHeapSize "2g"
}
}
repositories {
mavenCentral()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//google 's library
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:design:26.0.2'
implementation 'com.android.support:support-v4:26.0.2'
implementation 'com.android.support:support-v13:26.0.2'
implementation 'com.android.support:cardview-v7:26.0.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.android.gms:play-services-vision:11.8.0'
//for barcode generation
implementation 'com.google.zxing:core:3.2.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
compile 'me.dm7.barcodescanner:zxing:1.9'
compile 'com.journeyapps:zxing-android-embedded:3.0.2#aar'
//multidex support
compile 'com.android.support:multidex:1.0.1'
//for fancy dialogs
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services:11.8.0'
compile 'com.geniusforapp.fancydialog:FancyDialog:0.1.4'
//for home screen carousal view
compile 'com.synnapps:carouselview:0.1.4'
//for bottom navigation
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
//for shaping the image view
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.jackandphantom.android:circularimageview:1.2.0'
//libraries for retrofit and conversion factory GSON
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
//FilePicker Library
compile 'com.droidninja:filepicker:2.0.8'
//for welcome screen
compile 'com.stephentuso:welcome:1.4.1'
compile 'com.squareup.okhttp3:okhttp:3.9.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.0.1'
compile 'com.squareup.retrofit2:converter-scalars:2.3.0'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
//material calender picker
compile 'com.wdullaer:materialdatetimepicker:3.4.0'
implementation 'com.trello:rxlifecycle:1.0'
implementation 'com.trello:rxlifecycle-components:1.0'
compile 'com.polidea.rxandroidble:rxandroidble:1.4.3'
implementation 'com.android.support:design:26.0.2'
compile 'io.reactivex.rxjava2:rxjava:2.0.7'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
//libraries for firebase integration
//for analytics
compile 'com.google.firebase:firebase-core:11.8.0'
//for cloud messenging
compile 'com.google.firebase:firebase-messaging:11.8.0'
//for circular indicator
compile 'com.github.lzyzsd:circleprogress:1.2.1'
compile 'me.biubiubiu.justifytext:library:1.1'
implementation files('libs/imagecapture.jar')
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
}
apply plugin: 'com.google.gms.google-services'**
This is my build.gradle (project level)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.0'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If the gradle version is 3.x.x try to add maven { url 'https://maven.google.com' } to
allprojects {
repositories {
//add here
}
}
instead of google() and sync gradle. It should help. You can see difference between them using this link.
I found the solution. I tried building the Signed apk for both the signature versions V1(jar signature) and V2(full apk signature) and it worked.

android studio Multiple dex files define Lcom/google/common/reflect/Types$WildcardTypeImpl;

I use firebase database, storage, auth and google cloud vision.
I got this error
Multiple dex files define Lcom/google/common/reflect/Types$WildcardTypeImpl;
I think that this project gradle conflicts
this is my gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "*************************"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
buildTypes.each {
it.buildConfigField 'String', 'API_KEY', '"**********************"'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
implementation 'com.google.api-client:google-api-client-android:1.23.0' exclude module: 'httpclient'
implementation 'com.google.http-client:google-http-client-gson:1.23.0' exclude module: 'httpclient'
implementation 'com.google.apis:google-api-services-vision:v1-rev369-1.23.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7: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:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.firebaseui:firebase-ui-storage:3.2.2'
implementation 'com.jaredrummler:colorpicker:1.0.1'
implementation 'com.android.support:multidex:1.0.3'
//firebase 구글 로그인 원래 16.0.2
implementation 'com.google.android.gms:play-services-auth:16.0.0'
// ++++++++ 2018.11.08 ++++++++
implementation 'com.android.support:design:27.1.1'
implementation 'com.firebaseui:firebase-ui-database:0.6.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'org.parceler:parceler-api:1.1.11'
annotationProcessor 'org.parceler:parceler:1.1.11'
//////////
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.1'
implementation 'com.google.firebase:firebase-storage:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.3'
implementation 'com.google.firebase:firebase-config:16.0.1'
implementation 'com.google.firebase:firebase-invites:16.0.4'
implementation 'com.google.firebase:firebase-ads:16.0.1'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.google.firebase:firebase-perf:16.1.2'
implementation 'com.google.firebase:firebase-functions:16.1.1'
implementation 'com.google.firebase:firebase-ml-vision:17.0.1'
implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.2'
}
apply plugin: 'com.google.gms.google-services'
this is my gradle(Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
// classpath 'com.android.tools.build:gradle:2.2.3'
// classpath 'com.google.gms:google-services:3.1.0'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
What can I do? ;(
I think gradle has some problems, but I dont' know what to do.
I put almost all codes found from googling
Help me :(
FirebaseUI has transistive dependencies on Firebase and Google Play libraries. It's important to specify a compatible set of libraries in your build.
You are using the most recent versions of the Firebase libraries, but very old versions of FirbaseUI. As a first step, make these changes to use a compatible version of FirebaseUI:
implementation 'com.firebaseui:firebase-ui-storage:4.2.1'
...
implementation 'com.firebaseui:firebase-ui-database:4.2.1'

android studio 3 build unable to merge dex

Hello suddenly my android project shows this error
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Before some days everything worked fine and I just opened it again after some days and shows me this
I have tried all the possible solutions I found here but nothing worked can you help me on this?
Here is my byuild.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.fire.stmtfadmin"
minSdkVersion 17
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'
}
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.android.support:cardview-v7:+'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.firebaseui:firebase-ui-database:2.3.0'
implementation 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
compile 'id.zelory:compressor:2.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
compile 'com.yqritc:recyclerview-multiple-viewtypes-adapter:1.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.StevenDXC:DxLoadingButton:2.0'
compile 'com.github.dmytrodanylyk:android-morphing-button:98a4986e56' // commit hash
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:multidex:1.0.0'
compile 'br.com.simplepass:loading-button-android:1.12.1'
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.google.android.gms:play-services-maps:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
// 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.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
To use the 11.4.0 version of Firebase, you need to add maven url to your build.gradle file like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
This is probably because you're using the following dependencies:
compile 'com.android.support:cardview-v7:+'
where it means you want to use the latest version. The latest version 27.1.0.
Try using:
implementation 'com.android.support:cardview-v7:26.1.0'
And never use + for your dependency version. So you can reproduce and debug the same build if there is any problem in the future.
thank you all for your replies but the only solution that worked for me was to add this line to build.gradle(Module:app):
implementation 'android.arch.lifecycle:extensions:1.1.0'
i hope this will help the others

Categories

Resources