• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Xephex · Oct 19, 2015 at 11:45 PM · androidbugupdateissueresolution settings

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: should look like

What it actually looks like when you first launch it: alt text

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. :)

screenshot-working.png (90.4 kB)
screenshot-notworking.png (84.3 kB)
Comment
Add comment · Show 11
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BeauWorlds · Oct 21, 2015 at 06:14 PM 0
Share

If it's a problem that only occurs in the new Android OS (I'm assuming Marshmallow 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

avatar image Xephex BeauWorlds · Oct 21, 2015 at 09:25 PM 0
Share

Yup, Android 6, latest version.

avatar image Yury-Habets ♦♦ · Oct 21, 2015 at 07:58 PM 1
Share

Which Unity version are you using?

avatar image Xephex Yury-Habets ♦♦ · Oct 21, 2015 at 09:24 PM 0
Share

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.

avatar image Xephex Xephex · Oct 21, 2015 at 09:56 PM 0
Share

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.

avatar image Yury-Habets ♦♦ · Oct 22, 2015 at 07:50 AM 1
Share

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?

avatar image Xephex Yury-Habets ♦♦ · Oct 22, 2015 at 03:04 PM 0
Share

Submitted a bug with the project attached here. Any idea when this might be fixed?

avatar image Yury-Habets ♦♦ Xephex · Oct 22, 2015 at 06:15 PM 1
Share

Thank you! Please stay tuned. Our QAs will check it in upcoming days, and we'll try to fix it as soon as possible.

avatar image otronico · Oct 22, 2015 at 11:05 AM 0
Share

I've this problem too. Immersive mode was working fine before update my device to Marshmallow. Now it shows that bottom black bar. It disappears after minimize/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.

avatar image meat5000 ♦ · Oct 22, 2015 at 01:45 PM 1
Share

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 SYSTEM_UI_FLAG_IMMERSIVE flag for setSystemUiVisibility() (when combined with SYSTEM_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 SYSTEM_UI_FLAG_HIDE_NAVIGATION flag (and the SYSTEM_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 instead use the SYSTEM_UI_FLAG_IMMERSIVE_STICKY flag.

This has interesting info

http://developer.android.com/reference/android/view/View.html#SYSTEM_UI_FLAG_IMMERSIVE

Referring to this guy's code, simply try SYSTEM_UI_FLAG_IMMERSIVE_STICKY instead of SYSTEM_UI_FLAG_FULLSCREEN

avatar image Yury-Habets ♦♦ meat5000 ♦ · Oct 22, 2015 at 06:09 PM 0
Share

@meat5000 we do apply everything needed in Unity code. Unfortunately it seems to fail in Marshmallow :(

4 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

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.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meat5000 ♦ · Oct 22, 2015 at 03:39 PM 0
Share

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 SYSTEM_UI_FLAG_IMMERSIVE flag for setSystemUiVisibility() (when combined with SYSTEM_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.

avatar image Xephex meat5000 ♦ · Oct 22, 2015 at 05:06 PM 0
Share

Sorry, didn't click show all comments. I'll work on that next. Thanks a lot for the help!

avatar image faisal007 · Oct 28, 2015 at 10:57 AM 1
Share

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.

avatar image
1

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image otronico · Oct 22, 2015 at 11:07 AM 0
Share

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.

avatar image
1

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image otronico · Oct 22, 2015 at 03:51 PM 0
Share

Hello, if you are talking about adding uses-sdk android:targetSdkVersion="21" tag in AndroidManifest.xml it didn't work for me :(. Thanks anyway

avatar image Xephex otronico · Oct 22, 2015 at 04:36 PM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

47 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is it possible to update an obb file? 1 Answer

AssetBundles don't load to scene on Android device. 3 Answers

Enemy AI not Animating properly and acting strangely.,Enemy AI animations only playing on 1 unit. 0 Answers

HTC Evo 3D and Sensation - Filtering Devices on Android Market 0 Answers

GUI Layout 'Fading' on changing QualitySettings 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges