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
...
...
Related
When I run this command :
"aapt.exe" package -f -m -M "AndroidManifest.xml" -I "android.jar" -S "\res" -J "\RJava" --auto-add-overlay
I receive the error : Found tag id where item is expected
It's this row in the values.xml that cause the problem :
<id name="view_tree_lifecycle_owner"/>
Note: with aapt2.exe it's work well, it's with aapt.exe that it's crash, but i need aapt.exe because I m building apk file
You can try adjusting your item definition to work with the older AAPT from:
<id name="view_tree_lifecycle_owner"/>
to
<item type="id" name="view_tree_lifecycle_owner"/>
Reference: https://developer.android.com/guide/topics/resources/more-resources#Id
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 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
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
I am trying to build R.java by using aapt from the command line. I am specifying multiple -S directories because I have multiple res directories. I am building by using:
aapt package \
-M AndroidManifest.xml \
-m -J gen \
-S src/com/example/res \
-S src/com/example/ui/res
Unfortunately, I am getting the following error:
src/com/example/ui/res/values/strings.xml:2: error: Resource at app1_name appears in overlay but not in the base package; use <add-resource> to add.
Currently, src/com/example/ui/res/values/strings.xml contains the following:
<resources>
<string name="app1_name">MyAppName</string>
</resources>
I would prefer not to have to change this to:
<resources>
<add-resource type="string" name="app1_name">MyAppName</add-resource>
</resources>
(This was suggested on https://groups.google.com/forum/?fromgroups#!topic/android-porting/bYfeLEjERjg, though it does not even seem to solve my problem.)
Am I misguided in my expectation of how the -S argument should work?
The only workaround I can think of is to symlink all of my -S directories as subdirectories of the root res directory and to specify res as the only -S directory.
I believe the solution is to use the --auto-add-overlay flag. I discovered this by running the default Ant build script with -v for verbose mode.