Android Question CRASH using AppCompat object

Mike1970

Well-Known Member
Licensed User
Longtime User
Hi everyone, i recently opened up a project that i stopped some time ago, before all the updates.
In the project i used AppCompat Checkboxes and switches and as soon as the layout loads up the app crashes.

I tried to remove the checkboxes, switches ans library, and it doens't crash anymore.
someone has solutions?



B4X:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
    at pandora.onstage.settings$ResumableSub_Activity_Create.resume(settings.java:487)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
    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:351)
    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.raiseEvent2(BA.java:180)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
    at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1705)
    at android.os.Handler.handleCallback(Handler.java:815)
    at android.os.Handler.dispatchMessage(Handler.java:104)
    at android.os.Looper.loop(Looper.java:207)
    at android.app.ActivityThread.main(ActivityThread.java:6020)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:936)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:797)
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 20 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/widget/SwitchCompat;
    at de.amberhome.objects.appcompat.ACSwitchCompatWrapper.innerInitialize(ACSwitchCompatWrapper.java:49)
    at anywheresoftware.b4a.objects.ViewWrapper.Initialize(ViewWrapper.java:67)
    at de.amberhome.objects.appcompat.ACSwitchCompatWrapper.Initialize(ACSwitchCompatWrapper.java:38)
    at de.amberhome.objects.appcompat.ACSwitchCompatWrapper._initialize(ACSwitchCompatWrapper.java:139)
    ... 23 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.SwitchCompat" on path: DexPathList[[zip file "/data/app/pandora.onstage-2/base.apk"],nativeLibraryDirectories=[/data/app/pandora.onstage-2/lib/arm64, /vendor/lib64, /system/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    ... 27 more
    Suppressed: java.lang.ClassNotFoundException: android.support.v7.widget.SwitchCompat
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 28 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
 

DonManfred

Expert
Licensed User
Longtime User
Just a guess: download appcompat 4.0 again. It also has a AndroidX version included.
 
Upvote 0
Top