Android Question AppCompat with ToolBar not working (solved)

f0raster0

Well-Known Member
Licensed User
Longtime User
Hi Guys,

I just bought a new laptop last year.. today want to work with this AppCompat, then I download this example:

I think I read in somewhere about configuration of java or so don't remember..
anyway when i try to run the example I got this error:
B4X:
Error occurred on line: 25 (Main)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at b4a.example12.main._activity_create(main.java:385)
    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 b4a.example12.main.afterFirstLayout(main.java:104)
    at b4a.example12.main.access$000(main.java:17)
    at b4a.example12.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7076)
    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:965)
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)
    ... 18 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/widget/Toolbar;
    at java.lang.Class.classForName(Native Method)
    at java.lang.Class.forName(Class.java:453)
    at java.lang.Class.forName(Class.java:378)
    at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:624)
    at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:611)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:366)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)


****
I'm using B4A 9.5 at the moment testing with Smartphone Android 9
C:\java\jdk-11.0.1\jdk-11.0.1\bin\javac.exe
C:\Android\platforms\android-28\android.jar

Edit: I found the tutorial..
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
I'm using B4A 9.5 at the moment testing with Smartphone Android 9
C:\java\jdk-11.0.1\jdk-11.0.1\bin\javac.exe
C:\Android\platforms\android-28\android.jar
no reason to use 9.5. Update to 9.8; it is free

Follow the installation instructions.


It will just work.
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
no reason to use 9.5. Update to 9.8; it is free
it's not important if is free or no.
Sometime is better to keep the version that is working and update later when we have extra free time (just in case)

I think I can solve it following the tutorial.

Anyway, thanks @DonManfred :)

Look like I have to do that:
 
Last edited:
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
Note: 9.8 doesn't solve the problem with that example..

Solution:
 
Last edited:
Upvote 0
Top