- Home /
Android 6.0 Marshmallow creates black bar along bottom of screen.
Hello. I am having a problem after updating my Nexus 5 to Android M. Any games I have made in the past including ones I am developing currently have a black bar along the bottom of the screen where the soft keys for the OS usually are (with the home, back and multitask buttons).
Here are some examples of what I mean: What it should look like:
What it actually looks like when you first launch it:
The black bar appears the exact same size as the soft keys, however the status bar is disabled in Unity, which should bring the soft keys with it. This black bar IS NOT the OS buttons. The bar has no icons on it and clicking on it does not press the back, home or multitask button.
If I click in the black bar I will interact with whatever button is beneath the black bar in my game. I cannot access the home, back etc. buttons from the black bar without swiping up.
I have had this problem with Android 5.0 too. However it only happened when I pressed the home button, then went back into the game. Now it happens on every launch.
The only way I know how to get rid of the black bar is to open the game, then click the home button, then use multitasking to get back into my game. This causes the app to launch in normal full screen as it should.
As I said, I had a similar problem with Android 5.0, and I never did figure out why it was happening, now that the problem is bad enough to bread the game, I need a fix.
Thank you very much in advance for any help, or comments. :)
If it's a problem that only occurs in the new Android OS (I'm assu$$anonymous$$g $$anonymous$$arshmallow is the latest one? Although I develop for Android using unity I'm an iPhone'r so I'm not up to date with the version names etc... although I did launch a build (an older build, built in unity 5.0 I believe) On a Sony Xperia that had just updated to the latest Android and I did not encounter this problem. I suggest that you update you version of Unity if you are not already up to date, and If the problem remains I suggest that you post a bug to Unity giving them the device type.
Sorry I can't be of more help, best of luck to you, I hope that you will find a fix, I'm sure that unity will see this as a unity bug and fix this once they're aware (If they haven't already!)
Beau C
Thanks for the reply. It's 5.1.1f1. I've noticed some other people are having the same issue and nobody seems to have a fix. There is another thread here which is very similar, but his only occurs when opening the keyboard. I also posted on the Unity3D subreddit here.
It can't be affecting everybody or I'm sure there would be more complaints.
Edit: Just noticed there's a Unity 5.2.1 now. I'll update it then get back to you.
I've updated to the latest version and still having the same issue. It's worth mentioning I have also tried using Screen.SetResolution to try to change in and out of fullscreen mode to see if it will figure out the actual height of the screen, but to no avail. Still having the same issue.
We have a bug report which is reproducible on Nexus 5 only, and after some magic applied, but not directly after the app start. The black bar should also disappear after you rotate the device (if you have auto rotate enabled). Can you please submit a bug and attach the repro project?
Submitted a bug with the project attached here. Any idea when this might be fixed?
Thank you! Please stay tuned. Our QAs will check it in upco$$anonymous$$g days, and we'll try to fix it as soon as possible.
I've this problem too. Immersive mode was working fine before update my device to $$anonymous$$arshmallow. Now it shows that bottom black bar. It disappears after $$anonymous$$imize/maximize (using home button and task manager) or after rotating the device. The black bar does not appear on first execution after install apk. It appears the next times that I open the app.
Things like this are normally a manifest problem.
EDit: Ok some SO user says its not done in the manifest. Here's from Google Docs
Immersive full-screen mode
To provide your app with a layout that fills the entire screen, the new SYSTE$$anonymous$$_UI_FLAG_I$$anonymous$$$$anonymous$$ERSIVE flag for setSystemUiVisibility() (when combined with SYSTE$$anonymous$$_UI_FLAG_HIDE_NAVIGATION) enables a new immersive full-screen mode. While immersive full-screen mode is enabled, your activity continues to receive all touch events. The user can reveal the system bars with an inward swipe along the region where the system bars normally appear. This clears the SYSTE$$anonymous$$_UI_FLAG_HIDE_NAVIGATION flag (and the SYSTE$$anonymous$$_UI_FLAG_FULLSCREEN flag, if applied) so the system bars remain visible. However, if you'd like the system bars to hide again after a few moments, you can ins$$anonymous$$d use the SYSTE$$anonymous$$_UI_FLAG_I$$anonymous$$$$anonymous$$ERSIVE_STIC$$anonymous$$Y flag.
This has interesting info
Referring to this guy's code, simply try SYSTE$$anonymous$$_UI_FLAG_I$$anonymous$$$$anonymous$$ERSIVE_STIC$$anonymous$$Y ins$$anonymous$$d of SYSTE$$anonymous$$_UI_FLAG_FULLSCREEN
@meat5000 we do apply everything needed in Unity code. Unfortunately it seems to fail in $$anonymous$$arshmallow :(
Answer by Xephex · Oct 22, 2015 at 03:35 PM
I didn't realize that the bar disappeared when rotating the device.
My make-shift solution:
Set default orientation in player settings to something other than the orientation your using, then in the start function change it to the orientation you actually want using Screen.orientation.
Did you read my last comment? :D
The one directly above this answer.
Immersive full-screen mode
To provide your app with a layout that fills the entire screen, the new SYSTE$$anonymous$$_UI_FLAG_I$$anonymous$$$$anonymous$$ERSIVE flag for setSystemUiVisibility() (when combined with SYSTE$$anonymous$$_UI_FLAG_HIDE_NAVIGATION) enables a new immersive full-screen mode. ETC ETC ETC
It basically shows how to make the bar disappear after a few seconds of inactivity.
Sorry, didn't click show all comments. I'll work on that next. Thanks a lot for the help!
Hello,
I was having the same problem, and i figured out with your answer. You don't have to change orientation in player setting, just write this line in awake function of your first screen.
void Awake()
{
Screen.orientation = ScreenOrientation.Portrait;
}
Set orientation as you want. That way your screen wont flicker and the glitch will be solved too.
Thanks.
Answer by SciGuy2000 · Oct 22, 2015 at 08:23 AM
This is a bug with the OS on the device. I don't think it is a unity problem there.
I don't think so. All my non-unity games are still working fine in immersive mode on my Android 6.0. That bar only appears on my Unity games, maybe some conflict between Unity and OS.
Answer by Raul Onk · Nov 12, 2015 at 04:24 PM
Hey,
I had the same problem on my Nexus 6P Android 6.0
I fixed the problem by adding android:theme="@android:style/Theme.NoTitleBar" in the < manifest /> tag. Make sure it is in the < manifest /> tag.
If you do not have a manifest file, then follow the instructions on this site http://unity3d-book.blogspot.com/2014/02/unity3d-android-manifest-file.html
In the temp/StagingArea there might be two manifest file, just take the manifest-main, rename it and paste to your Plugins/Android folder.
Answer by pertsa · Oct 22, 2015 at 01:13 PM
HI,
I found one solution in this thread:
http://answers.unity3d.com/questions/1067065/problems-with-android-immersive-mode.html
br, pertti
Hello, if you are talking about adding uses-sdk android:targetSdkVersion="21" tag in Android$$anonymous$$anifest.xml it didn't work for me :(. Thanks anyway
Didn't work for me either. (You need to make it a tag with < /> when putting it into your manifest btw) I fixed it by changing screen orientation in the start function. This isn't perfect as you can see it rotate for about half a second at the begining of the game, but it's the best I can think of, if anybody has a better solution I'd be happy to hear it.
Your answer
Follow this Question
Related Questions
Input.touchCount works in one script but not the other 1 Answer
Is there a Unity 5 Bug affecting tags with Android builds? 2 Answers
Keyboard inputs randomly drop in Unity 5.4 2 Answers
Why are my OnTriggerEnter2D events firing only on android in a situation they shouldnt be firing? 0 Answers
Unity 2019.2 lwrp brightness problem 0 Answers