前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >unity3d+Android:apk未打入jar包,重复打入jar,temp临时目录,AS工程调试,Program type already present: com.xxx.BuildConfig

unity3d+Android:apk未打入jar包,重复打入jar,temp临时目录,AS工程调试,Program type already present: com.xxx.BuildConfig

作者头像
立羽
发布2023-08-24 15:15:49
发布2023-08-24 15:15:49
3320
举报
文章被收录于专栏:Unity3d程序开发Unity3d程序开发

检查APK是否打进Jar包

1.apk用winrar打开,提取class.dex文件,用dex2jar转换为jar文件

Temp目录

数据缓存(Data caches),写入临时文件和其他操作系统维护相关的东西就扔到 Temp 目录。如果是安卓出包,可以初步检查里面jar包是否打入

Jar包移动路径后重复打入jar

值得注意:如果一个cloudcore.jar包直接放入Assets/Plugins/Android目录下,识别为了native文件,为一个拼图icon

再移入例如Assets/Plugins/Android/GCloudCore/ib目录下,

打apk失败,报错 CommandInvokationFailure: Unable to convert classes into dex format. E:/AndroidSdk/jre\bin\java.exe -Xmx4096M -Dcom.android.sdkmanager.toolsdir=“E:/AndroidSdk/UnityAndroidSdk/sdk\tools” -Dfile.encoding=UTF8 -jar “D:\Program Files\Unity2017.4.40\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar” - stderr[ warning: Ignoring InnerClasses attribute for an anonymous inner class (com.tencent.tp.h) that doesn’t come with an associated EnclosingMethod attribute. 可以查看temp临时出包目录出现2个cloudcore.jar

解决:移动到子目录后,右键重导入

变为普通jar包,icon也从拼图变为jar包样式

再build,出包正常,temp目录也只有一个GCloudCore.jar

接入不同sdk版本需求

例如gcloud ● minSdkVersion:>=15 ● targetSdkVersion:28 先到本地 Android SDK 目录下,打开sdk manager 下载 android-28。 在菜单栏file->Build Settings中,进入Player Settings,设置Minimum API Level和Target API Level 所有接入sdk,要仔细阅读文档对sdk需求确定

导出AS工程打包调试

stderr[ warning: Ignoring InnerClasses attribute for an anonymous inner class (com.tencent.tp.h) that doesn’t come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any “-target” type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is not an inner class. 有时报这错,一直找到不哪个类被重复打包,只能导出as工程进行调试,会比editor输出更多错误信息

Program type already present : com.xxx.xxxx.BuildConfig

jar包被重复打包,他内部自带了BuildConfig,再打包时又生成了BuildConfig

解决办法:改AndroidMainifest里的包名,然后重新生成

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-11-18,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 检查APK是否打进Jar包
  • Temp目录
  • Jar包移动路径后重复打入jar
  • 接入不同sdk版本需求
  • 导出AS工程打包调试
  • Program type already present : com.xxx.xxxx.BuildConfig
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档