google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.98k stars 1.22k forks source link

Hello_AR_C only works with Nexus 5X API 29 emulator #1200

Closed Peggycyggep closed 3 years ago

Peggycyggep commented 3 years ago

SPECIFIC ISSUE ENCOUNTERED

Same project file, Hello_AR_C, I tried several different emulators (Pixel 4 API 27, Pixel 4 API 30, Nexus 5X API 30), but it seems only work on Nexus 5X API 29. Is there a way to make Pixel 4 API 30 and Nexus 5X API 30 emulator working?

VERSIONS USED

STEPS TO REPRODUCE THE ISSUE

  1. download the sample code
  2. open the project file in Android Studio
  3. create emulator Nexus 5X with API 30
  4. click on run
  5. in Android Studio logcat, the following error 2021-02-28 12:29:37.598 6695-6695/com.google.ar.core.examples.c.helloar E/native: session_create_implementation_shared.cc:1994 Unable to obtain device profile from the content provider: NOT_FOUND: Device is not supported. 2021-02-28 12:29:37.598 6695-6695/com.google.ar.core.examples.c.helloar E/native: session_create_implementation_shared.cc:2321 Failed to create calibration config and device profile. 2021-02-28 12:29:37.608 6695-6695/com.google.ar.core.examples.c.helloar E/native: error_policy_util.cc:263 ################ ARCore Native Error ################## BUILD_CHANGELIST:356413513 BUILD_BASELINE_CHANGELIST:353781137 ################### Stack Trace Begin ################ ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation_shared.cc:1998 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/session_create_implementation_shared.cc?g=0&l=1998 ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:334 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/session_create_implementation.cc?g=0&l=334 ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:416 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/session_create_implementation.cc?g=0&l=416 ################### Stack Trace End #################

    ################### Undecorated Trace Begin ################# NOT_FOUND: ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:334

    ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation_shared.cc:1998 [type.googleapis.com/util.ErrorSpacePayload='ArStatusErrorSpace::AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE'] ################### Undecorated Trace End ################# 2021-02-28 12:29:37.608 6695-6695/com.google.ar.core.examples.c.helloar E/hello_ar_example_c: *** CHECK FAILED at ../../../../src/main/cpp/hello_ar_application.cc:102: ArSession_create(env, context, &arsession) == AR_SUCCESS 2021-02-28 12:29:37.608 6695-6695/com.google.ar.core.examples.c.helloar E/hello_ar_example_c: Throw Java exception: Failed to create AR session. 2021-02-28 12:29:37.610 6695-6695/com.google.ar.core.examples.c.helloar E/HelloArActivity: Exception creating session java.lang.RuntimeException: Failed to create AR session. at com.google.ar.core.examples.c.helloar.JniInterface.onResume(Native Method) at com.google.ar.core.examples.c.helloar.HelloArActivity.onResume(HelloArActivity.java:176) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1456) at android.app.Activity.performResume(Activity.java:8135) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4434) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4476) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

WORKAROUNDS (IF ANY)

no

ADDITIONAL COMMENTS

From the debug, it seems like the exception is being thrown in the .\Android\sdk\sources\android-30\java\lang\class.java (line 454), where the exception has the following description:

java.lang.ClassNotFoundException: Didn't find class "android.widget.ViewStub" on path: DexPathList[[zip file "/data/app/U3mJs4bo3hVCwRqal-lAyw==/com.google.ar.core.examples.c.helloar-saxBmpC-K1vhTNGT-Ldriw==/base.apk"],nativeLibraryDirectories=[/data/app/U3mJs4bo3hVCwRqal-lAyw==/com.google.ar.core.examples.c.helloar-saxBmpC-K1vhTNGT-Ldriw==/lib/x86, /data/app/~~U3mJs4bo3hVCwRqal-lAyw==/com.google.ar.core.examples.c.helloar-saxBmpC-K1vhTNGT-Ldriw==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]

I thought it might be missing library, but there seems to have compatibility issue?? But, don't seem getting anywhere.

devbridie commented 3 years ago

Verified-- currently, only the API29 emulators are working due to a problem with rollout.

devbridie commented 3 years ago

This was fixed in 1.24!