Black screen on Android

+1 vote
asked Sep 19, 2018 by sophour (510 points)
edited Sep 21, 2018 by sophour

Hello!
My app works fine in Unity Editor, but shows black screen, when it is built for android. In android monitor I can see following errors:

09-20 09:51:24.396: W/Unity(25830): (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
09-20 09:51:25.071: W/Unity(25830): FOUND TARGET PATH: jar:file:///data/app/com.sophour.xrnotes-1/base.apk!/assets/testArMarkers/flowers.JPG
09-20 09:51:25.071: W/Unity(25830):  
09-20 09:51:25.071: W/Unity(25830): (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
09-20 09:51:25.083: E/Unity(25830): Require Initialize!
09-20 09:51:25.083: E/Unity(25830):  
09-20 09:51:25.083: E/Unity(25830): (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
09-20 09:51:25.153: W/Unity(25830): FOUND TARGET PATH: jar:file:///data/app/com.sophour.xrnotes-1/base.apk!/assets/testArMarkers/circles.JPG
09-20 09:51:25.153: W/Unity(25830):  
09-20 09:51:25.153: W/Unity(25830): (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
09-20 09:51:25.393: W/Unity(25830): Failed to load target on start
09-20 09:51:25.393: W/Unity(25830):  
09-20 09:51:25.393: W/Unity(25830): (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
09-20 09:51:25.394: W/Unity(25830): Failed to load target on start
09-20 09:51:25.394: W/Unity(25830):  
09-20 09:51:25.394: W/Unity(25830): (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)


I'm struggling to understand what causes this mysterious "Require Initialize!" I suspect it's some part of EasyAR. Can anyone help, please?

Unity 2017.3, Android 4.4, player settings are identical to that of a working AR-app, app key is correct.
UPD: the same on Android 7.1.2 and in Unity 2018.2

UPD2: after numerous tweaks I found out that there's nothing to do with

Require Initialize!

or

E/Unity   (29813): java.net.UnknownHostException: Unable to resolve host "cdp.cloud.unity3d.com": No address associated with hostname

It's  something with Unity 2018.2.0f. It breaks camera prefab on import or something and prevents videoinput from rendering on the screen. The recent errors are:

E/dalvikvm(16112): Could not find class 'java.lang.invoke.MethodHandles$Lookup', referenced from method bitter.jnibridge.JNIBridge$a.<init>
E/dalvikvm(16112): Could not find class 'java.lang.invoke.MethodHandles$Lookup', referenced from method bitter.jnibridge.JNIBridge$a.a
E/        (16112): appName=cn.easyar.samples.unity.targetonthefly, acAppName=/system/bin/surfaceflinger
E/        (16112): 0
E/        (16112): appName=cn.easyar.samples.unity.targetonthefly, acAppName=/system/bin/surfaceflinger
E/        (16112): 0
E/Sensors (  680): new acc setDelay handle(0),ns(1000000) err! go to hwmsen
E/Unity   (16112): (Filename:  Line: 433)

Does anybody know how to solve this?

2 Answers

+1 vote
answered Sep 24, 2018 by albert52 (31,960 points)
selected Sep 26, 2018 by sophour
 
Best answer
First of all, if you use unity2018.2, this error is normal. Because the current version does not support unity2018.2+. A new version will be released in the next two weeks.
commented Sep 26, 2018 by sophour (510 points)
Great news! Thanks!
0 votes
answered Oct 30, 2018 by kenn (4,160 points)

Did you try the samples?

Require Initialize!

is the exact error you should care. Make sure to call EasyAR's initialize before any other EasyAR functions.

------------------

For Unity 2018 Support:

EasyAR SDK 2.3.0/2.2.1 have been released. They are compatible with Unity 2018. You can get it from EasyAR website. You may need to refresh the webpage if you didn't see them.

Additional For MacOS, because Unity 2018 use Metal by default, you may also need to change the settings to use OpenGL Core. Look at Unity title bar and make sure there is OpenGL instead of Metal.

BTW, we are working on a perfect solution in EasyAR SDK 3.0, which will use the most of Unity features instead of a custom renderer. We will make the whole EasyAR Unity Plugin open source.

commented Nov 16, 2018 by sophour (510 points)
Another great news! Looking forward to seeing these updates, you're doing great job, guys! Thanks
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...