在Unity中为Android构建Google VR项目在重新打包资源时失败

时间:2016-06-20 20:27:43

标签: android unity3d google-cardboard google-vr

我正在尝试为Google Cardboard构建一个真正的裸机应用程序,但我无法通过该构建。该应用程序没什么特别的,只是一个地形,一个球体,GvrMain预制件和一个标线。它在Unity播放器中运行良好。我在构建的中途得到了这个错误:

CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\natha\AppData\Local\Android\sdk\build-tools\24.0.0\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/natha/AppData/Local/Android/sdk\platforms\android-24\android.jar" -F bin/resources.ap_ --extra-packages com.google.vr.cardboard:vr.gvr.platform.unity -S "C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res" -S "C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\unitygvractivity\res"

stderr[

]
stdout[
Configurations:
 (default)

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

Resource Dirs:
Including resources from package: C:\Users\natha\AppData\Local\Android\sdk\platforms\android-24\android.jar
applyFileOverlay for drawable
trying overlaySet Key=ic_settings_48dp.png
trying overlaySet Key=quantum_ic_arrow_back_white_24.png
trying overlaySet Key=quantum_ic_arrow_downward_white_24.png
trying overlaySet Key=quantum_ic_arrow_upward_white_24.png
trying overlaySet Key=quantum_ic_settings_white_24.png
trying overlaySet Key=rippleable.xml
trying overlaySet Key=transition.png
trying overlaySet Key=app_banner.png
trying overlaySet Key=app_icon.png
applyFileOverlay for layout
trying overlaySet Key=back_button.xml
trying overlaySet Key=transition_view.xml
trying overlaySet Key=ui_layer.xml
trying overlaySet Key=ui_layer_with_portrait_support.xml
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
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable\ic_settings_48dp.png
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-mdpi-v4\quantum_ic_arrow_back_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-mdpi-v4\quantum_ic_arrow_back_white_24.png: 154% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-hdpi-v4\quantum_ic_arrow_back_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-hdpi-v4\quantum_ic_arrow_back_white_24.png: 138% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xhdpi-v4\quantum_ic_arrow_back_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xhdpi-v4\quantum_ic_arrow_back_white_24.png: 129% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xxhdpi-v4\quantum_ic_arrow_back_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable\ic_settings_48dp.png: 172% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xxxhdpi-v4\quantum_ic_arrow_back_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xxhdpi-v4\quantum_ic_arrow_back_white_24.png: 136% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-ldrtl-mdpi-v17\quantum_ic_arrow_back_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-ldrtl-mdpi-v17\quantum_ic_arrow_back_white_24.png: 152% size of source)
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xxxhdpi-v4\quantum_ic_arrow_back_white_24.png: 113% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-ldrtl-hdpi-v17\quantum_ic_arrow_back_white_24.png
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-ldrtl-xhdpi-v17\quantum_ic_arrow_back_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-ldrtl-hdpi-v17\quantum_ic_arrow_back_white_24.png: 140% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-ldrtl-xxhdpi-v17\quantum_ic_arrow_back_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-ldrtl-xhdpi-v17\quantum_ic_arrow_back_white_24.png: 122% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-ldrtl-xxxhdpi-v17\quantum_ic_arrow_back_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-ldrtl-xxhdpi-v17\quantum_ic_arrow_back_white_24.png: 133% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-mdpi-v4\quantum_ic_arrow_downward_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-mdpi-v4\quantum_ic_arrow_downward_white_24.png: 146% size of source)
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-ldrtl-xxxhdpi-v17\quantum_ic_arrow_back_white_24.png: 109% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-hdpi-v4\quantum_ic_arrow_downward_white_24.png
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xhdpi-v4\quantum_ic_arrow_downward_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-hdpi-v4\quantum_ic_arrow_downward_white_24.png: 142% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xxhdpi-v4\quantum_ic_arrow_downward_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xhdpi-v4\quantum_ic_arrow_downward_white_24.png: 147% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xxxhdpi-v4\quantum_ic_arrow_downward_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xxhdpi-v4\quantum_ic_arrow_downward_white_24.png: 135% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-mdpi-v4\quantum_ic_arrow_upward_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-mdpi-v4\quantum_ic_arrow_upward_white_24.png: 130% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-hdpi-v4\quantum_ic_arrow_upward_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xxxhdpi-v4\quantum_ic_arrow_downward_white_24.png: 131% size of source)
Processing image: C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-xhdpi-v4\quantum_ic_arrow_upward_white_24.png
    (processed image C:\Users\natha\OneDrive\Documents\MyProject\Temp\StagingArea\android-libraries\gvr_android_common\res\drawable-hdpi-v4\quantum_ic_arrow_upward_white_24.png: 141% size of source)
Processing imag
]
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()

2 个答案:

答案 0 :(得分:2)

可能是由于您使用的24.0.0构建工具中的错误。尝试从SDK管理器中删除它并重新启动Unity。这里有一个类似问题的post

答案 1 :(得分:0)

我通过在这个帖子中提出了retrobullet的建议解决了这个问题:

http://answers.unity3d.com/questions/653814/android-build-error-win-32-aaptexe-.html

首先,将C:\Users\%username%\AppData\Local\Android\sdk\platformsC:\Users\%username%\AppData\Local\Android\sdk\build-tools的所有内容移至备用位置。然后,打开Unity并构建项目。它应该检测到构建工具不存在并下载正确的版本。