Android Question B4A V9.00 crashing my app

Scantech

Well-Known Member
Licensed User
Longtime User
v8.80 is working great but v9.00 is causing this

** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error 1
MAP READ
Panel size is unknown. Layout may not be loaded correctly.
MAP READ
Error occurred on line: 3713 (Main)
java.lang.RuntimeException: Object should first be initialized (MaterialIconView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at de.donmanfred.MaterialIconViewWrapper.setColor(MaterialIconViewWrapper.java:115)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
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.debug.Debug.delegate(Debug.java:262)
at scantech.cardiagnosticpro.main._initviewsettings(main.java:4588)
at scantech.cardiagnosticpro.main._activity_create(main.java:1395)
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 scantech.cardiagnosticpro.main.afterFirstLayout(main.java:104)
at scantech.cardiagnosticpro.main.access$000(main.java:17)
at scantech.cardiagnosticpro.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
** Activity (main) Resume **
android.permission.WRITE_EXTERNAL_STORAGE true
android.permission.ACCESS_COARSE_LOCATION true
false, Billing service unavailable on device. (response: 3:Billing Unavailable)
Subscriptions supported: false
*** Service (comserial) Create ***
** Service (comserial) Start **

My material icon is added in the designer? Why does it say i need to initialize.
 

Scantech

Well-Known Member
Licensed User
Longtime User
Something aint right with the new version. im getting all kinds of errors. it is a large project and i think i will mail you the source and hopefully you can get it resolved.

*** Service (starter) Create ***
Using FileProvider? true
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Class not found: de.donmanfred.MaterialIconViewWrapper, trying: scantech.cardiagnosticpro.MaterialIconViewWrapper
** Activity (main) Resume **
*** Service (comserial) Create ***
Error occurred on line: 76 (ComSerial)
java.lang.NumberFormatException: empty String
at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1071)
at java.lang.Double.parseDouble(Double.java:547)
at scantech.cardiagnosticpro.comserial._service_create(comserial.java:3521)
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 scantech.cardiagnosticpro.comserial.onCreate(comserial.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3162)
at android.app.ActivityThread.-wrap5(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1550)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
** Service (comserial) Start **

MaterialIcon 2.0 this
*** Service (starter) Create ***
Using FileProvider? true
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Class not found: de.donmanfred.MaterialIconViewWrapper, trying: scantech.cardiagnosticpro.MaterialIconViewWrapper
Error occurred on line: 4858 (Main)
java.lang.RuntimeException: java.lang.ClassNotFoundException: scantech.cardiagnosticpro.MaterialIconViewWrapper
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
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.debug.Debug.delegate(Debug.java:262)
at scantech.cardiagnosticpro.main._initmenu(main.java:1416)
at scantech.cardiagnosticpro.main._activity_create(main.java:1264)
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 scantech.cardiagnosticpro.main.afterFirstLayout(main.java:104)
at scantech.cardiagnosticpro.main.access$000(main.java:17)
at scantech.cardiagnosticpro.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.ClassNotFoundException: scantech.cardiagnosticpro.MaterialIconViewWrapper
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at java.lang.Class.forName(Class.java:326)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:390)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
... 27 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "scantech.cardiagnosticpro.MaterialIconViewWrapper" on path: DexPathList[[zip file "/data/app/scantech.cardiagnosticpro-2/base.apk"],nativeLibraryDirectories=[/data/app/scantech.cardiagnosticpro-2/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 34 more
Error 1
MAP READ
Panel size is unknown. Layout may not be loaded correctly.
MAP READ
Error 10
** Activity (main) Resume **
android.permission.WRITE_EXTERNAL_STORAGE true
android.permission.ACCESS_COARSE_LOCATION true
*** Service (comserial) Create ***
** Service (comserial) Start **
Error occurred on line: 13897 (Main)
java.lang.RuntimeException: Object should first be initialized (Label).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.TextViewWrapper.setText(TextViewWrapper.java:39)
at scantech.cardiagnosticpro.main._tmrstatusconnection_tick(main.java:7414)
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.objects.Timer$TickTack.run(Timer.java:105)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)


I tried MaterialIcon 1.5 for this
*** Service (starter) Create ***
Using FileProvider? true
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 4858 (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 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.debug.Debug.delegate(Debug.java:262)
at scantech.cardiagnosticpro.main._initmenu(main.java:1416)
at scantech.cardiagnosticpro.main._activity_create(main.java:1264)
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 scantech.cardiagnosticpro.main.afterFirstLayout(main.java:104)
at scantech.cardiagnosticpro.main.access$000(main.java:17)
at scantech.cardiagnosticpro.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
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)
... 27 more
Caused by: java.lang.RuntimeException: Font asset not found materialdesignicons-webfont.ttf
at android.graphics.Typeface.createFromAsset(Typeface.java:206)
at com.github.MaterialIconUtils.getTypeFace(MaterialIconUtils.java:21)
at com.github.MaterialDrawableBuilder.<init>(MaterialDrawableBuilder.java:55)
at com.github.MaterialDrawableBuilder.with(MaterialDrawableBuilder.java:67)
at com.github.MaterialIconView.init(MaterialIconView.java:71)
at com.github.MaterialIconView.<init>(MaterialIconView.java:26)
at de.donmanfred.MaterialIconViewWrapper._initialize(MaterialIconViewWrapper.java:65)
... 30 more
MAP READ
Panel size is unknown. Layout may not be loaded correctly.
MAP READ
** Activity (main) Resume **

Update: My large project will not work with Materialcon 2.0 using B4A 8.80. Material Icon 1.5 works ok with B4A 8.80 but B4A 9.00 will not work. MaterialIcon 1.5 and 2.0 will not work with B4A 9.00.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Update: My large project will not work with Materialcon 2.0 using B4A 8.80. Material Icon 1.5 works ok with B4A 8.80 but B4A 9.00 will not work. MaterialIcon 1.5 and 2.0 will not work with B4A 9.00.
You don't need to use any library to display material icons. Just add a label and set the font to material icons.

I've downloaded MaterialIcons v2: https://www.b4x.com/android/forum/threads/2046-materialicons-in-the-color-you-need.56612/#content
The example works fine here with v9.00 beta #2.
 
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
I have emailed you my project. It only crashes with a very large project. I want to use MaterialIcon for my customlistview. It has more icons that i need. I dont want to rewrite my customlistview. You can reproduce the error with my project.
 
Last edited:
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
Material Icon 1.5 works great in v9.00 release #4. Good Job.

Erel, I sent you an updated CustomListView with material Icon 2.0 Lib. This will crash on Release #4 or any B4A version. Hopefully this is resolved and crashes only with my app.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Erel, I sent you an updated CustomListView with material Icon 2.0 Lib. This will crash on Release #4 or any B4A version. Hopefully this is resolved and crashes only with my app.
This is a different issue which is not related to this thread.

The logs tell you the error:
Starter Create
Starter
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Class not found: de.donmanfred.MaterialIconViewWrapper, trying: scantech.cardiagnosticpro.MaterialIconViewWrapper
Error occurred on line: 4853 (Main)
java.lang.RuntimeException: java.lang.ClassNotFoundException: scantech.cardiagnosticpro.MaterialIconViewWrapper
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at scantech.cardiagnosticpro.main._initmenu(main.java:1421)
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 scantech.cardiagnosticpro.main.afterFirstLayout(main.java:104)
at scantech.cardiagnosticpro.main.access$000(main.java:17)
at scantech.cardiagnosticpro.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:193)
at android.app.ActivityThread.main(ActivityThread.java:6642)
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: scantech.cardiagnosticpro.MaterialIconViewWrapper
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.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:390)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
... 18 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "scantech.cardiagnosticpro.MaterialIconViewWrapper" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/scantech.cardiagnosticpro-qAXwwPrXxTvfqKQ7_-pVEw==/base.apk"],nativeLibraryDirectories=[/data/app/scantech.cardiagnosticpro-qAXwwPrXxTvfqKQ7_-pVEw==/lib/arm64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:126)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 25 more

It happens because the class name is slightly different in MaterialIcons v2.0. You will need to remove the existing MaterialIconView views and add new ones instead.
 
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
You are correct. I removed the MaterialIcon in designer and added a new one and worked ok. Thanks Erel.
 
Upvote 0
Top