我能够在October 6th版上构建并发布我的Ffltter应用程序,我今天在Octuber 30th版上返回了,我收到了这个构建错误:

  • Could not resolve io.grpc:grpc-core:[1.28.0].
  • Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
  • Read timed out

似乎cloud_firestore有一个问题,它仍然试图从jCenter读取,我被告知它已经关闭,不支持新的存储库,但问题是,自从我上次发布和构建以来,我没有更改任何行,也没有更新任何包,是什么导致了这个问题?

我记得几个月前我也遇到过类似的问题,但在我用mavenCentral替换了jCenter之后,一切都被修复了,但这一次它又回来了.

Launching lib\main.dart on Android SDK built for x86 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve io.grpc:grpc-core:[1.28.0].
     Required by:
         project :app > project :cloud_firestore > com.google.firebase:firebase-firestore:21.7.1 > io.grpc:grpc-android:1.28.0
         project :app > project :cloud_firestore > com.google.firebase:firebase-firestore:21.7.1 > io.grpc:grpc-okhttp:1.28.0
      > Failed to list versions for io.grpc:grpc-core.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
            > Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
               > Read timed out

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
BUILD FAILED in 1m 37s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

这是我的build.gradle分:

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.2'
        classpath 'com.google.gms:google-services:4.3.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

是的,我的应用程序很旧,因为我还没有更新到Null-Safe.

有什么小贴士可以在将来避免这个问题吗?

我如何解决当前的这个问题?

推荐答案

JCenter似乎刚刚停机,因为每https://developer.android.com/studio/build/jcenter-migration年,该网站将无限期地继续提供只读存储库.

Flutter相关问答推荐

无法让Riverpod Stream发出新值

为什么Flutter 翼扩展卡有上下边框?

BlocBuilder仅生成一次,并在后续发出时停止重建

如何使用flutter_local_notification包处理通知操作?

如何使排内 children 的身高与其他排内 children 的身高相适应?

如何从RealmResults获取Flutter Flutter 流?

使用ImageFilter模糊并剪裁同一renderObject中的元素

摆动更改标记可轻敲文本按钮样式

在Dart中使用Riverpod代码生成时出现问题(addListener)

当我转到其他屏幕并按下后退按钮时,屏幕将不会刷新

尽管我的 url 链接正确,但 ArgumentError(无效参数:URI 文件中未指定主机:///)错误

如何使Flutter 屏幕无法关闭?

Flutter 错误:OutletListModel类型的值不能分配给List类型的变量?

如何从底部导航栏打开 bottomModal 表?

Android: 从 URI 获取音频元数据

我无法从 Cloud firestore 访问文档字段并在 statefulwidget 类中显示它

statefulWidget 无法进行所需更改的问题

Flutter 如何要求用户在应用程序中设置电话密码?

在flutter web中重新加载页面时保留一些状态数据的有效方法是什么?

Flutter GetX:Get.put 在 Widget 中的什么位置?