生成签名的 apk 找不到普通的超级 class

generating signed apk cannot find common super class

我正在尝试为我的应用程序构建一个签名的 apk,但每当我尝试构建它时都会收到此错误:

Can't find common super class of [com/google/android/gms/internal/zzata] (with 1 known super classes) and [java/lang/String] (with 2 known super classes)

我之前能够使用不同的密钥库构建签名的 apk,但现在我得到的只是这个错误。

看起来像是混淆器设置问题,请参阅:Warning: can't find superclass or interface

如果缺少的 class 是从您自己的代码中引用的,您可能忘记指定必要的库。就像从头开始编译所有代码一样,您必须指定代码直接或间接引用的所有库。如果库应该被处理并包含在输出中,你应该用 -injars 指定它,否则你应该用 -libraryjars.

指定它

看来我找到问题所在了。在我的应用程序 build gradle 中,我的依赖项如下所示:

dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation project(':libcocos2dx')

    }
    //dependencies { compile 'com.google.android.gms:play-services-ads:15.0.1' }
    dependencies { compile 'com.google.android.gms:play-services-analytics:12.0.1' }
    dependencies { compile 'com.google.android.gms:play-services-auth:15.0.0' }
    dependencies { compile 'com.google.android.gms:play-services-games:15.0.0' }
    dependencies { compile 'com.google.android.gms:play-services-drive:15.0.0' }

我在上面得到的错误是说在 google gms 命名空间中找不到库引用。事实证明这是因为我用于 'com.google.android.gms:play-services-analytics:12.0.1' 服务的版本。我只是像其他库一样将版本从 12.0.1 更改为 15.0.0,然后它就可以工作并生成我签名的 APK。感谢所有提供帮助的人,我希望这可以帮助遇到同样问题的任何人。