Java自学者论坛

 找回密码
 立即注册

手机号码,快捷登录

恭喜Java自学者论坛(https://www.javazxz.com)已经为数万Java学习者服务超过8年了!积累会员资料超过10000G+
成为本站VIP会员,下载本站10000G+会员资源,会员资料板块,购买链接:点击进入购买VIP会员

JAVA高级面试进阶训练营视频教程

Java架构师系统进阶VIP课程

分布式高可用全栈开发微服务教程Go语言视频零基础入门到精通Java架构师3期(课件+源码)
Java开发全终端实战租房项目视频教程SpringBoot2.X入门到高级使用教程大数据培训第六期全套视频教程深度学习(CNN RNN GAN)算法原理Java亿级流量电商系统视频教程
互联网架构师视频教程年薪50万Spark2.0从入门到精通年薪50万!人工智能学习路线教程年薪50万大数据入门到精通学习路线年薪50万机器学习入门到精通教程
仿小米商城类app和小程序视频教程深度学习数据分析基础到实战最新黑马javaEE2.1就业课程从 0到JVM实战高手教程MySQL入门到精通教程
查看: 386|回复: 0

Unity2D接入GG广告在发布安卓版本时报错CommandInvokationFailure: Failed to re-package resources解决方法

[复制链接]
  • TA的每日心情
    奋斗
    2024-4-6 11:05
  • 签到天数: 748 天

    [LV.9]以坛为家II

    2034

    主题

    2092

    帖子

    70万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    705612
    发表于 2021-5-14 13:16:26 | 显示全部楼层 |阅读模式

    今天就Unity2D项目接入了GG的移动广告,在发布安卓版本时,报了两个错误,其中有一项是:

    CommandInvokationFailure: Failed to re-package resources. See the Console for details.
    D:\Program Files\android-sdk\build-tools\23.0.1\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/Program Files/android-sdk\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.google.unity

    之前搞定过,这次出了一个问题,详细回忆后,解决之,再此来记录一下。

     

    报的错误原因是有一个包需要导入到Unity项目中,地址在安卓的SDK中。

    将android-sdk\extras\google\google_play_services\libproject下的google-play-services_lib文件夹拷贝到Unity项目中,具体路径在:Assets\Plugins\Android下面。

    重新导出搞定。

     

    后续,后来在导出安卓包时又报如下错误:

    Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
    D:\Program Files\android-sdk\build-tools\23.0.1\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/Program Files/android-sdk\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages android.support.v7.appcompat:com.google.android.gms:com.google.unity:com.google.android.gms.ads:com.google.android.gms:android.support.v4 -S "G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res" -S "G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res" -S "G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\play-services-ads-8.4.0\res" -S "G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\play-services-basement-8.4.0\res" -S "G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\support-v4-23.1.1\res"

    stderr[
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_alert_dialog_button_bar_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <android.support.v7.widget.ButtonBarLayout>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_alert_dialog_button_bar_material.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/abc_alert_dialog_button_bar_material for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_alert_dialog_material.xml:48: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from <android.support.v7.widget.DialogTitle>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_alert_dialog_material.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/abc_alert_dialog_material for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_dialog_title_material.xml:29: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from <TextView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_dialog_title_material.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/abc_dialog_title_material for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_screen_toolbar.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:touchscreenBlocksFocus from <android.support.v7.widget.ActionBarContainer>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_screen_toolbar.xml: note: using v21 attributes; synthesizing resource com.flash.AppleGame:layout/abc_screen_toolbar for configuration v21.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_search_view.xml:47: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_search_view.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/abc_search_view for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml:42: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <include>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_toStartOf from <include>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/notification_template_big_media for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:60: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <ImageView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:46: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <LinearLayout>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:46: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:38: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <include>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:38: note: removing attribute http://schemas.android.com/apk/res/android:layout_toStartOf from <include>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:30: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <include>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/notification_template_big_media_narrow for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <LinearLayout>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:77: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <LinearLayout>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:96: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <TextView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:64: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <LinearLayout>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/notification_template_lines for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_media.xml:43: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <include>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_media.xml:33: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_media.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/notification_template_media for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_chronometer.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <Chronometer>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_chronometer.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/notification_template_part_chronometer for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_time.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <DateTimeView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_time.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/notification_template_part_time for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_powered_by_google.xml:28: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <ImageView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_powered_by_google.xml:28: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <ImageView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_powered_by_google.xml:8: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_powered_by_google.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/place_autocomplete_item_powered_by_google for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_prediction.xml:52: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <TextView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_prediction.xml:35: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <TextView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_prediction.xml:8: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <include>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_item_prediction.xml: note: using v17 attributes; synthesizing resource com.flash.AppleGame:layout/place_autocomplete_item_prediction for configuration v17.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_progress.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:indeterminateTint from <ProgressBar>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_progress.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:indeterminateTintMode from <ProgressBar>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\google-play-services_lib\res\layout\place_autocomplete_progress.xml: note: using v21 attributes; synthesizing resource com.flash.AppleGame:layout/place_autocomplete_progress for configuration v21.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <CheckedTextView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <CheckedTextView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:drawableStart from <CheckedTextView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml: note: using v13 attributes; synthesizing resource com.flash.AppleGame:layout/select_dialog_multichoice_material for configuration v13.
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <CheckedTextView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <CheckedTextView>
    G:\Unity2D\MyUnityProject\NewApple\AppleGardensAnZhuo\AppleGardensGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:drawableStart from <CheckedTextView>
    G:\Unity2D\MyUnityProject\NewApple\Ap<message truncated>

     

    好多内容呀,搞了好久,又把google-play-services_lib文件夹从Unity里删除,在导出,没事,广告也显示

    哎...今天够累的,签到来了1...
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|手机版|小黑屋|Java自学者论坛 ( 声明:本站文章及资料整理自互联网,用于Java自学者交流学习使用,对资料版权不负任何法律责任,若有侵权请及时联系客服屏蔽删除 )

    GMT+8, 2024-5-6 15:25 , Processed in 0.069579 second(s), 29 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表