sanukin39 / UniAndroidPermission

Android Runtime Permission for Unity
MIT License
136 stars 30 forks source link

Landscape Mode Problem #23

Open yesbrad opened 5 years ago

yesbrad commented 5 years ago

Getting an issue where native android UI shows for a split second before loading the game, The game then starts in portrait mode then transitions to Landscape which the correct orientation.

Repro Steps - Unity 2017.4.14f1

  1. Import Unity package into a fresh project
  2. Setup test project
  3. Setup Android Manifest according to documentation
  4. Set game into landscape mode.

Pretty noticeable issue and needs to be resolved. The game works fine without the provided manifest.

Thank You

yesbrad commented 5 years ago

Okay, so I found a fix!

There's an error in the application tag of the plugins manifest. It's currently setting the android:theme attribute to the native android app theme. Which is what was causing the issue. It was fixed by adding in:

android:theme="@style/UnityThemeSelector"

To the manifests application tag.

The landscape issue was also fixed by adding a:

android:screenOrientation="landscape"

To the activity tag. I'm not sure why the plugin is overriding the orientation but this fixes it!

Hopefully, the attribute gets added to the manifest in the next version