androidandroid-manifestscreen-orientation

In AndroidManifest: Expecting android:screenOrientation="unspecified"


Android Studio 3.6.

I want my app to be always in portrait mode. So in my AndroidMainfest.xml:

<activity
   android:name=".activity.SplashActivity"
   android:screenOrientation="portrait">
   <intent-filter>
      <action android:name="android.intent.action.MAIN" />

      <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
</activity>

I run the app and SplashActivity shows in portrait mode. Nice. But the editor shows the following error:

Expecting android:screenOrientation="unspecified"

Why?


Solution

  • In your manifest tag (just under xmlns:android="http://schemas.android.com/apk/res/android"), put

    xmlns:tools="http://schemas.android.com/tools"
    

    Then inside the application tag, put

    tools:ignore="LockedOrientationActivity"