arfoundation-samples icon indicating copy to clipboard operation
arfoundation-samples copied to clipboard

Black Screen

Open nems808 opened this issue 8 years ago • 91 comments

Unity 2018.1.5f I have built and ran the demo scene with a cube successfully before. Now, the build is only showing a black screen and the camera permission is never raised when starting the build for the first time. Does anyone have any ideas what might have changed?

Using Pixel XL, ARCore 1.3.180604066

nems808 avatar Jun 18 '18 23:06 nems808

Could you share the logcat output when you run the app? Anything stand out as unusual?

ghost avatar Jun 19 '18 01:06 ghost

I added Mapbox and by accident, I added their ARCore package. Removing it solved the problem.

nems808 avatar Jun 19 '18 04:06 nems808

In case anybody's still getting a black screen when opening the app, you have to add a Camera Usage Description in Player settings.

Using iPhone X

kennethlng avatar Jun 30 '18 01:06 kennethlng

I'm getting a black/dark grey screen running the sample as-is on Android also. The app got past the Unity splash screen but did not ask for Camera permission.

Unity 2018.2.0f2 ARCore XR Plugin 1.0.0-preview.17 AR Foundation 1.0.0-preview.13 Pixel 2 XL running Android 8.1 ARCore 1.3.180604066

I get these warnings in my Unity Console, I tried flushing the package cache, reinstalling the packages, but they keep showing up. Possibly related?

2018-07-10 15_56_23-

logcat excerpts :

07-10 15:49:30.883 1502-1579/com.example.arfoundationsample D/Unity: [VFS] Mount /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/base.apk
07-10 15:49:30.889 1502-1502/com.example.arfoundationsample I/TangoClientLibLoader: Pure Java path, not loading libtango_client_api.so at all.
07-10 15:49:30.890 1502-1502/com.example.arfoundationsample E/Tango: Java version of Tango Service not found, falling back to tangoservice_d.
07-10 15:49:30.891 1502-1502/com.example.arfoundationsample E/zygote: No implementation found for int com.google.atap.tango.TangoJNINative.Initialize(android.content.Context) (tried Java_com_google_atap_tango_TangoJNINative_Initialize and Java_com_google_atap_tango_TangoJNINative_Initialize__Landroid_content_Context_2)
07-10 15:49:30.891 1502-1502/com.example.arfoundationsample E/Unity: Error trying to call delegated method resume. null

07-10 15:49:30.995 1502-1579/com.example.arfoundationsample D/Unity: Unable to lookup library path for 'unitygar', native render plugin support disabled.
07-10 15:49:30.996 1502-1579/com.example.arfoundationsample E/Unity: Unable to find unitygar

07-10 15:49:33.732 1502-1579/com.example.arfoundationsample A/tango: jni_helper.cc:19 'vm' Must be non NULL
07-10 15:49:33.732 1502-1579/com.example.arfoundationsample E/CRASH: signal 6 (SIGABRT), code -6 (?), fault addr --------
    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Build fingerprint: 'google/taimen/taimen:8.1.0/OPM2.171026.006.C1/4769658:user/release-keys'
    Revision: 'rev_10'
    pid: 1502, tid: 1579, name: UnityMain  >>> com.example.arfoundationsample <<<
        r0 00000000  r1 0000062b  r2 00000006  r3 00000008
        r4 000005de  r5 0000062b  r6 cc3fd59c  r7 0000010c
        r8 00000000  r9 cc3fd9f4  sl 0000018d  fp 00000000
        ip 00000000  sp cc3fd588  lr e7dfbc89  pc e7df5772  cpsr cc3fd218
    backtrace:
07-10 15:49:33.736 1502-1635/com.example.arfoundationsample D/NetworkSecurityConfig: No Network Security Config specified, using platform default
07-10 15:49:33.855 1502-1579/com.example.arfoundationsample E/CRASH: 	#00  pc 0001a772  /system/lib/libc.so (abort+63)
    	#01  pc 0000655d  /system/lib/liblog.so (__android_log_assert+156)
    	#02  pc 00009d1d  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libtango_client_api2.so
    	#03  il ........  at (wrapper managed-to-native) UnityEngine.XR.Tango.TangoInputTracking.Internal_TryGetPoseAtTime (double,UnityEngine.ScreenOrientation,UnityEngine.XR.Tango.CoordinateFrame,UnityEngine.XR.Tango.CoordinateFrame,UnityEngine.XR.Tango.PoseData&) <IL 0x00026, 0xffffffff>
    	#04  il 00000064  at UnityEngine.XR.Tango.TangoInputTracking.TryGetPoseAtTime (UnityEngine.XR.Tango.PoseData&,UnityEngine.XR.Tango.CoordinateFrame,UnityEngine.XR.Tango.CoordinateFrame,double) [0x00015] in /Users/builduser/buildslave/unity/build/Runtime/AR/Tango/ScriptBindings/Tango.bindings.cs:306
    	#05  il 00000053  at UnityEngine.SpatialTracking.PoseDataSource.TryGetTangoPose (UnityEngine.XR.Tango.CoordinateFrame,UnityEngine.Pose&) [0x00012] in C:\buildslave\unity\build\Extensions\UnitySpatialTracking\Runtime\TrackedPoseDriver.cs:149
    	#06  il 000000fb  at UnityEngine.SpatialTracking.PoseDataSource.TryGetDataFromSource (UnityEngine.SpatialTracking.TrackedPoseDriver/TrackedPose,UnityEngine.Pose&) [0x0009d] in C:\buildslave\unity\build\Extensions\UnitySpatialTracking\Runtime\TrackedPoseDriver.cs:122
    	#07  il 00000067  at UnityEngine.SpatialTracking.TrackedPoseDriver.TryGetPoseData (UnityEngine.SpatialTracking.TrackedPoseDriver/DeviceType,UnityEngine.SpatialTracking.TrackedPoseDriver/TrackedPose,UnityEngine.Pose&) [0x00027] in C:\buildslave\unity\build\Extensions\UnitySpatialTracking\Runtime\TrackedPoseDriver.cs:248
07-10 15:49:33.856 1502-1579/com.example.arfoundationsample E/CRASH: 	#08  il 0000006f  at UnityEngine.SpatialTracking.TrackedPoseDriver.PerformUpdate () [0x0002e] in C:\buildslave\unity\build\Extensions\UnitySpatialTracking\Runtime\TrackedPoseDriver.cs:412
    	#09  il 0000003b  at UnityEngine.SpatialTracking.TrackedPoseDriver.FixedUpdate () [0x0001a] in C:\buildslave\unity\build\Extensions\UnitySpatialTracking\Runtime\TrackedPoseDriver.cs:351
    	#10  il 0000006b  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <IL 0x0001c, 0x0006b>
07-10 15:49:33.859 1502-1579/com.example.arfoundationsample E/CRASH: 	#00  pc 000225d3  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libmono.so
    	#01  pc 001f7bb8  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libmono.so (mono_runtime_invoke+136)
    	#02  pc 00fb72c4  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libunity.so (ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)+84)
    	#03  pc 00dc5278  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libunity.so (MonoBehaviour::CallUpdateMethod(int)+284)
    	#04  pc 00a316f8  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libunity.so (void BaseBehaviourManager::CommonUpdate<FixedBehaviourManager>()+68)
    	#05  pc 00a316a0  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libunity.so (FixedBehaviourManager::Update()+32)
    	#06  pc 00d9a368  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libunity.so (InitPlayerLoopCallbacks()::FixedUpdateScriptRunBehaviourFixedUpdateRegistrator::Forward()+72)
    	#07  pc 00d9b0a4  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libunity.so (ExecutePlayerLoop(NativePlayerLoopSystem*)+96)
    	#08  pc 00d9b0f4  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libunity.so (ExecutePlayerLoop(NativePlayerLoopSystem*)+176)
    	#09  pc 00d9b29c  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libunity.so (PlayerLoop()+284)
    	#10  pc 0061b1f0  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libunity.so (UnityPlayerLoop()+572)
    	#11  pc 0061e934  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/lib/arm/libunity.so (nativeRender(_JNIEnv*, _jobject*)+52)
    	#12  pc 0000836b  /data/app/com.example.arfoundationsample-3vYJGZ261B_PNlopl_wfqg==/oat/arm/base.odex (oatexec+17259)
    code around pc:
        e7df5750 21064630 f82ef062 46312002 f04f2200  0F.!b.... 1F."O.
        e7df5760 f0620800 4620f82f 22064629 7786f44f  ..b./. F)F."O..w
        e7df5770 f04fdf00 90035080 8004f8cd 1d38af01  ..O..P........8.
        e7df5780 f828f062 46392006 f062463a 2002f82b  b.(.. 9F:Fb.+.. 
        e7df5790 22004631 f816f062 46294620 f44f2206  1F."b... F)F."O.
        e7df57a0 df007786 f062207f 2300f825 b82af062  .w... b.%..#b.*.
        e7df57b0 c008f8df f8dc44fc 4760c000 00077988  .....D....`G.y..
        e7df57c0 4601460a 0063f06f f0622300 0000b823  .F.Fo.c..#b.#...
        e7df57d0 b082b580 4479490c 68096809 46699101  .....IyD.h.h..iF
        e7df57e0 f820f062 48092800 44789900 f04fbf08  b. ..(.H..xD..O.
        e7df57f0 680031ff 9a016800 d1021a80 b002ba08  .1.h.h..........
        e7df5800 f061bd80 bf00fe37 00076bfa 00076be6  ..a.7....k...k..
        e7df5810 b082b580 4479490c 68096809 46699101  .....IyD.h.h..iF
        e7df5820 f800f062 98004601 49082900 f04fbf08  b....F...).I..O.
        e7df5830 447930ff 68096809 1a899a01 b002d101  .0yD.h.h........
        e7df5840 f061bd80 bf00fe17 00076bba 00076b9e  ..a......k...k..
    code around lr:
        e7dfbc68 29002200 2202e9cd 6809d003 a9029102  .".)..."...h....
07-10 15:49:33.860 1502-1579/com.example.arfoundationsample E/CRASH:     e7dfbc78 2100e000 2200e9cd 2308466a fa86f05c  ...!..."jF.#\...
        e7dfbc88 d0043001 9800b10c 20006020 f04fe001  .0...... `. ..O.
        e7dfbc98 490630ff 68094479 9a056809 d1011a89  .0.IyD.h.h......
        e7dfbca8 bd10b006 fbe2f05b 00070770 00070734  ....[...p...4...
        e7dfbcb8 b0a1b5f0 48134606 460d466f 4614217c  .....F.HoF.F|!.F
        e7dfbcc8 68004478 90206800 f05c1d38 f04ffc27  xD.h.h .8.\.'.O.
        e7dfbcd8 900230ff f05b9500 9003fde9 f946f05c  .0....[.....\.F.
        e7dfbce8 0404e9cd 46294630 f05c463a 4906fc1f  ....0F)F:F\....I
        e7dfbcf8 68094479 9a206809 d1011a89 bdf0b021  yD.h.h .....!...
        e7dfbd08 fbb4f05b 00070708 000706d8 b082b510  [...............
        e7dfbd18 48114604 68004478 90016800 f05b4668  .F.HxD.h.h..hF[.
        e7dfbd28 3001fd55 4668d00b f05c4621 3001fa97  U..0..hF!F\....0
        e7dfbd38 4669d005 22002001 fd40f05b f04fe001  ..iF. ."[[email protected].
        e7dfbd48 490630ff 68094479 9a016809 d1011a89  .0.IyD.h.h......
        e7dfbd58 bd10b002 fb8af05b 000706b4 00070684  ....[...........
07-10 15:49:33.862 1502-1579/com.example.arfoundationsample E/MessageQueue: IdleHandler threw exception
    java.lang.Error: signal 6 (SIGABRT), code -6 (?), fault addr --------
    Build fingerprint: 'google/taimen/taimen:8.1.0/OPM2.171026.006.C1/4769658:user/release-keys'
    Revision: 'rev_10'
    pid: 1502, tid: 1579, name: UnityMain  >>> com.example.arfoundationsample <<<
        r0 00000000  r1 0000062b  r2 00000006  r3 00000008
        r4 000005de  r5 0000062b  r6 cc3fd59c  r7 0000010c
        r8 00000000  r9 cc3fd9f4  sl 0000018d  fp 00000000
        ip 00000000  sp cc3fd588  lr e7dfbc89  pc e7df5772  cpsr cc3fd218
    
        at libc.abort(abort:63)
        at liblog.__android_log_assert(__android_log_assert:156)
        at libtango_client_api2.00009d1d(Native Method)
        at TangoInputTracking.Internal_TryGetPoseAtTime(Native Method)
        at TangoInputTracking.TryGetPoseAtTime(Tango.bindings.cs:306)
        at PoseDataSource.TryGetTangoPose(TrackedPoseDriver.cs:149)
        at PoseDataSource.TryGetDataFromSource(TrackedPoseDriver.cs:122)
        at TrackedPoseDriver.TryGetPoseData(TrackedPoseDriver.cs:248)
        at TrackedPoseDriver.PerformUpdate(TrackedPoseDriver.cs:412)
        at TrackedPoseDriver.FixedUpdate(TrackedPoseDriver.cs:351)
        at Object.runtime_invoke_void__this__(Native Method)
        at libmono.000225d3(Native Method)
        at libmono.mono_runtime_invoke(mono_runtime_invoke:136)
        at libunity.ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)(Invoke:84)
        at libunity.MonoBehaviour::CallUpdateMethod(int)(CallUpdateMethod:284)
        at libunity.void BaseBehaviourManager::CommonUpdate<FixedBehaviourManager>()(CommonUpdate:68)
        at libunity.FixedBehaviourManager::Update()(Update:32)
        at libunity.InitPlayerLoopCallbacks()::FixedUpdateScriptRunBehaviourFixedUpdateRegistrator::Forward()(InitPlayerLoopCallbacks:72)
        at libunity.ExecutePlayerLoop(NativePlayerLoopSystem*)(ExecutePlayerLoop:96)
        at libunity.ExecutePlayerLoop(NativePlayerLoopSystem*)(ExecutePlayerLoop:176)
        at libunity.PlayerLoop()(PlayerLoop:284)
        at libunity.UnityPlayerLoop()(UnityPlayerLoop:572)
        at libunity.nativeRender(_JNIEnv*, _jobject*)(nativeRender:52)
        at base.oatexec(oatexec:17259)```

renaudbedard avatar Jul 10 '18 19:07 renaudbedard

I'm gonna guess it's the same issue. Did you try adding a Camera Usage Description? It's required when building out of Xcode (iOS) and I'm assuming it's the same case for Android.

Edit > Project Settings > Player > Other Settings > Camera Usage Description.

You can write in any random text.

kennethlng avatar Jul 10 '18 20:07 kennethlng

I figured it was the case, but no there is no Camera Usage Description field in the Player settings when building for Android.

renaudbedard avatar Jul 10 '18 20:07 renaudbedard

Hi Renaud,

ARCore 1.3.180604066

Does that mean you are also using Google's ARCore plugin for Unity? "ARCore XR Plugin 1.0.0-preview.17" replaces (and is not compatible with) Google's plugin.

ghost avatar Jul 10 '18 21:07 ghost

I am not, I just cloned the GitHub repository, ticked the "ARCore Supported" box in the XR Settings, added my ARCoreSettings for good measure, changed the app bundle ID and deployed. The ARCore version I noted here is the redistributable that's installed on the phone (from the Play Store).

renaudbedard avatar Jul 10 '18 21:07 renaudbedard

ticked the "ARCore Supported" box in the XR Settings

You should not tick this box (it's confusing, I know). In fact, there's a pre build verification step that shouldn't even let you deploy if you have checked this box -- not sure why it didn't get triggered. Try unchecking the box and see if that works for you.

ghost avatar Jul 10 '18 21:07 ghost

That was the problem! Thanks for the heads-up. There definitely wasn't anything blocking me from deploying with that setting checked though.

renaudbedard avatar Jul 10 '18 21:07 renaudbedard

The reason it doesn't stop you from deploying is due to a change in 2018.2 (the name of the "ARCore Supported" checkbox changed, so the code that checks whether it is ticked doesn't catch it). That will be fixed in the next ARCore XR Plugin update.

ghost avatar Jul 11 '18 04:07 ghost

I'm having the same issue when building for iOS even though I did set the Camera Usage Description and Requires ARKit Support

image

albertoxamin avatar Jul 27 '18 14:07 albertoxamin

@albertoxamin Is this a new project or a clone of this samples repo? What device and Xcode version are you using?

ghost avatar Jul 27 '18 16:07 ghost

@timj-unity If I clone the repo the Camera Request appears but if I import it through the new package manager or if I simply drag and drop the files into an existing project the issue appears. I am using Xcode 10 build 10L176w

albertoxamin avatar Jul 28 '18 09:07 albertoxamin

When you say "drag and drop the files", do you mean you are only copying the assets folder? ARFoundation is delivered as a package, so you would also need to copy the Packages folder (specifically the manifest.json) or open the package manager window in your new project and install ARFoundation and ARKit. (Window > Package Manager)

ghost avatar Jul 28 '18 16:07 ghost

image I did install it through the package manager but I copied the assets to access the sample scene in an existing project

albertoxamin avatar Jul 28 '18 17:07 albertoxamin

Your screenshot shows you've only installed ARFoundation but not ARKit support. ARKit should be available from the "All" menu.

ghost avatar Jul 29 '18 18:07 ghost

That did fix it, thanks

albertoxamin avatar Jul 29 '18 19:07 albertoxamin

I am using Unity 2018.2 and Samsung S8. I have this exact black screen issue when I run the app. How can I fix this?

TevfikUfuk avatar Jul 31 '18 10:07 TevfikUfuk

I think I found the problem. I build the codes inside PlacedObjectFix brach and it worked. But inside this project I updated ARFoundation and ARCore. Then I got a building error saying that:

BuildFailedException: ARCore XR Plugin does not support x86. See Player Settings > Other Settings > Target Architectures.

UnityEditor.XR.ARCore.ARCorePreprocessBuild.EnsureTargetArchitecturesAreSupported () (at C:/Users/tevfik_demirbas/AppData/Local/Unity/cache/packages/packages.unity.com/[email protected]/Editor/ARCoreBuildProcessor.cs:34) UnityEditor.XR.ARCore.ARCorePreprocessBuild.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at C:/Users/tevfik_demirbas/AppData/Local/Unity/cache/packages/packages.unity.com/[email protected]/Editor/ARCoreBuildProcessor.cs:25) UnityEditor.Build.BuildPipelineInterfaces+c__AnonStorey0.<>m__1 (IPreprocessBuildWithReport bpp) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:376) UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[IPreprocessBuild,IPreprocessBuildWithReport] (System.Collections.Generic.List1 oneInterfaces, System.Action1 invocationOne, System.Collections.Generic.List1 twoInterfaces, System.Action1 invocationTwo, Boolean exitOnFailure) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:356) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()###

Then, I unchecked x86 in Player Settings. After I build, black screen issue showed up again.

TevfikUfuk avatar Jul 31 '18 13:07 TevfikUfuk