找不到protoc-3.9.2-os x上颤动/建立安卓

0

的问题

我工作的一个扑应用集成一个土包,其使用Protobuff. 我工作上的机器人工作室和Mac(苹果船).

在windows的应用程序的基础,但由于我的工作mac os我可以不再生成应用程序。 我得到的以下错误:

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不能工作。

我如何能解决这个错误? 你有任何想法,在那里的问题是从未来?

android flutter gradle macos
2021-11-22 22:05:18
1

最好的答案

0

我已经找到一个解决方案的基础上: https://github.com/grpc/grpc-java/issues/7690

我已经创建文件: $HOME/.gradle/gradle.properties 有:

protoc_platform=osx-x86_64

我的建立。实例:

protobuf {
// Configure the protoc executable
protoc {
    // for apple m1, add protoc_platform=osx-x86_64 in $HOME/.gradle/gradle.properties
    if (project.hasProperty('protoc_platform')) {
        artifact = "com.google.protobuf:protoc:3.9.2:${protoc_platform}"
    } else {
        artifact = "com.google.protobuf:protoc:3.9.2"
    }
}
plugins {
    javalite {
        // The codegen for lite comes as a separate artifact
        if (project.hasProperty('protoc_platform')) {
            artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0:${protoc_platform}"
        } else {
            artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0"
        }
    }
}
2021-11-23 17:32:04

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................