当前位置: 首页 > 知识库问答 >
问题:

Android应用程序未连接到Firebase

满言
2023-03-14

我正在使用Firebase GMS服务开发android应用程序。
我试着按照他们的教程去做,我按照他们说的做了项目,下载了json文件。

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

无法解析Android应用程序模块的Gradle配置。解析gardle构建issuse和/或重新同步。

然而,我认为我的等级脚本是完美的(我会把它们写在页面的底部)

这是我的等级构建控制台

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

这是我的分级脚本(模块)

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'
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'

有没有人知道我如何用我的应用程序连接到Firebase?
请救救我的命...感谢

共有1个答案

仲孙诚
2023-03-14

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

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

 类似资料:
  • 我正在制作一个用户登录应用程序,当执行模拟器时,我可以注册用户,验证用户在我的数据库中的股票,但是当我在手机上执行应用程序时,它不能连接到我的数据库。 这是我与数据库的连接代码:

  • 免责声明:我知道人们通常不会这样做,我使用SQL数据库是出于成本原因,而且我对编程比较陌生。 我正在尝试从我的Android Studio应用程序向我的MariaDB数据库发送SQL脚本。我目前正在为MariaDB实现一个Java数据库连接(JDBC)驱动程序,但我不确定需要包括什么。 我去了JDBC MariaDB驱动程序的下载网站,但是有很多jar文件,我可以选择下载。你怎么知道你需要哪一个,

  • 我有一个Spring boot应用程序,里面有一个非常简单的Kafka制作人。如果我在没有加密的情况下连接到Kafka集群,一切都会很好。但如果我尝试使用SSL连接到kafka群集,就会超时。在producer中是否需要其他配置,或者需要定义其他属性,以允许spring正确使用所有配置? 我有以下属性设置: 应用程序启动时,将以下结果打印为ProducerConfig: 我的制作人非常简单: 使用

  • 我是Django的新手。我已经创建了一个名为,它在浏览器和邮递员应用程序中都能完美运行。 然而,当我试图从Android应用程序访问API时,它返回NULL。 当API如下所示时,android代码可以工作。 但是,当API为以下API时,它不起作用,即使以下API在同一台PC上运行的浏览器和Postman应用程序中运行良好。 我将代码附加到进行API调用的地方。 有人能帮我吗?提前感谢。

  • 问题内容: 我正在为我的三年级项目编写应用程序。该应用程序将需要与外部mySQL数据库进行交互。该应用程序将从数据库中检索数据,并在ListView中将其显示给用户。 我对应用程序将要具有的功能有很好的了解。我也花了很多时间使用ListViews和本地SQLite数据库。我还对HttpUrlConnection类做了一些重新研究。 我只是想知道有人能为我提供更多有关如何访问此外部数据库的指导吗?

  • 首先我是android应用程序开发环境的新手,我正在尝试使用jtds-1.3.1通过简单的android应用程序连接到MSSQLServer2008。jar驱动程序。我在网上搜索了很多例子,但没能连接到数据库 我得到的异常是网络错误IOException:连接超时 我不知道我的代码有什么问题,我使用的是Eclipse juno IDE<这是我的代码