【发布时间】:2019-05-10 02:24:32
【问题描述】:
它在调试版本中运行良好,但在 Proguard 之后的发布版本中崩溃。
这是崩溃的代码
TranslateOptions options = TranslateOptions.newBuilder()
.setApiKey(context.getString(R.string.google_api_key))
.build();
Translate translate = options.getService();
Detection detection = translate.detect(sourceText);
最后一行崩溃。
这是 Proguard 规则
-keep class com.google.**
-keep interface com.google.**
-dontwarn com.google.**
【问题讨论】:
-
您找到解决问题的方法了吗?我正在使用 Translation Api 并面临类似的问题。