1

I'm following this documentation to add FirebaseUI to my project but I have 2 errors (Failed to find provider info for com.google.android.gms.phenotype & Google Play services missing or without correct permission.)

this error occurs when I write that line at the dependencies :

implementation 'com.firebaseui:firebase-ui-auth:4.0.0'

my gradle app :

    apply plugin: 'com.android.application'

repositories {
    mavenLocal()
    flatDir {
        dirs 'libs'
    }
}

android {
    compileSdkVersion 24
    buildToolsVersion '27.0.3'

    defaultConfig {
        applicationId "com.google.firebase.udacity.friendlychat"
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    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 {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    //firebase
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation'com.google.firebase:firebase-database:16.0.1'
    implementation'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.firebaseui:firebase-ui-auth:4.0.0' // the problem is here ??

    //noinspection GradleCompatible
    compile 'com.android.support:design:24.2.0'
    compile 'com.android.support:appcompat-v7:24.2.0'
    // Displaying images
    compile 'com.github.bumptech.glide:glide:3.6.1'
}
apply plugin: 'com.google.gms.google-services'

my gradle project :

buildscript {
    repositories {
        jcenter()
        mavenLocal()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        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()
        mavenLocal()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

my logcat :

e08-02 08:48:30.431 8422-8440/com.google.firebase.chat E/ActivityThread: Failed to find provider info for com.google.android.gms.phenotype

08-02 08:48:30.510 8422-8443/com.google.chat E/FirebaseInstanceId: Google Play services missing or without correct permission.

08-02 08:48:30.550 8422-8443/com.google.chat E/FirebaseInstanceId: Google Play services missing or without correct permission.

08-02 08:48:30.927 8422-8445/com.google.chat E/ActivityThread: Failed to find provider info for com.google.android.gms.chimera

08-02 08:48:31.079 8422-8443/com.google.chat E/FirebaseInstanceId: Google Play services missing or without correct permission.

08-02 08:48:41.128 8422-8443/com.google.chat E/FirebaseInstanceId: Google Play services missing or without correct permission.

plase
  • 361
  • 1
  • 3
  • 9
lalap
  • 35
  • 1
  • 8
  • It seems that you're using version 27 of the build tools which is meant for Android API version 27. Consider using the `24.x.x` release of build tools instead. – Edric Aug 02 '18 at 11:41

4 Answers4

0

To solve this, change the following line of code:

implementation 'com.firebaseui:firebase-ui-auth:4.0.0'

to

implementation 'com.firebaseui:firebase-ui-auth:4.1.0'

And the following line of code:

classpath 'com.google.gms:google-services:4.0.1'

to

classpath 'com.google.gms:google-services:4.0.2'

And it seems that you also need to add the following line of code:

implementation 'com.google.android.gms:play-services-auth:15.0.1'
Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
  • Can you please add a screenshot of the error from the logcat? – Alex Mamo Aug 02 '18 at 13:37
  • with filter or without? – lalap Aug 02 '18 at 13:43
  • Do you have Google Play installed on your device? Probably no. Install the latest version and give it a try. Does it work? – Alex Mamo Aug 02 '18 at 14:20
  • You can also add `ACCESS_FINE_LOCATION` permission in your manifest file, if you are using location services. – Alex Mamo Aug 02 '18 at 14:22
  • I don't use any location service but I'll give it a shot. I don't know what you mean by install Google play in PC? – lalap Aug 02 '18 at 14:24
  • If you don't use location, ignore the last comment. Google Play should be installed on the device where you are testing your app, not on the PC. Can you install apps from the Google Play Store on your emulator? – Alex Mamo Aug 02 '18 at 14:26
  • yeah, it was without google play so I try to use my phone for debugging and the same error again. – lalap Aug 02 '18 at 14:42
  • So I was right. Regarding your phone, you shoul have the latest version in order to make it work. Update it to latest version. Does it work now? – Alex Mamo Aug 02 '18 at 15:26
  • it's on the latest version but still the same. – lalap Aug 02 '18 at 15:30
  • Please paste the error that you get from your phone, without filters. – Alex Mamo Aug 02 '18 at 15:39
  • idk how can I send it here it's too big around 5000 word – lalap Aug 02 '18 at 15:52
  • In this case just create another screenshot with the relevant errors. – Alex Mamo Aug 02 '18 at 15:54
  • idk why the error is change for the phone and also the emulator one second i'll send it – lalap Aug 02 '18 at 16:05
  • it changed the only thing i remember that i changed is the rules form firebase console and Idk how that related. – lalap Aug 02 '18 at 16:12
  • The error that you are talking about is not present in your logcat anymore, right? I cannot see it. Do you? – Alex Mamo Aug 02 '18 at 16:24
  • So in this, the initial problem is solved, right? If you encounter new problems regarding other errors, please post another fresh question, so me and other users can help you. – Alex Mamo Aug 03 '18 at 08:32
0

This issue seems to be device-related, make sure Google Play services are installed on your testing device.

Check out this solution: https://stackoverflow.com/a/25705181/5892396

Samuel
  • 60
  • 11
0

You need to keep the versions for all your google services library similar. Each Firebase UI version corresponds to a particular Google services version .

As per the docs (https://github.com/firebase/FirebaseUI-Android)

As of version 4.1.0, FirebaseUI has the following dependency versions:

Library Version firebase-auth 16.0.1

play-services-auth 15.0.1

firebase-database 16.0.1 ....

Updated : For the Error "Google Play services missing or without correct permission" , you could try the suggestion in this Link

"Download google play service sdk and add ACCESS_FINE_LOCATION permission in manifest if not added"

1nullpointer
  • 1,212
  • 1
  • 13
  • 19
-1

I found where the error was. I changed

compileSdkVersion 24

to

compileSdkVersion 24
lalap
  • 35
  • 1
  • 8