- Home /
Android Error building Player: CommandInvokationFailure: Failed to re-package resources
Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Program Files\Android\android-sdk\build-tools\21.1.2\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files/Android/android-sdk/platforms/android-10\android.jar" -F bin/resources.ap_
stderr[
AndroidManifest.xml:5: error: Error: String types not allowed (at 'configChanges' with value 'mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale').
]
stdout[
Configurations:
(default)
ldpi-v4
hdpi-v4
xhdpi-v4
xxhdpi-v4
xxxhdpi-v4
Files:
drawable\app_icon.png
Src: () res\drawable\app_icon.png
Src: (ldpi-v4) res\drawable-ldpi\app_icon.png
Src: (hdpi-v4) res\drawable-hdpi\app_icon.png
Src: (xhdpi-v4) res\drawable-xhdpi\app_icon.png
Src: (xxhdpi-v4) res\drawable-xxhdpi\app_icon.png
Src: (xxxhdpi-v4) res\drawable-xxxhdpi\app_icon.png
values\strings.xml
Src: () res\values\strings.xml
AndroidManifest.xml
Src: () AndroidManifest.xml
Resource Dirs:
Type drawable
drawable\app_icon.png
Src: () res\drawable\app_icon.png
Src: (ldpi-v4) res\drawable-ldpi\app_icon.png
Src: (hdpi-v4) res\drawable-hdpi\app_icon.png
Src: (xhdpi-v4) res\drawable-xhdpi\app_icon.png
Src: (xxhdpi-v4) res\drawable-xxhdpi\app_icon.png
Src: (xxxhdpi-v4) res\drawable-xxxhdpi\app_icon.png
Type values
values\strings.xml
Src: () res\values\strings.xml
Including resources from package: C:\Program Files\Android\android-sdk\platforms\android-10\android.jar
applyFileOverlay for drawable
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\app_icon.png
Processing image: res\drawable-ldpi\app_icon.png
(processed image res\drawable-ldpi\app_icon.png: 141% size of source)
(processed image res\drawable\app_icon.png: 130% size of source)
Processing image: res\drawable-hdpi\app_icon.png
Processing image: res\drawable-xhdpi\app_icon.png
(processed image res\drawable-hdpi\app_icon.png: 69% size of source)
Processing image: res\drawable-xxhdpi\app_icon.png
(processed image res\drawable-xhdpi\app_icon.png: 66% size of source)
Processing image: res\drawable-xxxhdpi\app_icon.png
(processed image res\drawable-xxhdpi\app_icon.png: 67% size of source)
(processed image res\drawable-xxxhdpi\app_icon.png: 70% size of source)
(new resource id app_icon from drawable\app_icon.png #generated)
(new resource id app_icon from ldpi-v4\drawable\app_icon.png #generated)
(new resource id app_icon from hdpi-v4\drawable\app_icon.png #generated)
(new resource id app_icon from xhdpi-v4\drawable\app_icon.png #generated)
(new resource id app_icon from xxhdpi-v4\drawable\app_icon.png #generated)
(new resource id app_icon from xxxhdpi-v4\drawable\app_icon.png #generated)
]
Answer by Yury-Habets · Dec 30, 2014 at 06:35 AM
This is pretty self-descriptive:
"AndroidManifest.xml:5: error: Error: String types not allowed (at 'configChanges' with value 'mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale')."
Check your manifest or post it here.
this is the file found in this folder C:\Program Files\Unity\Editor\Data\PlaybackEngines\androidplayer is this is correct file??
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.$$anonymous$$enginston.Vikas$$anonymous$$umar" android:theme="@android:style/Theme.NoTitleBar" android:versionName="1.0" android:versionCode="1" android:installLocation="preferExternal">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name" android:screenOrientation="fullSensor" android:launch$$anonymous$$ode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|ui$$anonymous$$ode|screenSize|smallestScreenSize|fontScale">
<intent-filter>
<action android:name="android.intent.action.$$anonymous$$AIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBAC$$anonymous$$_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
</application>
<uses-sdk android:$$anonymous$$SdkVersion="10" android:targetSdkVersion="10" />
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.mul$$anonymous$$ch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.mul$$anonymous$$ch.distinct" android:required="false" />
</manifest>
The manifest can be found in your Unity project folder + Temp/StagingArea/Android$$anonymous$$anifest.xml after you build your project, or if you select "Google Android Project" in the build window and choose "Export".
Seems like you posted your actual manifest, thanks. One thing that is suspicious is android:targetSdkVersion="10" - should be at least 19 or 21 in latest Unity versions.
Looks like you don't have Android SD$$anonymous$$ API level 21 installed. Please open Android SD$$anonymous$$ $$anonymous$$anager http://developer.android.com/tools/help/sdk-manager.html , select "SD$$anonymous$$ Platform" under API 21 and click "Install".
(by the way it should be done automatically by Unity, I will double check - which version of Unity are you using?)