google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

E/ARCore-AuthenticationManager: Exception during AuthenticationManager construction: com.google.android.gms.common.GoogleApiAvailability java.lang.ClassNotFoundException: com.google.android.gms.common.GoogleApiAvailability #935

Open leonsaber opened 5 years ago

leonsaber commented 5 years ago

I use the 1.13.0 Sceneform, when I get the context session I got error

E/ARCore-AuthenticationManager: Exception during AuthenticationManager construction: com.google.android.gms.common.GoogleApiAvailability java.lang.ClassNotFoundException: com.google.android.gms.common.GoogleApiAvailability

georgevaranosPM commented 5 years ago

+1 Same here!

jshiwam commented 5 years ago

+1 same Problem

NolanOfficial commented 5 years ago

same

iaoiui commented 4 years ago

+1

vsavdeev commented 4 years ago

+1

bogdanovkp commented 4 years ago

+1

suraj-0387 commented 4 years ago

facing same issue

fxvn78 commented 4 years ago

getting this on startup in OnResume session = new Session(/ context= / this);

Is this an API readiness issues or gradle config problem?

protected void onResume()
{
    super.onResume();

    if (session == null)
    {
        Exception exception = null;
        String message = null;
        try
        {
            switch (ArCoreApk.getInstance().requestInstall(this, !installRequested))
            {
                case INSTALL_REQUESTED:
                    installRequested = true;
                    return;
                case INSTALLED:
                    break;
            }

            // ARCore requires camera permissions to operate. If we did not yet obtain runtime
            // permission on Android M and above, now is a good time to ask the user for it.
            if (!CameraPermissionHelper.hasCameraPermission(this))
            {
                CameraPermissionHelper.requestCameraPermission(this);
                return;
            }

            // Create the session.
            session = new Session(/* context= */ this);

        } catch (UnavailableArcoreNotInstalledException
                | UnavailableUserDeclinedInstallationException e)
        {
            message = "Please install ARCore";
            exception = e;
        } catch (UnavailableApkTooOldException e)
        {
            message = "Please update ARCore";
            exception = e;
        } catch (UnavailableSdkTooOldException e)
        {
            message = "Please update this app";
            exception = e;
        } catch (UnavailableDeviceNotCompatibleException e)
        {
            message = "This device does not support AR";
            exception = e;
        } catch (Exception e)
        {
            message = "Failed to create AR session";
            exception = e;
        }
suraj-0387 commented 4 years ago

It is caused because of session object.As it requires the dependency.My issue got resolved when I added following dependency in app gradle com.google.android.gms:play-services-auth:17.0.0

fxvn78 commented 4 years ago

When I put that in I get conflict with Android X

the following is gradle dependency and error message after I sync. Is there something else I need to change?

dependencies {

implementation 'com.google.android.gms:play-services-auth:17.0.0'  // added this
// ARCore library
implementation 'com.google.ar:core:1.14.0'
implementation 'javax.vecmath:vecmath:1.5.2'

implementation 'de.javagl:obj:0.2.1'

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.opencsv:opencsv:5.0'

}

error message follows ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.1.0] AndroidManifest.xml:24:18-86 is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:30:3-54:17 to override.

nobuyuki-online commented 4 years ago

anyone got it wok

When I put that in I get conflict with Android X

the following is gradle dependency and error message after I sync. Is there something else I need to change?

dependencies {

implementation 'com.google.android.gms:play-services-auth:17.0.0'  // added this
// ARCore library
implementation 'com.google.ar:core:1.14.0'
implementation 'javax.vecmath:vecmath:1.5.2'

implementation 'de.javagl:obj:0.2.1'

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.opencsv:opencsv:5.0'

}

error message follows ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.1.0] AndroidManifest.xml:24:18-86 is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:30:3-54:17 to override.

same issue

TheCroid commented 4 years ago

Also detected problem with session

E/ARCore-LocationProvider: Exception during FLP api client construction: com.google.android.gms.location.LocationRequest

GianUPN commented 4 years ago

Had the same issue, solution right here on the project gradle:

buildscript { repositories { google() jcenter() mavenLocal() } dependencies { classpath 'com.android.tools.build:gradle:3.4.2' classpath 'com.google.ar.sceneform:plugin:1.15.0' // classpath 'com.google.ar.sceneform:plugin:1.13.0' old one >:v } }

tellypresence commented 4 years ago

Still happening w/SceneForm v1.16.0

E/ARCore-LocationProvider: Exception during FLP api client construction:
    com.google.android.gms.location.LocationRequest
        java.lang.ClassNotFoundException: 
            com.google.android.gms.location.LocationRequest
                at java.lang.Class.classForName(Native Method)
balarayen commented 4 years ago

with SceneForm v1.16.0, the error goes away after adding location dependency

implementation 'com.google.android.gms:play-services-location:16.0.0'

Still happening w/SceneForm v1.16.0

E/ARCore-LocationProvider: Exception during FLP api client construction:
    com.google.android.gms.location.LocationRequest
        java.lang.ClassNotFoundException: 
            com.google.android.gms.location.LocationRequest
                at java.lang.Class.classForName(Native Method)
MrCsabaToth commented 4 years ago

with SceneForm v1.16.0, the error goes away after adding location dependency

implementation 'com.google.android.gms:play-services-location:16.0.0'

Theoretically AR functionality only needs camera permission. As soon as we include LocationServices, would I need to obtain an API key? Where will this lead to?

MrCsabaToth commented 4 years ago

More verbose call stacks:

I/native: session_create_implementation_shared.cc:1837 Persistent online recalibration is enabled by Phenotype.
I/native: online_calibration_manager.cc:54 OnlineCalibrationManager: Could not open /data/user/0/com.valleydevfest.armap/cache/arcore-online-recalibration for reading.
E/ARCore-LocationProvider: Exception during FLP api client construction: com.google.android.gms.common.api.GoogleApiClient
    java.lang.ClassNotFoundException: com.google.android.gms.common.api.GoogleApiClient
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:454)
        at com.google.ar.core.services.LocationProvider.loadClass(PG:74)
        at com.google.ar.core.services.LocationProvider.<init>(PG:11)
        at com.google.ar.core.Session.nativeCreateSessionAndWrapperWithFeatures(Native Method)
        at com.google.ar.core.Session.<init>(Session.java:14)
        at com.google.ar.sceneform.ux.BaseArFragment.createSessionWithFeatures(BaseArFragment.java:419)
        at com.google.ar.sceneform.ux.BaseArFragment.createSession(BaseArFragment.java:405)
        at com.google.ar.sceneform.ux.BaseArFragment.initializeSession(BaseArFragment.java:379)
        at com.google.ar.sceneform.ux.BaseArFragment.onResume(BaseArFragment.java:338)
        at androidx.fragment.app.Fragment.performResume(Fragment.java:2649)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:922)
        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
        at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2659)
        at androidx.fragment.app.FragmentManagerImpl.dispatchResume(FragmentManagerImpl.java:2625)
        at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:268)
        at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:479)
        at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:468)
        at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:195)
        at android.app.Activity.performResume(Activity.java:7977)
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4312)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4354)
        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:2109)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7682)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.GoogleApiClient" on path: DexPathList[[zip file "/data/app/com.valleydevfest.armap-e_o2lrqqcAaeuBHSQ-zfVQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.valleydevfest.armap-e_o2lrqqcAaeuBHSQ-zfVQ==/lib/arm64, /data/app/com.valleydevfest.armap-e_o2lrqqcAaeuBHSQ-zfVQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at java.lang.Class.classForName(Native Method) 
        at java.lang.Class.forName(Class.java:454) 
        at com.google.ar.core.services.LocationProvider.loadClass(PG:74) 
        at com.google.ar.core.services.LocationProvider.<init>(PG:11) 
        at com.google.ar.core.Session.nativeCreateSessionAndWrapperWithFeatures(Native Method) 
        at com.google.ar.core.Session.<init>(Session.java:14) 
        at com.google.ar.sceneform.ux.BaseArFragment.createSessionWithFeatures(BaseArFragment.java:419) 
        at com.google.ar.sceneform.ux.BaseArFragment.createSession(BaseArFragment.java:405) 
        at com.google.ar.sceneform.ux.BaseArFragment.initializeSession(BaseArFragment.java:379) 
        at com.google.ar.sceneform.ux.BaseArFragment.onResume(BaseArFragment.java:338) 
        at androidx.fragment.app.Fragment.performResume(Fragment.java:2649) 
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:922) 
        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238) 
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303) 
        at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2659) 
        at androidx.fragment.app.FragmentManagerImpl.dispatchResume(FragmentManagerImpl.java:2625) 
        at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:268) 
        at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:479) 
        at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:468) 
        at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:195) 
        at android.app.Activity.performResume(Activity.java:7977) 
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4312) 
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4354) 
        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:2109) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7682) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 
E/ARCore-LocationProvider: Can't find FLP class: com.google.android.gms.location.LocationServices
    java.lang.ClassNotFoundException: com.google.android.gms.location.LocationServices
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:454)
        at com.google.ar.core.services.LocationProvider.loadClass(PG:74)
        at com.google.ar.core.services.LocationProvider.isLocationLibraryLinked(PG:60)
        at com.google.ar.core.Session.nativeCreateSessionAndWrapperWithFeatures(Native Method)
        at com.google.ar.core.Session.<init>(Session.java:14)
        at com.google.ar.sceneform.ux.BaseArFragment.createSessionWithFeatures(BaseArFragment.java:419)
        at com.google.ar.sceneform.ux.BaseArFragment.createSession(BaseArFragment.java:405)
        at com.google.ar.sceneform.ux.BaseArFragment.initializeSession(BaseArFragment.java:379)
        at com.google.ar.sceneform.ux.BaseArFragment.onResume(BaseArFragment.java:338)
        at androidx.fragment.app.Fragment.performResume(Fragment.java:2649)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:922)
        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
        at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2659)
        at androidx.fragment.app.FragmentManagerImpl.dispatchResume(FragmentManagerImpl.java:2625)
        at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:268)
        at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:479)
        at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:468)
        at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:195)
        at android.app.Activity.performResume(Activity.java:7977)
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4312)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4354)
        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:2109)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7682)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.location.LocationServices" on path: DexPathList[[zip file "/data/app/com.valleydevfest.armap-e_o2lrqqcAaeuBHSQ-zfVQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.valleydevfest.armap-e_o2lrqqcAaeuBHSQ-zfVQ==/lib/arm64, /data/app/com.valleydevfest.armap-e_o2lrqqcAaeuBHSQ-zfVQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at java.lang.Class.classForName(Native Method) 
        at java.lang.Class.forName(Class.java:454) 
        at com.google.ar.core.services.LocationProvider.loadClass(PG:74) 
        at com.google.ar.core.services.LocationProvider.isLocationLibraryLinked(PG:60) 
        at com.google.ar.core.Session.nativeCreateSessionAndWrapperWithFeatures(Native Method) 
        at com.google.ar.core.Session.<init>(Session.java:14) 
        at com.google.ar.sceneform.ux.BaseArFragment.createSessionWithFeatures(BaseArFragment.java:419) 
        at com.google.ar.sceneform.ux.BaseArFragment.createSession(BaseArFragment.java:405) 
        at com.google.ar.sceneform.ux.BaseArFragment.initializeSession(BaseArFragment.java:379) 
        at com.google.ar.sceneform.ux.BaseArFragment.onResume(BaseArFragment.java:338) 
        at androidx.fragment.app.Fragment.performResume(Fragment.java:2649) 
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:922) 
        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238) 
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303) 
        at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2659) 
        at androidx.fragment.app.FragmentManagerImpl.dispatchResume(FragmentManagerImpl.java:2625) 
        at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:268) 
        at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:479) 
        at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:468) 
        at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:195) 
        at android.app.Activity.performResume(Activity.java:7977) 
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4312) 
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4354) 
        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:2109) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7682) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 
I/native: feature_provider.cc:86 Doing adaptive frequency feature extraction using KLT.
I/native: session_create_implementation_shared.cc:881 Datasource will be created with timeout = 4s, should_wait = false, should_use_greedy_recovery = true, should_use_cameras_async = true
    android_camera.cc:168 Camera start operation timeout set to 4000 ms.
    android_camera.cc:1816 Initializing camera manager.