微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Android生成签名Apk错误

我试图第一次从android studio生成apk.我得到了以下错误.

Error:Execution Failed for task ':_3dRunAdventure:transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/unity3d/ads/android/BuildConfig.class

enter image description here

请帮我上传我的第一个安卓游戏:)

解决方法:

如果您使用Unity构建游戏,则无需将其移至Android Studio以构建apk,您可以直接从Unity构建游戏.

您所要做的就是进入文件>构建设置确保您已将平台切换到android并按下构建按钮.如果您有任何错误,Unity会告诉您它们是什么.

还要确保所有场景都添加到构建中

enter image description here

对于那些真的想继续使用android studio并出现此错误的人:

因此,与此相关的错误一个已修复的错误,因此我首先将Android Studio更新到最新版本.

错误报告here中描述了此错误的原因:

The issue is that both the multidex library and the multidex-instrumentation library both use the same package name in their manifest which in turn means that they both have BuildConfig created in the same package name which triggers a conflict when both are added.

请注意,此特定错误位于不在android中的multidex包中.

但它几乎意味着你有两个导致冲突的相同.

This是在Unity论坛上提出的类似问题,其中包含一些解决问题的方法.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐