无法重新包装资源添加谷歌播放游戏服务后

时间:2017-08-27 07:03:59

标签: unity3d build google-play-games

我已将ConsoliAds插件添加到我的项目中,我可以正确构建android。但是当我添加Google Play游戏插件时,在构建过程中我得到无法重新打包资源

在添加Google Play游戏之前有一张图片

There is an image before adding google play games

添加Google Play游戏后有一张图片

There is an image after adding google play game

在构建过程中,我得到无法重新打包资源,这些日志会出现在控制台中。 我使用的是最新版本的ConsoliAds和Google Play游戏

CommandInvokationFailure: Failed to re-package resources. See the Console for details.
D:\ANDROID\AndroidSDK\build-tools\23.0.3\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/ANDROID/AndroidSDK\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.chartboost.sdk.unity:com.google.unity:com.heyzap:com.google.example.games.mainlibproj:com.google.android.gms.auth.api:com.google.android.gms.auth:com.google.android.gms.drive:com.google.android.gms.games:com.google.android.gms.nearby:com.Company.ProductName:android.support.compat:android.support.coreui:android.support.coreutils:android.support.fragment:android.support.mediacompat:android.support.v4:com.papata.btb:com.unity3d.ads -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-base-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-drive-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-games-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-nearby-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-compat-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-core-ui-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-core-utils-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-fragment-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-media-compat-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-v4-23.0.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\unity-android-resources\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\UnityAds\res"

stderr[
E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_dark_normal.xml:9: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/googleg_standard_color_18').

E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_disabled.xml:16: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/googleg_disabled_color_18').

E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_light_normal.xml:9: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/googleg_standard_color_18').

]
stdout[
Configurations:
 (default)

Files:
  AndroidManifest.xml
    Src: () AndroidManifest.xml

Resource Dirs:
Including resources from package: D:\ANDROID\AndroidSDK\platforms\android-23\android.jar
applyFileOverlay for drawable
trying overlaySet Key=common_google_signin_btn_text_dark_normal.xml
trying overlaySet Key=common_google_signin_btn_text_disabled.xml
trying overlaySet Key=common_google_signin_btn_text_light_normal.xml
trying overlaySet Key=app_banner.png
trying overlaySet Key=app_icon.png
applyFileOverlay for layout
applyFileOverlay for anim
applyFileOverlay for animator
applyFileOverlay for interpolator
applyFileOverlay for transition
applyFileOverlay for xml
applyFileOverlay for raw
applyFileOverlay for color
applyFileOverlay for menu
applyFileOverlay for mipmap
Processing image: res\drawable-xhdpi\app_banner.png
Processing image: res\drawable\app_icon.png
    (processed image res\drawable\app_icon.png: 99% size of source)
Processing image: res\drawable-ldpi\app_icon.png
Processing image: res\drawable-hdpi\app_icon.png
    (processed image res\drawable-ldpi\app_icon.png: 98% size of source)
Processing image: res\drawable-xhdpi\app_icon.png
    (processed image res\drawable-hdpi\app_icon.png: 99% size of source)
Processing image: res\drawable-xxhdpi\app_icon.png
    (processed image res\drawable-xhdpi\app_icon.png: 99% size of source)
Processing image: res\drawable-xxxhdpi\app_icon.png
    (processed image res\drawable-xhdpi\app_banner.png: 93% size of source)
    (processed image res\drawable-xxhdpi\app_icon.png: 99% size of source)
    (processed image res\drawable-xxxhdpi\app_icon.png: 99% size of source)
    (new resource id app_banner from xhdpi-v4\drawable\app_banner.png #generated)
    (new resource id app_icon from drawable\app_icon.png #generated)
    (new resource id app_icon from ldpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from hdpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from xhdpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from xxhdpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from xxxhdpi-v4\drawable\app_icon.png #generated)
    (new resource id common_google_signin_btn_text_dark_normal from E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_dark_normal.xml)
    (new resource id common_google_signin_btn_text_disabled from E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_disabled.xml)
    (new resource id common_google_signin_btn_text_light_normal from E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_light_normal.xml)
]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[] progress_strings, Single progress_value, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.HostView:OnGUI()

更新:我的问题已解决,我解释了here

1 个答案:

答案 0 :(得分:0)

我尝试了Internet上的所有内容,但对我没有用。 这是我为解决此问题所做的工作。 不多,但不要生我的气

第1步:导出所有资产,资源以及Google服务文件以外的所有内容。 (如果您像我一样使用多个Google软件包,例如Play服务,广告咨询,IAP软件包,则不会导出)。导出为统一包。 第2步:创建一个新的统一项目 第3步:首先导入所有Google Play软件包,请勿导入您的软件包 第4步:构建并检查新项目中的空白场景是否没有错误 步骤5:从上一步导入导出的包 第6步:修复脚本文件中由于Google包中的依赖性而导致的错误 步骤7:建立专案

注意:请勿将您的项目移至新位置,否则可能会再次导致重新打包问题。我不知道为什么,但是这发生在我身上