Facing several errors while building the project in Android [duplicate] - android

This question already has answers here:
Android - Getting multiple errors while building the project
(2 answers)
Closed 4 years ago.
I am getting these errors after importing the android project
Failed to resolve: firebase-core
Open File
Failed to resolve: multidex
Open File
Failed to resolve: play-services-ads
Open File
Failed to resolve: play-services-auth
Open File
Failed to resolve: firebase-auth-license
Open File
Failed to resolve: common
Show in File
I am unable to know the exact reason of this issue. Please check.
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha09'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app level build.gradle
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.test.android"
minSdkVersion 15
targetSdkVersion 26
versionCode 3
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "65f11821-8462-4ec4-9e41-XXXXX",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "916XXXXXXX00"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// applovin
implementation project(':unity-ads')
//unity ads
//compile 'com.google.android.gms:play-services-ads:11.0.4'
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support:support-vector-drawable:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.+'
//implementation 'com.google.android.gms:play-services:11.6.0'
implementation 'com.android.support:multidex:1.0.1'
//compile 'com.github.cooltechworks:ScratchView:v1.1'//not used
implementation 'com.jackpocket:scratchoff:1.1.0'
implementation 'com.adcolony:sdk:3.2.1'
implementation 'com.android.support:support-annotations:26.0.1'
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.facebook.android:facebook-share:[4,5)'
testImplementation 'junit:junit:4.12'
implementation 'com.ironsource.sdk:mediationsdk:6.7.0.1#jar'
//compile 'com.google.ads.mediation:unity:2.1.1.0' //not used
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.github.bumptech.glide:glide:4.1.1'
implementation 'commons-net:commons-net:3.3'
//get server time
//compile 'com.github.instacart.truetime-android:library-extension-rx:2.0'
//compile 'com.github.instacart.truetime-android:library:2.0' // not used
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-core:11.6.0'
implementation 'com.google.android.gms:play-services-auth:11.6.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
implementation files('libs/applovin-sdk-7.7.0-javadoc.jar')
implementation files('libs/applovin-sdk-7.7.0.jar')
}
apply plugin: 'com.google.gms.google-services'

EDIT: Unfortunately, I've belatedly realized that this question was a duplicate. Please refer to the answer here instead. (I'm also leaving this duplicate answer text here for now - although it will probably eventually be deleted - to preserve the solution that the original poster marked as correct.)
Apparently, jcenter has started mirroring Google's repo. Try moving google() before jcenter() in the allprojects section of your project's build.gradle (like this):
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
}

Try another version of this APIs. And you should to declare constant version and use it like {$const} then your gradle will be less error prone about versions difference.

Related

Unresolved dependencies in Android Studio project

Issue: I've recently updated/installed the latest version of Android Studio and I imported a little old project. When I sync the project I get these errors:
The errors are as follows:
Failed to resolve: com.google.android.gms:play-services-ads-identifier:12.0.1
Show in Project Structure dialog
Affected Modules: app
Failed to resolve: com.google.firebase:firebase-measurement-connector:12.0.1
Show in Project Structure dialog
Affected Modules: app
I tried to add all the necessary elements to the gradle and I tried installing Google Play Services in SDK. My project is imported from the Desktop.
This is my app/build.gradle:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.0'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.albetaqasite"
manifestPlaceholders = [
onesignal_app_id : 'cc95bb51-0699-4309-9322-be8793d5e564',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE']
minSdkVersion 15
targetSdkVersion 29
versionCode 55
versionName "3.4.1"
multiDexEnabled true
dexOptions {
javaMaxHeapSize "4g"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
useLibrary 'org.apache.http.legacy'
}
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation files('libs/android-async-http-1.4.4.jar')
implementation project(':ColorDialog')
implementation files('libs/universal-image-loader-1.9.4.jar')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
//implementation 'cn.pedant.sweetalert:library:1.3'
implementation 'com.github.f0ris.sweetalert:library:1.5.1'
implementation 'com.google.code.gson:gson:2.3.1'
implementation 'com.google.android.gms:play-services:8.4.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.okhttp:okhttp:2.+'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.+'
implementation 'com.google.android.gms:play-services-ads:8.4.0'
implementation 'com.google.android.gms:play-services-identity:8.4.0'
//compile 'com.google.android.gms:play-services-gcm:8.4.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.7'
implementation 'com.onesignal:OneSignal:[3.8.3, 3.99.99]'
// compile 'com.google.firebase:firebase-core:8.4.0'
}
apply plugin: 'com.google.gms.google-services'
This is my Project/build.gradle:
buildscript {
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.0.0'
// 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" // Google's Maven repository
} }
}
dependencies {
}
P.S: I'm aware of the problem in android.com.support dependencies, when I change the compileSdkVersion and targetSdkVersion to 27 it works, but the gradle ones I couldn't fix, kindly share your knowledge and experience if you've ever encountered this or have any idea how to solve it.
I think you need to add entries for those dependencies down in the section near these entries:
implementation 'com.google.android.gms:play-services:8.4.0'
implementation 'com.google.android.gms:play-services-ads:8.4.0'
implementation 'com.google.android.gms:play-services-identity:8.4.0'
However, if you try to bring in version 12.0.1 of one library, and version 8.4.0 of another related library, you are probably going to have issues. See if you can bump up the version number of these three to 12.0.1

How to fix : ERROR: Failed to resolve: 'androidx.cardview:cardview:1.0.0'

I'm developing a new android application by using androidx libraries, and i need to use cardview in my layout.
so i try to add cardview library to my project but i get this error ERROR: Failed to resolve: cardview
i check answers of Failed: com.android.support:cardview-v7:26.0.0 android, but it doesn't help me
answers like
add google() before jcenter()
add maven { url "https://maven.google.com" } to repositories
build.gradle(project)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.chavosh.porterageapp"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
testImplementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
testImplementation 'junit:junit:4.12'
// recycler view
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha04'
implementation 'androidx.cardview:cardview:1.0.0'
}
build.gradle(moudle)
// 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.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21"
// 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://jitpack.io' }
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle.properties has this two line
android.useAndroidX=true
android.enableJetifier=true
Just remove them!
With just those 3 you can use both RecyclerView and CardView and a plus as well: ConstraintLayout
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
implementation 'androidx.core:core-ktx:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
Add MaterialComponents:
implementation 'com.google.android.material:material:1.2.0-alpha06'
See this : https://stackoverflow.com/a/57833454/11720798
Tick download in CardView of Palette/layout to solve this problem

Android - Getting multiple errors while building the project

I am getting these errors while building the project
Failed to resolve: firebase-core
Failed to resolve: multidex
Failed to resolve: play-services-ads
Failed to resolve: play-services-auth
Failed to resolve: firebase-auth-license
Failed to resolve: common
Please check and let me know how this issue can be resolved?
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.test.android"
minSdkVersion 15
targetSdkVersion 26
versionCode 3
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "65f11821-8462-4ec4-9e41-XXXXXXXX",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "91629XXXXX00"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// applovin
implementation project(':unity-ads')
//unity ads
//compile 'com.google.android.gms:play-services-ads:11.0.4'
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support:support-vector-drawable:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.+'
implementation 'com.google.android.gms:play-services:11.6.0'
implementation 'com.android.support:multidex:1.0.1'
//compile 'com.github.cooltechworks:ScratchView:v1.1'//not used
implementation 'com.jackpocket:scratchoff:1.1.0'
implementation 'com.adcolony:sdk:3.2.1'
implementation 'com.android.support:support-annotations:26.0.1'
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.facebook.android:facebook-share:[4,5)'
testImplementation 'junit:junit:4.12'
implementation 'com.ironsource.sdk:mediationsdk:6.7.0.1#jar'
//compile 'com.google.ads.mediation:unity:2.1.1.0' //not used
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.github.bumptech.glide:glide:4.1.1'
implementation 'commons-net:commons-net:3.3'
//get server time
//compile 'com.github.instacart.truetime-android:library-extension-rx:2.0'
//compile 'com.github.instacart.truetime-android:library:2.0' // not used
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-core:11.6.0'
implementation 'com.google.android.gms:play-services-auth:11.6.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
implementation files('libs/applovin-sdk-7.7.0-javadoc.jar')
implementation files('libs/applovin-sdk-7.7.0.jar')
}
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 {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha09'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Apparently, jcenter has started mirroring Google's repo. Try moving google() before jcenter() in the allprojects section of your project's build.gradle (like this):
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
}
Have you tried rebuilding the app? Also make sure you are using the latest version of GMS. As a sidenote you dont need to add the entire gms library, you can add selective services. I see you have added gms- and gms-ads, which would already be included in the main gms.

Android P Error: Unable to resolve dependency issue

After updating the Target version P getting error
Error:Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.google.firebase:firebase-analytics:11.8.0.
Open FileShow Details
1.I added the google() in project gradle file
2.I have also checked by doing sync and clean project.
I checked below links
Unable to resolve all dependencies in android studio
Unable to resolve dependency Android Studio 3.0
1.App/Gradle
apply plugin: 'com.android.application'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 'android-P'
defaultConfig {
applicationId 'com.ctdiindia.b2b'
minSdkVersion 15
targetSdkVersion 'P'
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'
}
debug {
debuggable true
}
}
buildToolsVersion '27.0.3'
productFlavors {
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
//Testing
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'
testCompile 'org.mockito:mockito-all:1.10.19'
// Firebase
compile 'com.google.firebase:firebase-analytics:11.8.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-storage:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'
// Firebase UI
compile 'com.firebaseui:firebase-ui-database:3.1.0'
//Reycycler View
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
//Networking
implementation 'com.google.code.gson:gson:2.8.2'
compile 'com.amitshekhar.android:android-networking:1.0.1'
//Observabale librares
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.8'
}
apply plugin: 'com.google.gms.google-services'
2.Project/Gradle
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.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://jitpack.io" }
}
}
Anyone had this similar issue?
Instead of:
compile 'com.google.firebase:firebase-analytics:11.8.0'
use:
implementation 'com.google.firebase:firebase-analytics:11.8.0'
Use this
com.google.firebase:firebase-core:11.8.0
Instead of this
compile 'com.google.firebase:firebase-analytics:11.8.0'
FROM DOCS : com.google.firebase:firebase-core is a recommended alias for the com.google.firebase:firebase-analytics library.
The following libraries are available for the various Firebase features.
Gradle Dependency Line Service
com.google.firebase:firebase-core:11.8.0 Analytics
com.google.firebase:firebase-database:11.8.0 Realtime Database
com.google.firebase:firebase-firestore:11.8.0 Cloud Firestore
com.google.firebase:firebase-storage:11.8.0 Storage
com.google.firebase:firebase-crash:11.8.0 Crash Reporting
com.google.firebase:firebase-auth:11.8.0 Authentication
com.google.firebase:firebase-messaging:11.8.0 Cloud Messaging
com.google.firebase:firebase-config:11.8.0 Remote Config
com.google.firebase:firebase-invites:11.8.0 Invites and Dynamic Links
com.google.firebase:firebase-ads:11.8.0 AdMob
com.google.firebase:firebase-appindexing:11.8.0 App Indexing
com.google.firebase:firebase-perf:11.8.0 Performance Monitoring

Failed to resolve: com.google.firebase:firebase-auth:11.0.2

I just updated sdk, google play services and google repository, but still this error happened. Please help, I want to integrate authentication using phone number.
SDK Manager
Logcat
Build.gradle Module:Project
// Top-level build file where you can add configuration options common to all sub-projects/module
return
buildscript {
ext.kotlin_version = '1.1.3-2'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build.gradle Module:App
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.*****"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.google.firebase:firebase-auth:11.0.2'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
On Firebase documentation it says:
Getting a "Could not find" error? Make sure you have
the latest Google Repository in the Android SDK manager
Updating Google Repository should help with Failed to resolve issues as well (at the time of writing these lines, Google Repository version is 57).
So solving this should be rather simple. Here are the steps you should take:
Open SDK Manager.
Select SDK Tools on the top tabs.
Scroll down, under Support Repository select Google Repository.
Hit the OK button.
As soon as installation is completed, change the Firebase dependencies version to 11.0.2.
Click on the "Sync Now" button.
Enjoy Firebase =)
Seems like you forgot to include the google play services plugin add these lines of code
App level gradle
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
...
compile "com.google.firebase:firebase-core:11.0.2"
compile "com.google.firebase:firebase-auth:11.0.2"
...
}
apply plugin: 'com.google.gms.google-services' <-- this line ath the bottom of it
Project level gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0' <--- This Line
}
// Getting a "Could not find" error? Make sure you have
// the latest Google Repository in the Android SDK manager
Google have shifted their new repositories from jcenter to maven google.
Add
google()
inside repositories in project build.gradle
Add Googles own maven repository to your build-gradle file:
repositories {
maven {
url 'https://maven.google.com'
// Alternative URL is 'https://dl.google.com/dl/android/maven2/'
}
}
Source: https://developer.android.com/studio/build/dependencies.html#google-maven
Solved for me setting play-services and firebase equal versions, like this:
implementation "com.google.firebase:firebase-core:11.8.0"
implementation "com.google.firebase:firebase-messaging:11.8.0"
implementation "com.google.firebase:firebase-database:11.8.0"
implementation "com.google.firebase:firebase-storage:11.8.0"
implementation "com.google.firebase:firebase-auth:11.8.0"
implementation "com.google.firebase:firebase-config:11.8.0"
implementation "com.google.firebase:firebase-crash:11.8.0"
implementation "com.google.android.gms:play-services-maps:11.8.0"
implementation "com.google.android.gms:play-services-location:11.8.0"
implementation "com.google.android.gms:play-services-places:11.8.0"
implementation "com.google.android.gms:play-services-auth:11.8.0"
implementation "com.google.android.gms:play-services-base:11.8.0"
Try using older version of Auth.
compile 'com.google.firebase:firebase-auth:10.0.1'

Categories

Resources