Search Issue Tracker

By Design

Votes

0

Found in

5.6.0b11

Issue ID

890045

Regression

Yes

Gradle build with UI elements added inside Android Studio are not drawn

Android

-

Reproduction steps:
1) Create new project
2) Export empty project with Gradle build
-- There are some changes which have to be done to the 'UnityPlayerActivity' class.
-- You can follow steps below or just download ConfiguredGradleBuilds.zip (link to OC cloud) with already configured gradle builds

3) Open exported build with Android Studio
4) Inside 'UnityPlayerActivity' class add:
LayoutInflater inflater = LayoutInflater.from(this);
View layout = inflater.inflate(R.layout.layout_test, mUnityPlayer, false);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
mUnityPlayer.addView(layout, layoutParams);

5) Import these classes (can be added by pressing alt+enter on errors, except 'layout', or manually) on top of a class:
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.view.ViewGroup;
6) Add 'layout_test.xml' to the "BugReport/src/main/res/layout/" folder
7) Deploy application

Actual result: Button appears as soon as game launches and disappears on loading screen (Unity splash screen).
Expected result: Button appears as soon as game launches and stays for whole duration of the game.

Note: Also reproduced with ADT

Regression appeared in 5.6.0b3

Reproduced with:
5.6.0b3, 5.6.0b11, 2017.1.0a4

Unable to reproduce with:
5.5.2p3, 5.6.0b2

DUT:
Samsung Galaxy S6 Edge, Android 6.0.1
Samsung Galaxy S3, Android 4.3
LG G3, Android 5.0

Comments (4)

  1. vourkosa

    Jun 21, 2017 12:42

    You can read more on what actually happened behind the scenes with this issue at the following article https://goo.gl/jMwQ21

  2. zaniocz

    Jun 20, 2017 15:04

    Fixed in 5.6.1p4 (https://unity3d.com/unity/qa/patch-releases/5.6.1p4)
    (916119) - Android: Fixed a regression where Banner Ads are invisible, but still clickable.

  3. Cypras

    May 17, 2017 20:22

    How can we fix this with the banner ads?

  4. plasticYoda

    Apr 24, 2017 23:09

    This also causes banner ad views to be drawn behind the main view.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.