Oct
20
2017

Android Build Error: Error: String types not allowed (at ‘configChanges’..

Tried to build simple Cardboard + GVR scene with Unity 2017.3b4, but kept getting this error:

CommandInvokationFailure: Failed to re-package resources.
***\android-sdk\build-tools\25.0.2\aapt.exe package –auto-add-overlay -v -f -m -J “gen” -M “AndroidManifest.xml” -S “res” -I “***android-sdk\platforms\android-23\android.jar” -F bin/resources.ap_ –extra-packages com.google.vr.cardboard:com.unity3d.unitygvr -S “***Game\Temp\StagingArea\android-libraries\gvr\res” -S “***Game\Temp\StagingArea\android-libraries\unitygvr\res”

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|layoutDirection|density’).
]

 

What I tried
– Modifying the AndroidManifest.xml configChanges line or even deleting the whole xml, but that didn’t help
– Tried deleting some unused stuff from GVR plugin, that apparently use some newer features, permission demo and those(?)
– Updated Java JDK to v9, but later founded out that v9 doesn’t work with Unity (CommandInvokationFailure: Failed to build apk. Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder), more info: http://answers.unity3d.com/answers/1416130/view.html , so installed v8 instead (x64) http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
– Tried running updates on SDK Manager, tried building different API levels from 19 up to 26

Solution
– run SDK Manager, install SDK Platform (API 26), apparently mine was still API 23, although i was building for API 19..

 

More Info
– About JDK9 incompatibility https://forum.unity.com/threads/java-9-jdk-9-support-by-unity-android.499354/


5 Comments + Add Comment

  • Hi,
    I have the same issue (I think after updating my unity version to 2017.2.0f3). Please let me know when you find out how to fix this. Thanks

    Michael

  • Ah, just saw that you added a solution, will try this.

  • ok, that didn’t work…

  • sorry for spamming. It works now, apparently I had to install API 25 to make it work. I guess this is because I use a different unity version than you and this is the latest that you can select in the player settings. So finally I have set API 17 as minimum and API 25 as target (both installed, 17 is probably not needed though). If I set anything else as target, it doesn’t work, no matter if installed or not. Seems like a bug to me.

  • thank you .i had the same problem.and it works now

Leave a comment to michael

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.