2
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 25
        ...
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
        compile 'com.google.firebase:firebase-core:10.2.0'

    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    ...
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services-games:10.2.0'
    compile 'com.google.android.gms:play-services-plus:10.2.0'

}
apply plugin: 'com.google.gms.google-services'

Logcat: 08-06 14:07:01.005 8404-8648/com.metabrain.emre E/GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. 08-06 14:07:01.795 8404-8690/com.metabrain.emre E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY) 08-06 14:07:06.246 8404-8404/com.metabrain.emre E/UncaughtException: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9001, result=10002, data=Intent { (has extras) }} to activity {com.metabrain.emre/com.metabrain.emre.Main_Activity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Dialog.show()' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:3636) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3679) at android.app.ActivityThread.access$1300(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1358) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5354) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Dialog.show()' on a null object reference at com.google.example.games.basegameutils.GameHelper.showFailureDialog(GameHelper.java:950) at com.google.example.games.basegameutils.GameHelper.showFailureDialog(GameHelper.java:931) at com.google.example.games.basegameutils.GameHelper.giveUp(GameHelper.java:909) at com.google.example.games.basegameutils.GameHelper.onActivityResult(GameHelper.java:615) at com.google.example.games.basegameutils.BaseGameActivity.onActivityResult(BaseGameActivity.java:123) at android.app.Activity.dispatchActivityResult(Activity.java:6223) at android.app.ActivityThread.deliverResults(ActivityThread.java:3632) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3679)  at android.app.ActivityThread.access$1300(ActivityThread.java:151)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1358)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5354)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)  08-06 14:07:06.539 8404-8404/com.metabrain.emre E/AndroidRuntime: FATAL EXCEPTION: main Process: com.metabrain.emre, PID: 8404 java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9001, result=10002, data=Intent { (has extras) }} to activity {com.metabrain.emre/com.metabrain.emre.Main_Activity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Dialog.show()' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:3636) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3679) at android.app.ActivityThread.access$1300(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1358) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5354) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Dialog.show()' on a null object reference at com.google.example.games.basegameutils.GameHelper.showFailureDialog(GameHelper.java:950) at com.google.example.games.basegameutils.GameHelper.showFailureDialog(GameHelper.java:931) at com.google.example.games.basegameutils.GameHelper.giveUp(GameHelper.java:909) at com.google.example.games.basegameutils.GameHelper.onActivityResult(GameHelper.java:615) at com.google.example.games.basegameutils.BaseGameActivity.onActivityResult(BaseGameActivity.java:123) at android.app.Activity.dispatchActivityResult(Activity.java:6223) at android.app.ActivityThread.deliverResults(ActivityThread.java:3632) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3679)  at android.app.ActivityThread.access$1300(ActivityThread.java:151)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1358)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5354)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)

Emre Aydemir
  • 170
  • 2
  • 12
  • compile files('libs/google-play-services_lib-8c56674e6690f7834efbbf94b5fe8adc.jar') compile files('libs/google-play-services-86c18868d2748d4096dfe356ba3dc8ac.jar') is the problem –  Aug 06 '17 at 10:01
  • com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK . keep only one –  Aug 06 '17 at 10:02
  • I deleted the jar files. But then error: E/GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. – Emre Aydemir Aug 06 '17 at 10:09
  • see this... https://stackoverflow.com/questions/37428636/com-android-builder-packaging-duplicatefileexception-duplicate-files-copied-in –  Aug 06 '17 at 10:17
  • I added Logcat message. – Emre Aydemir Aug 06 '17 at 11:21
  • Maybe, your emulator would not have the Google Play Image of the Android. – Mohammedsalim Shivani Oct 12 '18 at 16:56

1 Answers1

0

Normally this happens with emulator , so this message could be ignored if you included google play service correctly.