android - 无法在 android 中同步 gradle for firebase

标签 android firebase

我在 android 中使用 firebase sdk,我收到一个错误,因为无法加载类 'com.google.Gson.JsonObject'。即使我已经将 jdk 从 1.7 更改为 1.8,但它没有用。任何人知道为什么不同步了。

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "nidhinkumar.firebaseexample"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),   'proguard-rules.pro'
    }
}   }
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.0.0-alpha1'
compile 'com.google.firebase:firebase-core:9.2.1'
}   apply plugin: 'com.google.gms.google-services'

错误:

Error:Unable to load class 'com.google.gson.JsonObject'.
Possible causes for this unexpected error include:<ul><li>Gradle's  dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)   <a href="syncProject">  Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

最佳答案

enter image description here 我也遇到了同样的问题,但是在更新这个存储库之后它会工作 只需将勾选标记的文件更新为最新版本即可使用

关于android - 无法在 android 中同步 gradle for firebase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38633630/

相关文章:

java - 通过 Activity 将数据从一个 fragment 传递到另一个 fragment - 滞后

使用 Emberfire 和 Torii 进行 Firebase 3 身份验证

javascript - firebase 服务和调试功能?

firebase - 没有导出成员 'Firebase'

ios - viewDidLoad,是否只调用一次?

java - 使用 Parcelable 在 Activity 之间发送对象数组列表

android - 以编程方式设置搜索栏进度 Android

java - 垂直居中 ListView

android - OpenInputStream 返回文件未找到异常但文件在那里

node.js - 将原始数据上传到 Google Cloud 函数中的 Firebase 存储桶?