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
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
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- UI Overlay Image gets darker on each Camera when multiple Cameras are used
- Assertion failed on expression: 'scriptedImporterClass == SCRIPTING_NULL error when opening the standalone profiler window
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
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
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.
Cypras
May 17, 2017 20:22
How can we fix this with the banner ads?
plasticYoda
Apr 24, 2017 23:09
This also causes banner ad views to be drawn behind the main view.