我在 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.
最佳答案
关于android - 无法在 android 中同步 gradle for firebase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38633630/