Unreal Engine 5.7 Android packaged game lock orientation bug

Hello, i see a problem on Android packaged game, orientation lock not working anymore, i don’t know but seems a UE5.7 bug, because i have the package from UE5.5 version and is working orientation is locked(Landscape), in UE5.7 Android package can’t lock orientation mode to Landscape, i packaged almost 5 times my Android App deleting the cache everytime, nothing seems to work also with different options and scripts, i tryed all know solutions below:

  • In projects settings platforms/Android in the “orientation” drop down is “Landscape” or “Sensor Landscape”- PACKAGED GAME ORIENTATION NOT WORKING.
  • in “Extra settings for section” i added android:screenOrientation=“landscape” - PACKAGED GAME ORIENTATION NOT WORKING

Seems is stuck in SENSOR mode and it continue to rotate.
Someone encountered the same bug?

Hello seem i discovered why orientation is ignored:

The solution can be:

android:screenOrientation=“portrait” is not deprecated it is Discouraged

Android Lint will warn you about it but you can disable that by adding “DiscouragedApi” to the tools:ignore attribute list the manifest xml

e.g.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="DiscouragedApi">

you can override onActivityCreated method and set the orientation there.

@Override
public void onActivityCreated(Activity activity, Bundle bundle) {
      activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}

How to implement all of this in Unreal Engine 5.7? Please anyone?

Android 16 ignores orientation locks on large screens for apps targeting SDK 36, but games can opt out. Add android:appCategory="game" to the <application> element (we do it in our project’s UPL, Android only) and the lock should apply again. We haven’t tested it on a tablet ourselves, so tell me if it doesn’t work.

1 Like

Hello, thank you so much, we try and i let you know!

Unfortunately it not working, it start in portrait and it rotates only manually, is not fixed in landscape, seems it ignore the commands added in project settings/Android, i am working on normal phone.

(post deleted by author)