java - Protobuf android:迁移到 AndroidX:找不到符号类 EnumVerifier
问题描述
我正在将现有项目迁移到 AndroidX。
当我尝试运行该应用程序时,我从“com.google.protobuf.Internal.java”中收到“错误:找不到符号类 EnumVerifier”。所以我签入了自动生成的文件“Internal.java”并且那里缺少“EnumVerifier”。
以下是我的 gradle 设置:
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.8.0'
}
generateProtoTasks {
all().each { task ->
task.builtins {
java {
option "lite"
}}}}}
dependancy {
implementation 'com.google.protobuf:protobuf-javalite:3.8.0'
}
//Android level gradle
dependancy {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'
}
提前致谢。
解决方案
我遇到了同样的错误,在我的情况下,问题是“lite”版本,我替换了:implementation 'io.grpc:grpc-protobuf-lite:1.25.0'
for implementation 'io.grpc:grpc-protobuf:1.25.0'
:,它编译和部署都很好。
推荐阅读
- handlebars.net - 无法使用查找助手编译模板 - 签名或安全透明度不兼容
- javascript - 尽管我的路径正确,但在地图上显示某些内容时,我在 laravel 中收到错误 419
- java - 无法在 Electron 旁边安装 NPM 包“java”
- php - CodeIgniter 中的 SQL 查询
- c# - EF 添加实体时,也将其附加到错误的实体但具有相同的属性
- php - 来自 json 解码页面的 preg 匹配
- glm - 如何在 R 中使用 glm() 函数或贝叶斯网络对二项式数据进行等价测试?
- java - Java中相同的密码导致不同的AES密钥
- boost-build - 如何将 Jambase 文件包含到我的构建中?
- ruby - 打印按哈希键排序的哈希数组