Android Question AppCompat problem

José J. Aguilar

Licensed User
Hi all:

I'm having with the B4XDrawer sample the same issue others have had:
Error occurred on line: 217 (B4XDrawer)
Public Sub getCenterPanel As B4XView
    Return mCenterPanel 'Line 217
End Sub

I've searched the forum and I've found several threads with the same issues, and I've tested with no success the described solutions
- Redownload AppCompact 4, which include the jettified library.
- Re-jettify the libraries
- Delete AppCompat.androidx.aar and jetify again.
- There's no AppCompat library in internal libraries folder.
- Delete from the additional libraries folder and run jetifier again

The funny thing is I'm making a skeleton app reusing the Drawer. I had a couple activities working, and they still works. But yesterday I added another activity, and I get the error just in the new ones.
Main, PartesTrabajo, ChecklistNSN works.
CVEOrange and Test (added later): error.

Attached a small project with the error.


--------- beginning of system
Service started in the background. Trying to start again in foreground mode.
Copying updated assets files (11)
*** Service (starter) Create ***
** Service (starter) Start **
Service started in foreground mode.
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Partes de Trabajo
** Activity (main) Pause, UserClosed = false **
** Activity (partestrabajo) Create, isFirst = true **
Error occurred on line: 228 (B4XDrawer)
java.lang.RuntimeException: java.lang.ClassCastException: com.semi.gest.partestrabajo cannot be cast to
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(
at anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(
at com.semi.gest.drawer._initialize(
at com.semi.gest.partestrabajo._activity_create(
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(
at com.semi.gest.partestrabajo.afterFirstLayout(
at com.semi.gest.partestrabajo.access$000(
at com.semi.gest.partestrabajo$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)
Caused by: java.lang.ClassCastException: com.semi.gest.partestrabajo cannot be cast to
at de.amberhome.objects.appcompat.ACToolBarWrapper.DesignerCreateView(
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(
... 20 more
** Activity (partestrabajo) Resume **

B4A Versión: 9.80
Java Versión: 8
Parseando código. (0.16s)
Building folders structure. (0.25s)
Compilando código. (1.45s)
Compilado códigos de diseños. (0.05s)
Organizando librerías. (0.04s)
(AndroidX SDK)
Generando el fichero R. (1.72s)
Compilando el código del motor de depuración. (11.77s)
Compilando el código Java generado. (14.03s)
Convirtiendo byte code a dex optimizado. (26.14s)
Falló el dexer optimizado. Cambiando al dexer estandard.
Empaquetando ficheros. (8.22s)
Copiando los recursos de librerias (0.42s)
Found 8 resource files.
Firmando ficheros de paquete (clave privada) (12.34s)
ZipAlign file. (0.22s)
Instalando archivo al dispositivo. (7.86s)
Device serial: 520062cdb86cc439
Completado con éxito




  • Test
    37.6 KB · Views: 162