google-ar / arcore-android-sdk

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

ARCore not work in emulator. #1066

Closed vladd11 closed 4 years ago

vladd11 commented 4 years ago

SPECIFIC ISSUE ENCOUNTERED

ARCore app not work on Android emulator, but work on physical device

VERSIONS USED

ADDITIONAL COMMENTS

Error: 06-23 17:14:40.067 3949 3949 E native : ################ ARCore Native Error ################## 06-23 17:14:40.067 3949 3949 E native : BUILD_CHANGELIST:309859035 06-23 17:14:40.067 3949 3949 E native : BUILD_BASELINE_CHANGELIST:307322850 06-23 17:14:40.067 3949 3949 E native : ################### Stack Trace Begin ################ 06-23 17:14:40.067 3949 3949 E native : ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:267 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/session_create_implementation.cc?g=0&l=267 06-23 17:14:40.067 3949 3949 E native : ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:337 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/session_create_implementation.cc?g=0&l=337 06-23 17:14:40.067 3949 3949 E native : ################### Stack Trace End ################# 06-23 17:14:40.067 3949 3949 E native : 06-23 17:14:40.070 3949 3949 E StandardArFragment: Error: Failed to create AR session 06-23 17:14:40.070 3949 3949 E StandardArFragment: com.google.ar.core.exceptions.UnavailableException 06-23 17:14:40.070 3949 3949 E StandardArFragment: at com.google.ar.sceneform.ux.BaseArFragment.initializeSession(BaseArFragment.java:391) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at com.google.ar.sceneform.ux.BaseArFragment.onResume(BaseArFragment.java:338) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.Fragment.performResume(Fragment.java:2747) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.FragmentStateManager.resume(FragmentStateManager.java:363) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1197) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1354) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1432) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1495) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2617) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.FragmentManager.dispatchResume(FragmentManager.java:2581) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:269) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:478) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:467) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:195) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at android.app.Activity.performResume(Activity.java:7141) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at android.app.ActivityThread.-wrap11(Unknown Source:0) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at android.os.Handler.dispatchMessage(Handler.java:106) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at android.os.Looper.loop(Looper.java:164) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at android.app.ActivityThread.main(ActivityThread.java:6494) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at java.lang.reflect.Method.invoke(Native Method) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 06-23 17:14:40.070 3949 3949 E StandardArFragment: Caused by: com.google.ar.core.exceptions.FatalException 06-23 17:14:40.070 3949 3949 E StandardArFragment: at java.lang.reflect.Constructor.newInstance0(Native Method) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at java.lang.reflect.Constructor.newInstance(Constructor.java:334) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at com.google.ar.core.Session.throwExceptionFromArStatus(Session.java:102) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at com.google.ar.core.Session.nativeCreateSessionAndWrapperWithFeatures(Native Method) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at com.google.ar.core.Session.<init>(Session.java:14) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at com.google.ar.sceneform.ux.BaseArFragment.createSessionWithFeatures(BaseArFragment.java:419) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at com.google.ar.sceneform.ux.BaseArFragment.createSession(BaseArFragment.java:405) 06-23 17:14:40.070 3949 3949 E StandardArFragment: at com.google.ar.sceneform.ux.BaseArFragment.initializeSession(BaseArFragment.java:379) 06-23 17:14:40.070 3949 3949 E StandardArFragment: ... 25 more

vladd11 commented 4 years ago

Sorry for the distraction. Solution: enable front camera emulation.