gpt4 book ai didi

Android 应用无法构建

转载 作者:行者123 更新时间:2023-11-30 01:02:26 26 4
gpt4 key购买 nike

gradle attemp to build project(with protobuf)后有日志

:app:generateDebugProto FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:generateDebugProto'.

    protoc: stdout: . stderr: /Users//app/build/extracted-protos/main: warning: directory does not exist. /Users//app/src/debug/proto: warning: directory does not exist.
    /Users//app/build/extracted-protos/debug: warning: directory does not exist. /Users//app/build/extracted-include-protos/debug: warning: directory does not exist. /Users//app/src/debug/proto: warning: directory does not exist. /Users//app/build/extracted-protos/debug: warning: directory does not exist.
    /Users/_/app/build/extracted-include-protos/debug: warning: directory does not exist. Missing output directives.

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

无法修复。

最佳答案

以下配置对我有用

项目级build.gradle文件

classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'

应用级build.gradle文件

apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.8.0'
}
plugins {
javalite {
artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
}
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.0.0-pre2'
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
}
task.plugins {
javalite { }
grpc {
option 'lite'
}
}
}
}
}

关于Android 应用无法构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39251297/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com