locked
String type not allowed at android manifest. RRS feed

  • Question

  • User223014 posted

    I'm currently working on an android project and I'm having this error.

    Error APT0000: String types not allowed (at 'configChanges' with value 'density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|touchscreen|uiMode'). (APT0000)

    My Xamarin Studio version is 6.0 and I've followed some solutions but to no avail, my current minSdkVersion is 13 and targetSdkVersion is 23.

    Monday, June 27, 2016 1:21 AM

All replies

  • User66025 posted

    You are making use of attribute layoutDirection in your manifest.

    It is introduced in API Level 17. I think that it's creating the error.

    Refer : https://developer.android.com/guide/topics/manifest/activity-element.html#config

    Monday, June 27, 2016 7:05 AM
  • User223014 posted

    I've changed my minSDKVersion to 17 but it's still having the same error

    Monday, June 27, 2016 7:08 AM
  • User66025 posted

    Can you display your Manifest please. !

    Monday, June 27, 2016 7:11 AM
  • User223014 posted

    I've realized removing density will not result in the error, but in another error ( C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(3,3): Error: java.lang.IllegalArgumentException: already added : Lcom/google/android/gms/auth/GoogleAuthUtil;)

    Monday, June 27, 2016 7:14 AM
  • User223014 posted

    This is the part of the Manifest that the error is showing up at

     <activity android:alwaysRetainTaskState="true" android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|touchscreen|uiMode" android:icon="@drawable/icon" android:label="Test" android:launchMode="singleTask" android:name="com.Testing.Test.MainActivity" android:screenOrientation="portrait">
          <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
          </intent-filter>
        </activity>
    
    Monday, June 27, 2016 7:22 AM
  • User66025 posted

    This error is due to referencing two same Android Libraries.


    Can't point out properly by not knowing your codes and full stack traces.

    Monday, June 27, 2016 7:29 AM
  • User223014 posted

    Sorry, I'm quite new to Xamarin. Does having the same packages across different project cause this ( C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(3,3): Error: java.lang.IllegalArgumentException: already added : Lcom/google/android/gms/auth/GoogleAuthUtil;) error as well?

    I'm integrating the Facebook SDK into my game, which first I'm integrating into a different project that the Main Project is dependent on, but there would be thousands of errors like definition of xxx not found in xxx from the Main Project and only when I added the Facebook SDK into the Main Project all the definition errors would disappear.

    Monday, June 27, 2016 7:52 AM
  • User223014 posted

    Okay, I'm not sure why, but when I added back the Density into the ConfigChanges, it does not show the String type not allowed Error anymore but still the same Java.lang.illegalArgumentException Error

    Tuesday, June 28, 2016 7:16 AM
  • User52370 posted

    I'm having the exact same problem since upgrading from Xamarin.Android 6.0.3.5 to 6.1.1.0. No code changes and our app no longer builds with the same error APT0000: String types not allowed (at 'configChanges' with value 'density|fontScale|keyboard.... I checked the generated AndroidManifest.xml file before and after, and with the older Xamarin installed, the file did NOT include the density property. Now it does, and it's failing with that error unless I comment out the following line of code:

    [Android.App.Activity( ... ConfigurationChanges= ... // Android.Content.PM.ConfigChanges.Density | ...

    I've tried every combination of Android SDK packages I can think of to get it building again, but no luck...anyone have any ideas, or is this a Xamarin regression?

    Friday, July 8, 2016 7:47 PM
  • User52370 posted

    Downgrading to Xamarin.Android 6.0.4.0 fixed this issue for me (and some deployment issues).

    Friday, July 8, 2016 10:26 PM
  • User223014 posted

    @Pyro76 said: Downgrading to Xamarin.Android 6.0.4.0 fixed this issue for me (and some deployment issues).

    How do you downgrade Xamarin.Android? I'm currently using Xamarin Studio on Windows and could not find a way to downgrade it. All listed version of android for windows at the Xamarin Store is 4.xxx

    Monday, July 11, 2016 2:26 AM
  • Monday, July 11, 2016 2:36 AM
  • User223014 posted

    I checked the Xamarin.Android Release notes and its saying its 6.1.1 for the latest version, but the latest version I could download from my subcription/download is 4.1.1

    Monday, July 11, 2016 6:49 AM