【发布时间】:2022-01-01 11:26:06
【问题描述】:
我正在开发一个 Flutter 应用程序,该应用程序集成了一个使用 Protobuff 的本机包。我在 Android Studio 和 Mac(Apple 发布)上工作。
在 Windows 上,应用程序会构建,但由于我在 MacO 上工作,因此无法再构建应用程序。我收到以下错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ‘:mypackage:generateDebugProto’.
> Could not resolve all files for configuration ‘:mypackage:protobufToolsLocator_protoc’.
> Could not find protoc-3.9.2-osx-aarch_64.exe (com.google.protobuf:protoc:3.9.2).
Searched in the following locations:
https://jcenter.bintray.com/com/google/protobuf/protoc/3.9.2/protoc-3.9.2-osx-aarch_64.exe
* 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 888ms
Exception: Gradle task assembleDebug failed with exit code 1
iOS 上的构建也不起作用。
如何解决此错误?您对问题出在哪里有任何想法吗?
【问题讨论】:
-
我看到了
jcenter.bintray.com,但是那个 repo 是 EOL:jfrog.com/blog/… 和 blog.gradle.org/jcenter-shutdown 你可能想扩展你如何集成 protobuf/what 库。 -
谢谢,可能是解决方案。但是可以在没有 jcenter 的情况下使用 protobuf 吗?没有 jcenter 怎么逼?
-
在我的 gradle.build 中,如果我用 mavenCentral() 替换 jcenter(),我会遇到完全相同的错误。 (我的缓存已被清除)。
标签: android macos flutter gradle