Mohit Motwani
Mohit Motwani

Reputation: 4792

Update Google Play Services. App won't work unless you update google play services

I've been trying to run an app on my Android Emulator and this error message is displayed when I launch the activity. I'm presently using Nexus 5x x86_64 API 25 and I've tried many different emulator with different configuration. I've installed system images, made changes to the play services version and also updated all the SDK tools. Nothing has worked. And I can't use a physical device because I don't have one. This started only after I added the Firebase UI. Can anyone help me solve this error?

My app build.gradle:

    apply plugin: 'com.android.application'

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

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.1'

    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'

    compile 'com.android.support:design:25.2.0'
    compile 'com.android.support:appcompat-v7:26.0.1'


    // Displaying images
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.google.firebase:firebase-auth:11.4.0'
    compile 'com.google.firebase:firebase-core:11.4.0'
    compile 'com.google.firebase:firebase-database:11.4.0'
    compile 'com.firebaseui:firebase-ui-auth:2.4.0'
    compile 'com.android.support:support-annotations:25.3.1'
}
apply plugin: 'com.google.gms.google-services'

Upvotes: 0

Views: 385

Answers (1)

Saikat1529
Saikat1529

Reputation: 184

You are seeing this message because you are using an emulator which by default does not have any google play service installed. Because Firebase is a part of google play service, which is not compiling while you running the app. To get it working, you may apply the below solution...

  1. Either you can remove Firebase UI
  2. Use real device which have google play store account
  3. Either install Xamarin Android Player / Genymotion and then install play service on them manually to work.

I have attached a link of tutorial tutorial of installing google play store in Xamarin Android Player. Hope it helps.

Upvotes: 2

Related Questions