【问题标题】:I am trying to connect to Firebase and I have followed all the steps I get these errors. I searched a lot here and found nothing我正在尝试连接到 Firebase,并且我已按照收到这些错误的所有步骤进行操作。我在这里搜索了很多,一无所获
【发布时间】:2020-08-20 02:09:16
【问题描述】:

classpath 'com.android.tools.build:gradle:3.5.2' 类路径 'com.google.gms:google-services:4.3.3'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'

androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.2'

} 应用插件:'com.google.gms.google-services'

* What went wrong:

配置根项目“汽车商店”时出现问题。

无法解析配置“:classpath”的所有工件。 无法解析 com.google.gms:google-services:4.3.3。 要求: 项目 : 无法解析 com.google.gms:google-services:4.3.3。 无法获取资源“https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom”。 无法获取“https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom”。 连接到 10.147.1.1:3128 [/10.147.1.1] 失败:连接超时:连接 无法解析 com.google.gms:google-services:4.3.3。 无法获取资源“https://jcenter.bintray.com/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom”。 无法获取“https://jcenter.bintray.com/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom”。 连接到 10.147.1.1:3128 [/10.147.1.1] 失败:连接超时:连接

  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。

  • 通过https://help.gradle.org获得更多帮助

在 2m 12s 内构建失败 错误:连接超时:连接

【问题讨论】:

    标签: android firebase


    【解决方案1】:

    通过将google() 添加到项目根文件夹(而不是模块的子文件夹)中的build.gradle 文件,将google maven 存储库添加到您的项目。

    它应该看起来像这样:

    buildscript {
        repositories {
            google()
            jcenter()
        }
        ...
    }
    

    【讨论】:

    • 现有的动词现在显示问题的说明
    猜你喜欢
    • 2020-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多