"Error: line types are not allowed (in" configChanges "with a value of" keyboard | keyboardHidden | orien "... in AndroidManifest.xml

First of all, I'm new to Android, and I'm using API 10 (Gingerbread).

I am developing a simple game with libgdx. But I just install everything to get started and ... in AndroidManifest.xml this line:

 android:configChanges="keyboard|keyboardHidden|orientation|screenSize" 

The following error appeared in the console: _

 error: Error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden|orientation|screenSize'). 

I found this in the Stackoverflow answer, I switched to API 13 and it works ... but I think there should be a better solution than not making the application less compatible, because there is one line of code (there are many people who still use Gingerbread) . Is there another way to fix this?

+8
android api android-manifest
source share
3 answers

Configure your Android manifest for libgdx as follows and specify both min and the target version of sdk:

 <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19" /> 

You can use API 5 as the minimum version for Android, as this is what libgdx supports. Do not confuse the meaning of the target version of sdk: this basically means that you tested it against the latest version of Android, this does not mean that it will not work in previous versions, because you indicated min sdk before, Rule of thumb: put min-sdk as low as possible and target-sdk as high as possible.

By configuring it this way, your game should still work on older devices and with configChanges how it would work:

  android:configChanges="keyboard|keyboardHidden|orientation|screenSize" 

I just launched a game with such configurations and it works like a charm even on Gingerbread; -)

+6
source share

I spent three days of my life (and almost my marriage), but I have one other answer. Is hidden. I fixed minsdk, target. Why? due to |. I had configChanges elements separated by a / character, but this is not true. Yu must separate them |, But in cursive writing it is difficult to understand what is. Therefore, be careful with |

I hope this answer helps!

+6
source share

Just lost a lot of time. That was the problem:

Caused - AAPT tool does not allow density values ​​for configChanges until API level 24

Fixed - 2017.3.0b8, 2018.1.0a1, will also be transferred to service packs 2017.2, 2017.1 and 5.6

link to unity forum

Thus, this is clearly a mistake in the latest version of the unity editor at the time of writing. (2017.2.0f3) It adds "density" to configChanges in AndroidManifest.xml, which is not supported on Android versions below 7.0 (API level 24).

+3
source share

All Articles