记录AndroidStrudio打包报错与解决方案(一)

问题一:打包报错

Unity.IL2CPP.Building.BuilderFailedException: 
C:\Users\user\AppData\Local\Android\Sdk\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ 
@"C:\Users\user\AppData\Local\Temp\tmp7277.tmp" -o "D:\Build\F1_Moto_3\unityLibrary\build\il2cpp_armeabi-
v7a_Release\il2cpp_cache\linkresult_E785829920EB9DA92D80A0D1BD1336CA\libil2cpp.so" -shared -Wl,-
soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id -stdlib=libc++ -static-
libstdc++ -target armv7-linux-androideabi19 -Wl,--wrap,sigaction 
"D:\Build\F1_Moto_3\unityLibrary\src\main\jniStaticLibs\armeabi-v7a\baselib.a" -llog -rdynamic -fuse-ld=gold.exe

在这里插入图片描述
将unity导出来项目的这些删除,重新打包
我导出来的这个包是独立的,而我实际用Adroidstudio操作的是另外一个F1_Moto_3
在这里插入图片描述
所以最后从F1_Moto_1复制这四个到F1_Moto_3中

问题二:然后出现了一个新的报错

Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken
 because the classes and Android resources from any local .aar file dependencies would not be packaged in the
  resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not
   throwing this error). The following direct local .aar file dependencies of the :unityLibrary project caused this error: 
   D:\Build\F1_Moto_3\unityLibrary\libs\EmoSDK-release.aar

这个报错是由于

1、

更新了build版本 gradle-7.2 后,aar已经不让直接依赖了(这个解决方案可以去看别人的文章)
传送门:https://www.cnblogs.com/guanxinjing/p/17012120.html

2、

如果没有更新bulid版本,也没有使用高级的gradle,那么就直接在android studio中选择
Bulid =>Clear Projecet => Rebulid Project",然后直接build APK即可,如下图
在这里插入图片描述

3、
删除unity的libary文件,再重新打包

问题三:后来我打包Release正式包,没问题,但Debug包

在这里插入图片描述
但是当我打Debug包的时候出现了
报错Unable to find EOCD signature

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Unable to find EOCD signature

报错提示就是签名出现异常
原因是该签名只能在正式包使用,而在Debug包的非正式环境下会出错,这个是我们原生的原话,
但是我用我自己的签名也不行。
最后换了一种打包方式就解决了
在这里插入图片描述
包在launcher => build => outputs => apk => debug
在这里插入图片描述

另外

当你Clear了项目之后,你也可以不Rebulid ,直接进行下面操作
在这里插入图片描述
这个操作会生成很多数据,而你clear的其实也是这些数据

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值