2016-07-29 14 views
0

私はgradle.Iを同期できない私のプロジェクトでfirebase sdkを使用しようとしています.1.7から1.8へのjdkの更新とGoogleリポジトリの更新、アンドロイドSDKとツールを最新のバージョンにするが、私はクラス 'com.google.gson.JsonObject'を読み込むことができないとしてエラーを取得しています。androidのfirebaseのgradleの同期に失敗しました

プロジェクトのGradle:

buildscript { 
repositories { 
    jcenter() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:1.0.0' 
    classpath 'com.google.gms:google-services:3.0.0' 
    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
} 
} allprojects { 
repositories { 
    jcenter() 
} 
} 

モジュールのGradle:

apply plugin: 'com.android.application' 

アンドロイド{ 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' 
    } 

} 
packagingOptions{ 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/LICENSE-FIREBASE.txt' 
    exclude 'META-INF/NOTICE' 

} 
}dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
compile 'com.android.support:appcompat-v7:23.1.1' 
compile 'com.firebase:firebase-client-android:2.4.0' 
compile 'com.google.firebase:firebase-storage:9.2.1' 
compile 'pub.devrel:easypermissions:0.1.9' 
compile 'com.google.firebase:firebase-core:9.2.1' 
compile 'com.google.firebase:firebase-auth:9.2.1' 
} 
apply plugin: 'com.google.gms.google-services' 

エラー:

0それはあなたのキャッシュが壊れていると言うので

Possible causes for this unexpected error include:

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

IDEを再起動した後もFile -> Invalidate Cache/Restartの操作を行います。

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. 

答えて

1

あなたが投稿エラーメッセージがそれに言及した解決策を持っています。コメント

に前提条件が満たされなければならない会話から

を更新。あなたが言ったように、AS 1.0.1を使用しています。これは、firebaseが必要とするAS 1.5よりも小さいものです。あなたのAndroid Studioをアップグレードして、あなたはすばらしいはずです。

+0

私はやったことがありますが、それでも同じエラーが表示されています –

+0

あなたは何をしましたか? – AndroidMechanic

+0

私はキャッシュを無効にしてアンドロイドスタジオ –

関連する問題