Unity3d报错解决方案

报错情形一

更新了Android SDK到API level 20以后打包出错了:

Error building Player: Win32Exception: ApplicationName='C:/Android/adt-bundle-windows-x8664-20140702/sdk\tools\zipalign.exe', CommandLine='4 .......

解决方案:

上网查了一下文章,360搜索只找到一篇,说得不清楚,谷歌继续抽筋,还是用了yahoo中文,找到unity论坛的解决方法:

http://answers.unity3d.com/questions/759002/error-building-player-win32exception-1.html

step 1 go to the folder where your api is找到你api的文件夹(这个应该不难吧,目录为..\adt-bundle-windows-x86\sdk\build-tools),拣最高的版本

step 2 go to your newist api and coppy zipalign.exe复制这个文件

step 3 paste zipalign.exe at C:/Android/adt-bundle-windows-x8664-20140702/sdk\tools\搬家到旁边的邻居家里。。。坑哦!

再打包,问题解决。

报错情形二:

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.  

E:\android\android-sdks\build-tools\19.1.0\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "E:/android/android-sdks/platforms/android-20\android.jar" -F bin/resources.ap_  

stderr[  

res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.  

res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.  

res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.  

解决方案:

1、修改res/values,values-xx里面的styles.xml,

<style name="AppBaseTheme" parent="Theme.AppCompat.Light">  

改为  <style name="AppBaseTheme" parent="android:Theme.Light">  

 同理,将 <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">  

改为  <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">  

2、删掉menu里面的文件main.xml  


报错情形三:

Error building Player: CommandInvokationFailure: Failed to build apk. See the Console for details.

C:\Program Files\Java\jdk1.7.0_45\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="D:/android-sdk-windows\tools" -Dfile.encoding=UTF8 -jar "D:/Program Files/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -


解决方案:

1、重新创建签名及密码

2、重新创建后输出时还是报错的话,就关闭Unity重新打开再输出


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值