I have been attempting to build an old android application I have (from couple of years ago) and I keep on getting re-package failure errors. I’ve read couple of discussions with answers here on UnityAnswers but haven’t been able to fix the issue.
The console log reads:
Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
D:\Android SDK\build-tools\19.1.0\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/Android SDK/platforms/android-21\android.jar" -F bin/resources.ap_ --extra-packages com.google.example.games.basegameutils:com.google.example.games.mainlibproj -S "D:\Projects\Amazing Paulsonothon u4\Temp\StagingArea\android-libraries\BaseGameUtils\res"
But I simply don’t understand what the error message is trying to tell me. I initially assumed it’s because of access rights to the folder, but it has read-write enabled.
I am trying to build on APK level 19 and I have android sdk installed and with api level 19 from there as well. I have also tried setting it lower in Unity and having lower android sdk stuff but it had no difference. I have bundle identifiers, keystores and keys set. I also have Google Play Games asset “installed” in project and setup with my Google play app id, but that hasn’t made any difference either.
The error message seems to refer to the newest sdk I currently have, but before I had that installed it also matched the api 19.
You need to update your build-tools to the latest version (v21.0.2 should resolve this problem).
EDIT:
The upgrade to build tools v21.0.2 seems to resolved the original issue. Now you’re facing a different one.
The issue now is that either you (directly) or indirectly via some plugin reference google play services. Your project probably only contains the .jar without the accompanying resources (such as the resource that describes the version number).
You can add this manually by creating Plugins/Android/res/values/version.xml and have this in it: