Android Question Firebase auth facebook crash

Yuri Cinesi

Member
Licensed User
I'm trying to use the facebook library to add the possibility to log in via facebook using firebase auth, but as soon as I try to run my application it crashes with the following log:

B4X:
*** Service (starter) Create ***
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/FragmentActivity;
    at com.facebook.internal.Validate.notNull(Validate.java:75)
    at com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:194)
    at com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:174)
    at anywheresoftware.b4x.objects.FacebookSdkWrapper.Initialize(FacebookSdkWrapper.java:57)
    at com.micapp.app.starter._service_create(starter.java:158)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
    at com.micapp.app.starter.onCreate(starter.java:56)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3570)
    at android.app.ActivityThread.access$1300(ActivityThread.java:200)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6718)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.FragmentActivity" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.micapp.app-A-zZATh-kOyzIPSr_8hUIw==/base.apk"],nativeLibraryDirectories=[/data/app/com.micapp.app-A-zZATh-kOyzIPSr_8hUIw==/lib/arm64, /system/lib64, /vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 22 more
java.lang.RuntimeException: Unable to create service com.micapp.app.starter: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/FragmentActivity;
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3582)
    at android.app.ActivityThread.access$1300(ActivityThread.java:200)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6718)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/FragmentActivity;
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:175)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
    at com.micapp.app.starter.onCreate(starter.java:56)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3570)
    ... 8 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/FragmentActivity;
    at com.facebook.internal.Validate.notNull(Validate.java:75)
    at com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:194)
    at com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:174)
    at anywheresoftware.b4x.objects.FacebookSdkWrapper.Initialize(FacebookSdkWrapper.java:57)
    at com.micapp.app.starter._service_create(starter.java:158)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    ... 11 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.FragmentActivity" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.micapp.app-A-zZATh-kOyzIPSr_8hUIw==/base.apk"],nativeLibraryDirectories=[/data/app/com.micapp.app-A-zZATh-kOyzIPSr_8hUIw==/lib/arm64, /system/lib64, /vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 22 more
Based on the fact that the error seems to reference the support library I tried to run the jetifier tool to no avail - it didn't even generate a .androidx version of the library.

Any help is appreciated.
 
Top