Please help! CommandInvokationFailure: Failed to re-package resources!
Hi everyone! Two days ago since I been trying to implement Admob and google play services in my project together. With admob plugin only the project works great but with the google play services plug-in I still have the same problem:
CommandInvokationFailure: Failed to re-package resources.
C:\Users\Miguel\Documents\Android\sdk\build-tools\24.0.3\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/Miguel/Documents/Android/sdk\platforms\android-24\android.jar" -F bin/resources.ap_ --extra-packages android.support.v7.appcompat:com.google.example.games.mainlibproj:com.google.android.gms.ads.impl:com.google.android.gms.ads:com.google.android.gms.auth.api:com.google.android.gms.auth:com.google.android.gms.base:com.google.android.gms.base:com.google.android.gms:com.google.android.gms:com.google.android.gms.drive:com.google.android.gms.games:com.google.android.gms.gass:com.google.android.gms.nearby:com.google.android.gms.tasks:com.google.android.gms.tasks:android.support.v4 -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\appcompat-v7-23.4.0\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-ads-10.2.0\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-ads-lite-10.2.0\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-auth-10.2.1\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-auth-base-10.2.1\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-base-10.2.0\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-base-10.2.1\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-basement-10.2.0\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-basement-10.2.1\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-drive-10.2.1\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-games-10.2.1\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-gass-10.2.0\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-nearby-10.2.1\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-tasks-10.2.0\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\play-services-tasks-10.2.1\res" -S "C:\Users\Miguel\Documents\Unity Backups\Prueba_Admob_GooglePlay\Temp\StagingArea\android-libraries\support-v4-24.0.0\res"
My android SDK:
Please help :c. I use unity 5.4.1f version
you did not post the full error message, but from what i can see, you have multiple versions of google play services (for example - play-services-tasks-10.2.1 and play-services-ads-10.2.0).
This kind of mix between different versions can cause the build to fail, but again, i didn't see the full error message so it's hard to tell.
Answer by liortal · May 21, 2017 at 06:38 AM
The error message you posted is not the complete one. Usually, the real cause for the error is at the end of the message. The problem is that Unity's console window truncates these messages as they're too long.
From what i can see, it looks like you have Google play services libraries from different versions, for example:
play-services-ads-10.2.0
play-services-tasks-10.2.1
This has been known to cause build errors, and should really be avoided.
Your answer
Follow this Question
Related Questions
Google Play services and Admob issue 0 Answers
App crashes since AdMob is added 0 Answers
Cannot sign in to Google Play Services 5 Answers
Admob unnecessary permissions? 0 Answers
App closes immediately after opening 0 Answers