- Home /
Failed to re-repackage resources
I tried to install the 23.0.3 but its not working. Could anyone point me where I'm doing things wrong please?
CommandInvokationFailure: Failed to re-package resources. C:\NVPACK\android-sdk-windows\build-tools\23.0.3\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/NVPACK/android-sdk-windows\platforms\android-25\android.jar" -F bin/resources.ap_ --extra-packages com.chartboost.sdk.unity:com.oculus.Integration -S "H:\MightySalmonStudios\Projects\Unity\Chisel\Chisel\Temp\StagingArea\android-libraries\OVRPlugin\res"
stderr[ AndroidManifest.xml:17: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').
] stdout[ Configurations: (default)
Files: values\values.xml Src: () H:\MightySalmonStudios\Projects\Unity\Chisel\Chisel\Temp\StagingArea\android-libraries\OVRPlugin\res\values\values.xml AndroidManifest.xml Src: () AndroidManifest.xml
Resource Dirs: Type values values\values.xml Src: () H:\MightySalmonStudios\Projects\Unity\Chisel\Chisel\Temp\StagingArea\android-libraries\OVRPlugin\res\values\values.xml Including resources from package: C:\NVPACK\android-sdk-windows\platforms\android-25\android.jar applyFileOverlay for drawable 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-mdpi\app_icon.png (processed image res\drawable-mdpi\app_icon.png: 94% size of source) (processed image res\drawable-xhdpi\app_banner.png: 93% size of source) (new resource id app_banner from xhdpi-v4\drawable\app_banner.png #generated) (new resource id app_icon from mdpi-v4\drawable\app_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, Int32 retiresOnFailure) UnityEditor.HostView:OnGUI()
UPDATE: After many tries, I deleted the chartboost SD$$anonymous$$ attached to my project and it compiles fine without it. Now to discover how to compile with the sdk...
Answer by liortal · Nov 10, 2016 at 07:46 AM
You are referencing a resource in your AndroidManifest (@integer/google_play_services_version) but this resource is not defined anywhere.
Previously (i think up to around a year ago), the Google play services library was distributed as a single .jar file, or could be downloaded from the Android SDK manager as an Android library project (e.g: a folder with a particular structure, including libs/ folder with the compiled .jar, a manifest, resources, etc).
Some developers used to include Google play services by merely copying the .jar file into the Unity project. This only included the client code for accessing Google play services, but did not include any resources (a resource can be an image, an integer, etc. In this particular case - it's an integer - a version number).
So, in your case - you have probably included the older form of google play services, added an entry to the manifest that references this resource - @integer/google_play_services_version, but did not include the res/ folder with those definitions.
The problem is, Google stopped distributing google play services in that form. Instead, they have segregated (split) the single .jar file into many smaller .aar files. This allows you finer granularity in choosing which exact client code you want to include, instead of including 1 huge .jar file.
To resolve your problem, you have 2 choices:
Include the Google play services android library project (the older one). You can search the web for it (here is an example that may work: https://github.com/MobileChromeApps/google-play-services/tree/master/libs/google-play-services_lib). Place this entire folder under Assets/Plugins/Android (make sure to remove the existing google play services .jar file).
Switch to the newer form of including Google play services - remove the existing .jar file and include Google play .aar libraries.
Answer by Cynikal · Nov 03, 2016 at 03:13 PM
Thank you for answering. I have been trying several answers from this, but none are working so far. I cannot find the C:\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\versions.xml.
Your answer
Follow this Question
Related Questions
Unity cannot find compatible Android device? 1 Answer
How to get Android 10 (API Level 29) 1 Answer
I am having trouble building the project for android (i can't build) 0 Answers
Android apk build can install but won't start. 2 Answers
How come when I generate a signed APK it produces out a JKS file? 0 Answers