Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
220 views
in Technique[技术] by (71.8m points)

android - Unity - Error building Player: CommandInvokationFailure: Failed to re-package resources

I'm having some issues with Google Play Services and Unity 5.0.4. The issue occurs when I want to build my build my project, I get the following error

CommandInvokationFailure: Failed to re-package resources.

I've read a lot and tried to fix it, but no solution been working for me.

I've got the latest Google Play serivces (Rev 32), Google Repository (Rev 32) and Android Support Repository (Rev 35).

I've also read that you can't have API 24 installed, so I've uninstalled and removed it completely. I can't find any other solution to my problem.

Whole console log:

CommandInvokationFailure: Failed to re-package resources. C:Androidandroid-sdkuild-tools23.0.3aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Android/android-sdkplatformsandroid-23android.jar" -F bin/resources.ap_ --extra-packages com.google.example.games.mainlibproj stderr[ AndroidManifest.xml:19: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). ] stdout[ Configurations: (default) v14 v21 xhdpi-v4 Files:
drawableapp_banner.png Src: (xhdpi-v4) resdrawable-xhdpiapp_banner.png drawableapp_icon.png Src: () resdrawableapp_icon.png valuesstrings.xml Src: () resvaluesstrings.xml valuesstyles.xml Src: () resvaluesstyles.xml Src: (v14) resvalues-v14styles.xml Src: (v21) resvalues-v21styles.xml AndroidManifest.xml Src: () AndroidManifest.xml Resource Dirs: Type drawable drawableapp_banner.png Src: (xhdpi-v4) resdrawable-xhdpiapp_banner.png drawableapp_icon.png Src: () resdrawableapp_icon.png Type values valuesstrings.xml Src: () resvaluesstrings.xml valuesstyles.xml Src: () resvaluesstyles.xml Src: (v14) resvalues-v14styles.xml Src: (v21) resvalues-v21styles.xml Including resources from package: C:Androidandroid-sdkplatformsandroid-23android.jar applyFileOverlay for drawable 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: resdrawable-xhdpiapp_banner.png Processing image: resdrawableapp_icon.png (processed image resdrawableapp_icon.png: 94% size of source) (processed image resdrawable-xhdpiapp_banner.png: 93% size of source) (new resource id app_banner from xhdpi-v4drawableapp_banner.png #generated) (new resource id app_icon from drawableapp_icon.png #generated) ] UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg) UnityEditor.Android.PostProcessor.Tasks.BuildResources.CompileResources (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessor.Tasks.BuildResources.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.HostView:OnGUI()

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There can be following possible problems:

  1. There might be some duplicate jar files in your plugins folder. Find them and remove one of them to fix this problem.
  2. There might be an issue with merging data from more than one manifest files.

Check following posts to get the pointer :

  1. http://forum.unity3d.com/threads/commandinvokationfailure-android-asset-packaging-tool-failed-no-stderr-to-lookup.274631/

  2. http://answers.unity3d.com/questions/1074000/unity-5-android-build-failed-to-re-package-resourc.html

  3. https://github.com/playgameservices/play-games-plugin-for-unity/issues/900

  4. https://github.com/playgameservices/play-games-plugin-for-unity/issues/1011

  5. Error building player for Android in Unity?

EDIT :

You are missing res folder in plugins.

  1. Check this answer : https://stackoverflow.com/a/38076937/4366237

  2. And this forum post : http://forum.unity3d.com/threads/help-cant-build-project-after-trying-to-use-google-play-services.243284/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...