2016-11-13 42 views
4

我正在使用Firebase GMS服务开发Android应用程序。
我试图按照他们的教程,我做项目,他们说,下载了JSON文件。
Android应用程序无法连接到Firebase

但是,当我试图将我的应用程序连接到Firebase。他们告诉我错误

无法解析Android应用程序模块的Gradle配置。解决gardle build issuse和/或resync。

enter image description here

不过,我觉得我的成绩脚本是完美的(我会写他们的页面底部)

enter image description here

这是我的成绩构建控制台

Executing tasks: [:app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources] 

Configuration on demand is an incubating feature. 
WARNING: WARNING: Dependency org.json:json:20090211 is ignored for debug as it may be conflicting with the internal version provided by Android. 
     In case of problem, please repackage it with jarjar to change the class packages 
WARNING: WARNING: Dependency org.json:json:20090211 is ignored for debug as it may be conflicting with the internal version provided by Android. 
     In case of problem, please repackage it with jarjar to change the class packages 
WARNING: WARNING: Dependency org.json:json:20090211 is ignored for debug as it may be conflicting with the internal version provided by Android. 
     In case of problem, please repackage it with jarjar to change the class packages 
WARNING: WARNING: Dependency org.json:json:20090211 is ignored for debug as it may be conflicting with the internal version provided by Android. 
     In case of problem, please repackage it with jarjar to change the class packages 
WARNING: WARNING: Dependency org.json:json:20090211 is ignored for release as it may be conflicting with the internal version provided by Android. 
     In case of problem, please repackage it with jarjar to change the class packages 
WARNING: WARNING: Dependency org.json:json:20090211 is ignored for release as it may be conflicting with the internal version provided by Android. 
     In case of problem, please repackage it with jarjar to change the class packages 
WARNING: WARNING: Dependency org.json:json:20090211 is ignored for release as it may be conflicting with the internal version provided by Android. 
     In case of problem, please repackage it with jarjar to change the class packages 
WARNING: WARNING: Dependency org.json:json:20090211 is ignored for release as it may be conflicting with the internal version provided by Android. 
     In case of problem, please repackage it with jarjar to change the class packages 
Incremental java compilation is an incubating feature. 
:app:preBuild UP-TO-DATE 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareComAndroidSupportAnimatedVectorDrawable2400Library UP-TO-DATE 
:app:prepareComAndroidSupportAppcompatV72400Library UP-TO-DATE 
:app:prepareComAndroidSupportMediarouterV72400Library UP-TO-DATE 
:app:prepareComAndroidSupportPaletteV72400Library UP-TO-DATE 
:app:prepareComAndroidSupportSupportV42400Library UP-TO-DATE 
:app:prepareComAndroidSupportSupportVectorDrawable2400Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServices980Library 
:app:prepareComGoogleAndroidGmsPlayServicesAds980Library 
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite980Library 
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics980Library 
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl980Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing980Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite980Library 
:app:prepareComGoogleAndroidGmsPlayServicesAuth980Library 
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase980Library 
:app:prepareComGoogleAndroidGmsPlayServicesAwareness980Library 
:app:prepareComGoogleAndroidGmsPlayServicesBase980Library 
:app:prepareComGoogleAndroidGmsPlayServicesBasement980Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesCast980Library 
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework980Library 
:app:prepareComGoogleAndroidGmsPlayServicesClearcut980Library 
:app:prepareComGoogleAndroidGmsPlayServicesDrive980Library 
:app:prepareComGoogleAndroidGmsPlayServicesFitness980Library 
:app:prepareComGoogleAndroidGmsPlayServicesGames980Library 
:app:prepareComGoogleAndroidGmsPlayServicesGass980Library 
:app:prepareComGoogleAndroidGmsPlayServicesGcm980Library 
:app:prepareComGoogleAndroidGmsPlayServicesIdentity980Library 
:app:prepareComGoogleAndroidGmsPlayServicesIid980Library 
:app:prepareComGoogleAndroidGmsPlayServicesInstantapps980Library 
:app:prepareComGoogleAndroidGmsPlayServicesLocation980Library 
:app:prepareComGoogleAndroidGmsPlayServicesMaps980Library 
:app:prepareComGoogleAndroidGmsPlayServicesNearby980Library 
:app:prepareComGoogleAndroidGmsPlayServicesPanorama980Library 
:app:prepareComGoogleAndroidGmsPlayServicesPlaces980Library 
:app:prepareComGoogleAndroidGmsPlayServicesPlus980Library 
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet980Library 
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager980Library 
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi980Library 
:app:prepareComGoogleAndroidGmsPlayServicesTasks980Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesVision980Library 
:app:prepareComGoogleAndroidGmsPlayServicesWallet980Library 
:app:prepareComGoogleAndroidGmsPlayServicesWearable980Library 
:app:prepareComGoogleFirebaseFirebaseAnalytics980Library UP-TO-DATE 
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl980Library UP-TO-DATE 
:app:prepareComGoogleFirebaseFirebaseAuth980Library 
:app:prepareComGoogleFirebaseFirebaseAuthCommon980Library 
:app:prepareComGoogleFirebaseFirebaseAuthModule980Library 
:app:prepareComGoogleFirebaseFirebaseCommon980Library UP-TO-DATE 
:app:prepareComGoogleFirebaseFirebaseConfig980Library 
:app:prepareComGoogleFirebaseFirebaseCore980Library UP-TO-DATE 
:app:prepareComGoogleFirebaseFirebaseCrash980Library 
:app:prepareComGoogleFirebaseFirebaseDatabase980Library 
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection980Library 
:app:prepareComGoogleFirebaseFirebaseIid980Library UP-TO-DATE 
:app:prepareComGoogleFirebaseFirebaseMessaging980Library UP-TO-DATE 
:app:prepareComGoogleFirebaseFirebaseStorage980Library 
:app:prepareComGoogleFirebaseFirebaseStorageCommon980Library 
:app:prepareComTsengvnTypekit100Library UP-TO-DATE 
:app:prepareDebugDependencies 
:app:compileDebugAidl UP-TO-DATE 
:app:compileDebugRenderscript UP-TO-DATE 
:app:generateDebugBuildConfig UP-TO-DATE 
:app:generateDebugResValues UP-TO-DATE 
:app:processDebugGoogleServices 
Parsing json file: C:\Users\AJH322\AndroidStudioProjects\hanyang\app\src\debug\google-services.json 
:app:generateDebugResources 
:app:mergeDebugResources 
:app:processDebugManifest 
:app:processDebugResources 
:app:generateDebugSources 
:app:mockableAndroidJar UP-TO-DATE 
:app:preDebugUnitTestBuild UP-TO-DATE 
:app:prepareDebugUnitTestDependencies 
:app:preDebugAndroidTestBuild UP-TO-DATE 
:app:prepareDebugAndroidTestDependencies 
:app:compileDebugAndroidTestAidl UP-TO-DATE 
:app:processDebugAndroidTestManifest 
:app:compileDebugAndroidTestRenderscript UP-TO-DATE 
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE 
:app:generateDebugAndroidTestResValues UP-TO-DATE 
:app:generateDebugAndroidTestResources UP-TO-DATE 
:app:mergeDebugAndroidTestResources 
:app:processDebugAndroidTestResources 
:app:generateDebugAndroidTestSources 

BUILD SUCCESSFUL 

Total time: 3 mins 14.678 secs 

这是我的gradle脚本(模块)

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "24.0.0" 
    defaultConfig { 
     applicationId "com.example.ajh322.hanyang" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.google.android.gms:play-services:9.8.0' 
    compile 'com.tsengvn:Typekit:1.0.0' 
    compile 'com.squareup.okhttp3:okhttp:3.4.2' 
    compile 'com.github.nkzawa:socket.io-client:0.3.0' 
    testCompile 'junit:junit:4.12' 
} 
apply plugin: 'com.google.gms.google-services' 

的gradle项目申请 插件: 'com.android.application'

android { 
    compileSdkVersion 23 
    buildToolsVersion "24.0.0" 
    defaultConfig { 
     applicationId "com.example.ajh322.hanyang" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.google.android.gms:play-services:9.8.0' 
    compile 'com.tsengvn:Typekit:1.0.0' 
    compile 'com.squareup.okhttp3:okhttp:3.4.2' 
    compile 'com.github.nkzawa:socket.io-client:0.3.0' 
    testCompile 'junit:junit:4.12' 
} 
apply plugin: 'com.google.gms.google-services' 

有谁知道我怎么可以连接与我的应用程序,以火力?
请救我的命...感谢



+我更新我的SDK工具,因为人们说
仍然没有工作。
enter image description here

回答

4

我怀疑你的项目中的gzips可能是罪魁祸首。在你的项目文件夹中搜索并删除它们,让gradle为你重新同步它。

可能的替代方案: https://github.com/socketio/engine.io-client-java/issues/13 https://github.com/ACRA/acra/issues/159

+0

哦,我的上帝,我想吻你,所以谢谢你!!!!!! – AJH

+0

我认为这些警告没有任何关于firebase反正再次感谢 – AJH

+0

@AJH哈哈,我不是同性恋,但20美元是20美元:') – Nicholas

0

我在的build.gradle文件中的一些其他错误。在注释掉下面的行后,它开始工作:

dexOptions 
      { 
       //incremental false 
      } 
0

我有同样的问题!当我使用Android Studio Firebase助手并点击“连接到Firebase”按钮时,我遇到了同样的问题。 解决方法很简单:忘记助手(显然,它存在一些错误),只需按照手动将Firebase项目集成到Android Studio项目的指示(在Firebase控制台中创建项目,下载json文件并将其放入它位于“应用”文件夹等内) 不要忘记确保所有的Firebase依赖项都具有相同的版本(例如11.8.0)。它为我工作。

相关问题