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?