I keep getting configChanges: String types not all

2019-06-20 06:16发布

问题:

This question already has an answer here:

  • Error string types not allowed at android:configChanges in manifest file 2 answers
error: Error: String types not allowed (at 'configChanges' with value
    'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize').

Here is all my relevant code.

In the manifest:

    android:minSdkVersion="8"
    android:targetSdkVersion="13"

    android:name="com.google.ads.AdActivity"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout
        |uiMode|screenSize|smallestScreenSize"/>

SOLVED!!! The problem was the break in the tags on configChanges. They needed to be all on one line together. Do not split the line for readability, leave it together.

回答1:

I had this problem, but I was building my app with api 8. I also had api 13 as minimum sdk version. This is how to get it working: right click on your project>properties>android>choose android 3.2 or higher. This worked for me



回答2:

Even if your target is 13, I guess this will not work on devices with api less than 13 because the changed value is not just a TAG in the manifest, but it is a VALUE of a TAG. Therefore, the system will parse these values regardless of its api and will throw an exception when it finds an unknown VALUE.

To solve this, you will have to build the project twice: for api < 13 and for api >=13.

Correct me if I am mistaken (:



标签: android admob