首页 > 解决方案 > 生成签名的apk找不到通用的超类

问题描述

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

找不到 [com/google/android/gms/internal/zzata](具有 1 个已知超类)和 [java/lang/String](具有 2 个已知超类)的通用超类

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

标签: androidandroid-gradle-pluginsigned-apk

解决方案


看起来我发现了问题所在。在我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.115.0.0其他库一样,然后它可以工作并生成我签名的 APK。感谢所有提供帮助的人,我希望这可以帮助任何有同样问题的人。


推荐阅读