构建签名APK失败 - 无法找到[android / content / Context]的常见超类

时间:2017-04-23 12:39:01

标签: java android proguard android-context onesignal

这是 Android 项目。使用正常构建是成功的,但使用签名密钥我收到此错误:

Execution failed for task ':transformClassesAndResourcesWithProguardForFlavorRelease'.
> java.io.IOException: java.lang.IllegalArgumentException: Can't find common super class of [android/content/Context] (with 2 known super classes) and [com/onesignal/ADMMessageHandler] (with 1 known super classes)

任何想法? 提前谢谢......

1 个答案:

答案 0 :(得分:2)

我认为Proguard导致了这个问题。

将此行添加到Proguard文件中。

-keep class com.onesignal.** { *; }

你应该阅读这个问题。 它可能会帮助你。 https://github.com/OneSignal/OneSignal-Android-SDK/issues/154