Protobuf is a new structured data storage format developed by Google, which is generally used for serialization of structured data, which is what we often call data serialization. This serialization protocol is very light and efficient, and it is cross-platform. Currently, it supports a variety of mainstream languages and has more advantages than traditional XML, JSON and other methods. For details, please refer to: Google protocol buffer . However, recently when using Protobuf, the following error was reported.
Execution failed for task ':columbus:generateDebugProto'.
> Could not resolve all files for configuration ':columbus:protobufToolsLocator_protoc'.
> Could not find protoc-3.0.0-osx-aarch_64.exe (com.google.protobuf:protoc:3.0.0).
Searched in the following locations:
https://repo.maven.apache.org/maven2/com/google/protobuf/protoc/3.0.0/protoc-3.0.0-osx-aarch_64.exe
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
The solution is to change the address of protoc. If we open https://repo.maven.apache.org/maven2/com/google/protobuf/protoc/3.0.0/protoc-3.0.0-osx-aarch_64.exe
directly, we will find that the webpage cannot be opened, so I will remove the version number and open the following link:
https://repo.maven.apache.org/maven2/com/google/protobuf/protoc/
The version of protoc obtained is as follows:
So, we just need to find the code below and add osx-x86_64 to com.google.protobuf:protoc:3.0.0
.
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0'
}
plugins {
javalite {
artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
}
}
//变更后
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0:osx-x86_64'
}
plugins {
javalite {
artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0:osx-x86_64'
}
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。