我最近更新了我的sdks,播放服务等。当我使用pre-Lollipop Android在设备/模拟器上运行我的应用时,它立即出现以下错误:
java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions
at com.google.firebase.FirebaseApp.zzeh(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1058)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:4819)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4432)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
我甚至没有使用Firebase!以下是我的gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.1'
lintOptions {
checkReleaseBuilds false
abortOnError false
}
defaultConfig {
applicationId "com.Myapp"
minSdkVersion 15
targetSdkVersion 24
versionCode 2
versionName "2"
multiDexEnabled true
}
buildTypes {
release {}
}
productFlavors {
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/Kryptonz-sdk.jar')
compile 'com.android.support:appcompat-v7:24.1.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.github.greenfrvr:hashtag-view:1.2.1'
compile 'com.google.android.gms:play-services:9.2.1'
compile 'com.android.support:cardview-v7:24.1.0'
compile 'com.android.support:recyclerview-v7:24.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.android.support:support-v4:24.1.0'
compile 'com.android.support:design:24.1.0'
}
现在可以将firebase包含在游戏服务中吗?如果是真的,我该如何排除它? 非常感谢。
答案 0 :(得分:0)
您可以为Firebase添加依赖关系
compile 'com.firebase:firebase-client-android:2.4.0'