google-ar / arcore-unity-extensions

Google ARCore Extensions and Geospatial Creator for Unity's AR Foundation
Other
336 stars 95 forks source link

ErrorEarthNotReady causing black screen #183

Open Ivan1Kot opened 4 months ago

Ivan1Kot commented 4 months ago

Hello,

I'm trying to make a simple geospatial unity project on android but I'm having problems with a black screen. I have suspicions that the cause of the black screen may be EarthState.ErrorEarthNotReady, which does not disappear (screenshot below). image screenshot from android device

if I turn off the ARCoreExtensions component, the black screen disappears.

I traced the code to a call to the external function ExternApi.ArSession_acquireEarth from the SessionAPI class that I found in the ArCoreExtensions files, which, according to the information I found here, should return an earth object, but in my case it returns null. It also says that the function returns null when #AR_GEOSPATIAL_MODE_DISABLED.

image _ExternApi.ArSessionacquireEarth call in SessionAPI class

image _ArSessionacquireEarth method documentation I found

I double checked the GeospatialMode.Enabled state. image ARCoreExtensionsConfig.asset

Also earthManager.IsGeospatialModeSupported(GeospatialMode.Enabled) returns supported state, this is shown in the first screenshot.

My environment: Unity 2021.3.22f1 ARFoundation 4.2.10 ARCore 4.2.10 ARKit 4.2.10 ARCoreExtansions 1.41.0 Cesium 1.7.1

Mi 8 android device (ARCore supported), android version 10.

Any information on this would be very helpful and useful. Thanks.

Ivan1Kot commented 4 months ago

Somehow it worked on POCO X3.

15kingben commented 4 months ago

Do you get the same behavior on the GeospatialSample? https://github.com/google-ar/arcore-unity-extensions/tree/master/Samples~/Geospatial

Ivan1Kot commented 4 months ago

Do you get the same behavior on the GeospatialSample? https://github.com/google-ar/arcore-unity-extensions/tree/master/Samples~/Geospatial

Yes

mrossi-os commented 3 months ago

Hi, same issue here. I'm using:

It works fine initially but after some time AREarthManager.EarthState is always ErrorEarthNotReady. An API key is used for authorization.

P.S: posted this also on https://github.com/google-ar/arcore-unity-extensions/issues/147

swardle commented 2 months ago

One way to get an AREarthManager.EarthState is always ErrorEarthNotReady error with an unchanged sample is with a flaky internet connection.

For me it was a simple problem, I didn't have a sim card for my work phone for testing Geospatial outside and trying to use a building wifi can be tricky. In my case tethering my work phone no sim to my personal phone with a sim card made this work much better.

This does hint that if your network is flaky for other reasons and you can't talk to the VPS server and send your camera data you will see a similar issue.

mrossi-os commented 1 month ago

@swardle thanks but I suppose this is not my problem :( I tried with WiFi and 5G on many different devices, at work and at home, with my old project or a new one (https://github.com/google-ar/codelab-geospatial-creator-places-api). Still no results.

eplesse commented 4 weeks ago

For what is worth, i have been struggling with this for the last 3 days. Closing Unity, erasing "Library" folder, reopening projet within UNITY and rebuilding apk seems to have helped.

My conf:

JooonseoP commented 3 weeks ago

I'm creating an AR Map program, but I'm experiencing the same problem.

Every time I build, sometimes it works and sometimes it doesn't, so I'm trying various ways to solve the problem, but I don't know what the difference is. Does the problem occur when building, or when the program is turned off and on?

If the above method doesn't work, I thought I could clear the build cache and build again, but that wasn't the case. Accurate problem analysis and solution are required. This problem has been bugging me for a week.

My conf:

emremustu commented 2 weeks ago

Hi, I was experiencing the same issue on Unity 2022.3.35f1 and AR Core Extensions 1.44.0. I switched my Unity version to 2021.3.17f and AR Core Extensions to 1.37.0 . I did not switch Cesium version (1.11.0) I guess it doesn't matter. Now my app is working. I know, of course this is not a solution for the problem but if you are not going to use new features you can use these stable versions.