我在使用Android手机构建游戏时在Unity中出错。搜索解决方案的第5天。我在互联网上搜索类似的问题,其中大部分与谷歌播放服务有关,但我没有在我的项目中。我使用统一广告,并从错误信息中找到与之相关的内容。我重新安装了Android SDK,下载了最新的构建工具,最后的API 23,但仍然没有。我试过了: - 将 build-tools 文件夹中的 aapt.exe 复制到 tools 文件夹中 - 下载旧版本的构建工具 - 检查空间的android路径
我没有更多的想法...请帮助,我使用Unity 5.3.1f1,Win8 64位
Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Android\sdk\build-tools\23.0.3\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Android/sdk\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.google.android.gms.ads:com.google.android.gms.ads:com.google.android.gms:com.google.android.gms:android.support.v4:android.support.v4:com.unity3d.ads.android -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-ads-8.3.0\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-ads-8.4.0\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-basement-8.4.0\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\support-v4-23.1.0\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\support-v4-23.1.1\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res"
stderr[
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <RelativeLayout>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:61: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <RelativeLayout>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <RelativeLayout>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:52: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:44: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:19: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <View>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:10: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml: note: using v17 attributes; synthesizing resource com.PrettyFlyGames.Cubic:layout/unityads_button_audio_toggle for configuration v17.
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_pause.xml:8: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_pause.xml: note: using v17 attributes; synthesizing resource com.PrettyFlyGames.Cubic:layout/unityads_button_pause for configuration v17.
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:92: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <include>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:57: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <LinearLayout>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:57: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <LinearLayout>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:44: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <TextView>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:29: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml: note: using v17 attributes; synthesizing resource com.PrettyFlyGames.Cubic:layout/unityads_view_video_play for configuration v17.
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\values\common_attrs.xml:13: error: Attribute "imageAspectRatioAdjust" has already been defined
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\values\common_attrs.xml:22: error: Attribute "imageAspectRatio" has already been defined
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\values\common_attrs.xml:27: error: Attribute "circleCrop" has already been defined
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-ads-8.3.0\res\values\admob_ads_attrs.xml:10: error: Attribute "adSize" has already been defined
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-ads-8.3.0\res\values\admob_ads_attrs.xml:17: error: Attribute "adSizes" has already been defined
C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-ads-8.3.0\res\values\admob_ads_attrs.xml:20: error: Attribute "adUnitId" has already been defined
]
stdout[
Configurations:
(default)
Files:
drawable\unityads_background_button_pause.xml
Src: () C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_background_button_pause.xml
等等(...)它很长
答案 0 :(得分:0)
您已下载:
Google Play Services
Android Support Library
对于类似的问题,请检查:
Can't build Unity project after adding google play games!
答案 1 :(得分:0)