【问题标题】:FirebaseOptions ExceptioonFirebaseOptions 异常
【发布时间】:2016-06-08 09:02:34
【问题描述】:

每当我运行我的代码时,都会收到此异常

java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions

即使我没有在我的应用程序的任何地方使用 firebase。 是的,尝试了类似问题的几个解决方案。但是没有任何效果。

这是我的 bild.gradle 依赖项

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.code.gson:gson:2.2.4'
compile files('libs/FlurryAnalytics-4.2.0.jar')
compile files('libs/localytics.jar')
compile files('libs/main .jar')
compile files('libs/gcm.jar')
compile files('libs/picasso-2.3.2.jar')
compile files('libs/retrofit-1.9.0.jar')
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'io.branch.sdk.android:library:1.+'
compile 'com.android.support:appcompat-v7:23.0.1'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
    transitive = true;
}

}

提前致谢

【问题讨论】:

  • 请把 build.gradle 文件内容贴出来
  • 发布的构建依赖项

标签: android android-studio firebase


【解决方案1】:

Firebase 是 Google 云消息传递平台的新版本。从您的 gradle 看来,您已经添加了所有播放服务,因此也将 firebase 添加到您的项目中。换个试试

     compile 'com.google.android.gms:play-services:9.0.0'

仅包含您项目中需要的那些依赖项。您可以参考此link 了解更多信息。

【讨论】:

  • 尝试使用 9.0.0 版本。遇到同样的问题。
  • 您删除了整个 play-services 依赖项并仅添加了您需要的那些,对吗?
  • 我包含了这个“编译 'com.google.android.gms:play-services:9.0.0”
  • 只为项目中需要的那些库将其替换为单独的依赖项。您可以从我提供的链接中获取单独的依赖项。
  • 抱歉回复晚了。是的,在替换为单独的依赖项后,它现在可以工作了。谢谢。
猜你喜欢
  • 1970-01-01
  • 2018-01-15
  • 2022-01-10
  • 2020-01-02
  • 2016-09-11
  • 2021-12-05
  • 2012-06-17
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多