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:未找到 Google Play 服务资源。检查您的项目配置以确保包含资源。08-06 14:07:01.795 8404-8690/com.metabrain.emre E/libEGL: validate_display:255 错误 3008 (EGL_BAD_DISPLAY) 08-06 14:07:06.246 8404-8404/com.metabrain.emre E/UncaughtException: java.lang.RuntimeException:将结果 ResultInfo{who=null, request=9001, result=10002, data=Intent { (has extras) }} 传递到活动 {com.metabrain.emre/com.metabrain.emre.Main_Activity} 失败:java.lang.NullPointerException:尝试在android.app.ActivityThread的空对象引用上调用虚拟方法'void android.app.Dialog.show()'。