【问题标题】:Failed to repack resources After adding google play game service添加google play游戏服务后重新打包资源失败
【发布时间】:2017-08-27 07:03:59
【问题描述】:

我已将ConsoliAds 插件添加到我的项目中,我可以正确构建android。但是当我添加 Google Play Game 插件时,在构建过程中我得到了 Failed to re-package resources

添加google play游戏前有图片

添加google play游戏后有图片

在构建过程中,我得到无法重新打包资源,这些日志出现在控制台中。 我正在使用最新版本的 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

【问题讨论】:

  • 您正在使用构建 23。您可以尝试从 android SDK 管理器将构建工具更新到 25。此外,请确保在 SDK 管理器中安装了 Google Play 服务
  • @ZayedUpal 我更新了构建工具并安装了最新版本的 Google Play 服务,但问题没有解决。 CommandInvokationFailure:重新打包资源失败。有关详细信息,请参阅控制台。 D:\ANDROID\AndroidSDK\build-tools\25.0.0\aapt.exe 包 --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I
  • @ZayedUpal 我正在使用统一 5.3.5p8
  • 您是否尝试从 Unity 菜单 Assets/Google Play Services/Resolve Client Jars 运行?另外,看看这个链接:github.com/playgameservices/play-games-plugin-for-unity/issues/…
  • @ZayedUpal 我运行了 Resolve Client Jars,我得到了 Resolution Complete。这是真的吗?我尝试再次构建,但我看到了同样的错误。

标签: unity3d build google-play-games


【解决方案1】:

我尝试了互联网上的所有内容,但对我没有任何帮助。 这是我为解决此问题所做的工作。 不多,但不要生我的气

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-04-09
    • 2017-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-07
    • 1970-01-01
    • 2015-01-30
    相关资源
    最近更新 更多