I have gone through the below link for integrating AdMob
http://fastegggames.com/blog/2013/3/30/tutorial-admob
and Follwing is the error when i tried to build my .apk to test AdMob :
Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\android-sdk-windows1\build-tools\19.0.1\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/android-sdk-windows1/platforms/android-19\android.jar" -F bin/resources.ap_ --extra-packages -S "C:\Users\avisingh.TAGS\Desktop\ONE_07\ONE_07\Temp\StagingArea\android-libraries\facebook\res"
stderr[
C:\Users\avisingh.TAGS\Desktop\ONE_07\ONE_07\Temp\StagingArea\android-libraries\facebook\res\values\strings.xml: error: Duplicate file.
res\values\strings.xml: Original is here.
]
stdout[
Processing raw dir 'C:\Users\avisingh.TAGS\Desktop\ONE_07\ONE_07\Temp\StagingArea\android-libraries\facebook\res'
]
I tried to build in API18 and API19 but still the same error. Can any one please help me through
Related
I'm facing a problem in building my game to apk after I implemented unity google ads plugin. Before adding the plugin the build worked.
The problem is the error mentioned below:
CommandInvokationFailure: Failed to re-package resources.
CommandInvokationFailure: Failed to re-package resources.
C:\Users\Hamid Red\AppData\Local\Android\Sdk\build-tools\29.0.2\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "C:/Users/Hamid Red/AppData/Local/Android/Sdk\platforms\android-29\android.jar" -F bin/resources.ap_ --extra-packages android.arch.lifecycle:androidx.arch.core:androidx.asynclayoutinflater:androidx.browser:androidx.coordinatorlayout:androidx.core:androidx.cursoradapter:androidx.customview:androidx.documentfile:androidx.drawerlayout:androidx.fragment:androidx.interpolator:androidx.legacy.coreui:androidx.legacy.coreutils:androidx.lifecycle.livedata:androidx.lifecycle.livedata.core:androidx.lifecycle:androidx.lifecycle.viewmodel:androidx.loader:androidx.localbroadcastmanager:androidx.print:androidx.slidingpanelayout:androidx.swiperefreshlayout:androidx.versionedparcelable:androidx.viewpager:android.support.compat:android.support.coreui:android.support.coreutils:android.support.fragment:android.support.mediacompat:android.support.v4:com.google.android.gms.ads.impl:com.google.android.gms.ads_base:com.google.android.gms.ads_identifier:com.google.android.gms.ads:com.google.android.gms.common:com.google.android.gms.gass:com.google.firebase.measurement:com.google.android.gms.measurement_base:com.google.firebase.measurement_impl:com.google.android.gms.measurement.sdk:com.google.android.gms.measurement.sdk.api:com.google.android.gms.stats:com.sglib.easymobile.androidnative:com.google.unity:com.google.unity.ads:com.unity3d.ads -S
Follow the picture and resolve dependencies:
If it still doesn't work then it can be due to outdated android sdk.
https://github.com/unity-plugins/Unity-Admob/issues/70
https://forum.unity.com/threads/solved-still-commandinvokationfailure-failed-to-re-package-resources-after-updating-android-sdk.496425/
Might help you.
I am getting this error when i try to build my game for android.
What I've tried
I have looked at all the other answers on Stack Overflow but nothing seems to work
I have deleted the 24.0.0 Build tools
I have tried different jdk
I always get the same error trying to build for android.
I am using Unity 5.3.8 and Mac Yosemite
Error details
CommandInvokationFailure: Failed to re-package resources. See the
Console for
details./Users/admin/Library/Android/sdk/build-tools/android-4.4W/aapt
package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S
"res" -I
"/Users/admin/Library/Android/sdk/platforms/android-26/android.jar" -F
bin/resources.ap_ --extra-packages
com.google.unity:android.support.v7.appcompat:com.facebook.android:com.google.android.gms:com.google.android.gms.ads.impl:com.google.android.gms.ads:com.google.android.gms.base:com.google.android.gms:com.google.android.gms.clearcut:com.google.android.gms.gass:com.google.android.gms.tasks:android.support.v4
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/appcompat-v7-23.1.1/res"
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/facebook/res"
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/google-play-services_lib/res"
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/play-services-ads-10.0.1/res"
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/play-services-ads-lite-10.0.1/res"
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/play-services-base-10.0.1/res"
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/play-services-basement-10.0.1/res"
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/play-services-clearcut-10.0.1/res"
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/play-services-gass-10.0.1/res"
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/play-services-tasks-10.0.1/res"
-S "/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/support-v4-24.0.0/res"stderr[/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/google-play-services_lib/res/values/admob_ads_attrs.xml:10: error: Attribute "adSize" has already been
defined/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/google-play-services_lib/res/values/admob_ads_attrs.xml:17: error: Attribute "adSizes" has already been
defined/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/google-play-services_lib/res/values/admob_ads_attrs.xml:20: error: Attribute "adUnitId" has already been
defined/Users/admin/Desktop/game/Temp/StagingArea/android-libraries/appcompat-v7-23.1.1/res/values/values.xml:110:
error: Attribute "theme" has already been
defined]stdout[Configurations
I have installed the latest unity 3D version(5.5.1) and the latest Android SDK. I haven't built my project on Android before - I believe I get an error when it tries to generate an Android Manifest XML:
Some suggestions for this error for old versions of Android wanted the build-tools folder of a particular version deleted but this still doesn't work. Could somebody help me out here?
CommandInvokationFailure: Failed to re-package resources.
C:\Users\price\AppData\Local\Android\sdk\build-tools\25.0.2\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "C:/Users/price/AppData/Local/Android/sdk\platforms\android-25\android.jar" -F bin/resources.ap_ --extra-packages com.onesignal:com.onesignal.onesignalsdk:com.google.android.gms.base:com.google.android.gms:com.google.android.gms.gcm:com.google.android.gms.location:android.support.v4 -S "C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\onesignal-unity\res" -S "C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\OneSignalConfig\res" -S "C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res" -S "C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res" -S "C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-gcm-8.3.0\res" -S "C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\play-services-location-8.3.0\res" -S "C:\Users\price\OneDrive\Documents\FantasyMatchday_iOS\Temp\StagingArea\android-libraries\support-v4-23.1.0\res"
stderr[
AndroidManifest.xml:20: Tag <category> attribute name has invalid character '$'.
AndroidManifest.xml:51: Tag <permission> attribute name has invalid character '$'.
AndroidManifest.xml:52: Tag <uses-permission> attribute name has invalid character '$'.
]
stdout[
Configurations:
(default)
Files:
AndroidManifest.xml
Src: () AndroidManifest.xml
Resource Dirs:
Including resources from package: C:\Users\price\AppData\Local\Android\sdk\platforms\android-25\android.jar
applyFileOverlay for drawable
trying overlaySet Key=powered_by_google_dark.png
...
...
My Maven based project is executing the following command resulting in the error that follows:
Command
/bin/sh -c cd /Users/conor/Repositories/Dev/MyPosLogger/samples/HelloMyPosLogger && /Users/conor/Library/Android/sdk/build-tools/22.0.1/aapt package -f --no-crunch -I /Users/conor/Library/Android/sdk/platforms/android-19/android.jar -M /Users/conor/Repositories/Dev/MyPosLogger/samples/HelloMyPosLogger/target/filtered-manifest/AndroidManifest.xml -S /Users/conor/Repositories/Dev/MyPosLogger/samples/HelloMyPosLogger/src/main/res -S /Users/conor/Repositories/Dev/MyPosLogger/samples/HelloMyPosLogger/target/unpacked-libs/android.support_compatibility-v7-appcompat_apklib_22.0.0/res -m -J /Users/conor/Repositories/Dev/MyPosLogger/samples/HelloMyPosLogger/target/generated-sources/r --output-text-symbols /Users/conor/Repositories/Dev/MyPosLogger/samples/HelloMyPosLogger/target --auto-add-overlay
Error
/Users/conor/Repositories/Dev/MyPosLogger/samples/HelloMyPosLogger/target/unpacked-libs/android.support_compatibility-v7-appcompat_apklib_22.0.0/res/values-v21/styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
Why is this and how do I fix it please?
I am using Android Maven Plugin v3.8.2
I have faced this error before and i solved it by the followin
Open Android sdk and make sure latest version of support library is installed or not. If not then install it also check compile pi version for your project is latest or not i.e. 21.
2.After installing just mvn clean install.
This will solve the issue.
I was trying to compile Android project using command line in Windows. When I use aapt to generate R file, it comes out an error as below:
D:\SampleProject\MyApplication>aapt package -f -m -J ./gen -S ./app/src/main/res
-I "D:\ProgramInstall\Android\Android SDK\platforms\android-21\android.jar" -M
./app/src/main/AndroidManifest.xml
.\app\src\main\res\values\styles.xml:4: error: Error retrieving parent for item:
No resource found that matches the given name 'Theme.AppCompat.Light.DarkAction
Bar'.
I've found that the Theme.Appcompact.Light.DarkActionBar is related to the APPcompat_v7 floder while the floder is under in the libs floder, How can I let the complier know where to find the lib it need?
I know its too late or you may have already found the answer also but still posting:
D:\SampleProject\MyApplication>aapt package **--auto-add-overlay** -f -m -J ./gen -S ./app/src/main/res **-S "path_to_prebuilts\prebuilts\devtools\extras\android\support\v7\appcompat\res\"** -I "D:\ProgramInstall\Android\Android SDK\platforms\android-21\android.jar" -M ./app/src/main/AndroidManifest.xml