JohnC Expert Licensed User Longtime User Sep 9, 2024 #1 I just upgrade from B4A 9.01 to 11.5 and for a big project I ran into the following issues. Notes: The app is not a B4Xpages app (and can not be converted due to size) The app is using #AdditionalJar: com.android.support:support-v4 1) Got errors during compile due to libs not being jetified. I jetified them, and still no good. But after exiting the IDE, then rerunning it, the libraries then update and dexed and the app fully compiled. 2) But then the compiled app crashes without any "filtered" error, so I unfiltered it and the error was "java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/arch/core/executor/ArchTaskExecutor;". Added "#AdditionalJar: androidx.arch.core:core-runtime" to project and this error went away. 3) Now I am getting the below filtered error and can not find any hits in the forum: B4X: Copy *** Service (starter) Create *** 19:49:13.567: Starter_Service_Created ** Activity (main) Create, isFirst = true ** 19:49:13.621: Activity_Create main_activity_create (java line: 488) java.lang.NoSuchFieldError: No static field navdrawer_layout of type I in class Lanywheresoftware/b4a/objects/R$layout; or its superclasses (declaration of 'anywheresoftware.b4a.objects.R$layout' appears in base.apk!classes4.dex) at de.amberhome.objects.NavigationDrawerWrapper.Initialize2(NavigationDrawerWrapper.java:74) at com.omnisoft.voiceit.main._activity_create(main.java:488) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213) at com.omnisoft.voiceit.main.afterFirstLayout(main.java:105) at com.omnisoft.voiceit.main.access$000(main.java:17) at com.omnisoft.voiceit.main$WaitForLayout.run(main.java:83) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Any ideas?
I just upgrade from B4A 9.01 to 11.5 and for a big project I ran into the following issues. Notes: The app is not a B4Xpages app (and can not be converted due to size) The app is using #AdditionalJar: com.android.support:support-v4 1) Got errors during compile due to libs not being jetified. I jetified them, and still no good. But after exiting the IDE, then rerunning it, the libraries then update and dexed and the app fully compiled. 2) But then the compiled app crashes without any "filtered" error, so I unfiltered it and the error was "java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/arch/core/executor/ArchTaskExecutor;". Added "#AdditionalJar: androidx.arch.core:core-runtime" to project and this error went away. 3) Now I am getting the below filtered error and can not find any hits in the forum: B4X: Copy *** Service (starter) Create *** 19:49:13.567: Starter_Service_Created ** Activity (main) Create, isFirst = true ** 19:49:13.621: Activity_Create main_activity_create (java line: 488) java.lang.NoSuchFieldError: No static field navdrawer_layout of type I in class Lanywheresoftware/b4a/objects/R$layout; or its superclasses (declaration of 'anywheresoftware.b4a.objects.R$layout' appears in base.apk!classes4.dex) at de.amberhome.objects.NavigationDrawerWrapper.Initialize2(NavigationDrawerWrapper.java:74) at com.omnisoft.voiceit.main._activity_create(main.java:488) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213) at com.omnisoft.voiceit.main.afterFirstLayout(main.java:105) at com.omnisoft.voiceit.main.access$000(main.java:17) at com.omnisoft.voiceit.main$WaitForLayout.run(main.java:83) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Any ideas?
drgottjr Expert Licensed User Longtime User Sep 9, 2024 #2 did you see this: AHNavigationDrawer - Native Google Navigation Drawer This is a wrapper library for the native NavigationDrawer introduced by Google at Google I/O 2013. It contains two objects: AHNavigationDrawer - This implements the Navigation Drawer SlideDrawable - This is a special type of drawable used to create an indicator for the NavigationDrawer... www.b4x.com this looks like a pretty old library (not that that helps your cause). the author is still active on the forum. maybe he has a thought. Upvote 0
did you see this: AHNavigationDrawer - Native Google Navigation Drawer This is a wrapper library for the native NavigationDrawer introduced by Google at Google I/O 2013. It contains two objects: AHNavigationDrawer - This implements the Navigation Drawer SlideDrawable - This is a special type of drawable used to create an indicator for the NavigationDrawer... www.b4x.com this looks like a pretty old library (not that that helps your cause). the author is still active on the forum. maybe he has a thought.
JohnC Expert Licensed User Longtime User Sep 9, 2024 #3 OK, I shortened my search phrase and found these threads: DSNavigationDrawer and B4A 10.7 Beta 3 error I use the DSNavigationDrawer from from DesignSupport lib. It works fine in B4A 10.6, but I get this error when I tried to compile in B4A 10.7 Beta 3: main$ResumableSub_Activity_Createresume (java line: 604) java.lang.NoSuchFieldError: No field navdrawer_layout of type I in class... www.b4x.com DesignSupport - Additional Material Design components This library is a wrapper to some of the objects of Googles Design Support library. Requirements: This library requires B4A 6.31 or above. From V2.32 on B4A V6.80 or newer is required. If you use an older B4A version use the V2.31 library. AppCompat 3.30 or above is required. The examples need... www.b4x.com This stinks because it was SOOO easy to add a menu item with a simple line of code: B4X: Copy NavDrawer.NavigationView.Menu.AddWithGroup2(3, 10, 5, "Settings", SetMenuIcon(Chr(0xF013),False,24)) But with B4XDrawer, now it looks like I can't have a single menu item with a bitmap without spending a bunch of time messing with the designer to create a layout. (thanks @drgottjr - I got you reply just before posting this) Last edited: Sep 9, 2024 Upvote 0
OK, I shortened my search phrase and found these threads: DSNavigationDrawer and B4A 10.7 Beta 3 error I use the DSNavigationDrawer from from DesignSupport lib. It works fine in B4A 10.6, but I get this error when I tried to compile in B4A 10.7 Beta 3: main$ResumableSub_Activity_Createresume (java line: 604) java.lang.NoSuchFieldError: No field navdrawer_layout of type I in class... www.b4x.com DesignSupport - Additional Material Design components This library is a wrapper to some of the objects of Googles Design Support library. Requirements: This library requires B4A 6.31 or above. From V2.32 on B4A V6.80 or newer is required. If you use an older B4A version use the V2.31 library. AppCompat 3.30 or above is required. The examples need... www.b4x.com This stinks because it was SOOO easy to add a menu item with a simple line of code: B4X: Copy NavDrawer.NavigationView.Menu.AddWithGroup2(3, 10, 5, "Settings", SetMenuIcon(Chr(0xF013),False,24)) But with B4XDrawer, now it looks like I can't have a single menu item with a bitmap without spending a bunch of time messing with the designer to create a layout. (thanks @drgottjr - I got you reply just before posting this)
JohnC Expert Licensed User Longtime User Sep 9, 2024 #4 OK, I got it working! 1) Did the hack from this post (using v2.32 of the DesignSupport lib and only modified the DesignSupport.aar file, not the designsupport.androidx.aar file): DesignSupport - Additional Material Design components This library is a wrapper to some of the objects of Googles Design Support library. Requirements: This library requires B4A 6.31 or above. From V2.32 on B4A V6.80 or newer is required. If you use an older B4A version use the V2.31 library. AppCompat 3.30 or above is required. The examples need... www.b4x.com 2) Jetifyied the library + exited the IDE 3) Compiled and was getting a runtime error "java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/emoji2/viewsintegration/EmojiTextViewHelper;". Added the four lines from this post: https://www.b4x.com/android/forum/t...-error-and-force-close-app.161362/post-990264 Whola! Upvote 0
OK, I got it working! 1) Did the hack from this post (using v2.32 of the DesignSupport lib and only modified the DesignSupport.aar file, not the designsupport.androidx.aar file): DesignSupport - Additional Material Design components This library is a wrapper to some of the objects of Googles Design Support library. Requirements: This library requires B4A 6.31 or above. From V2.32 on B4A V6.80 or newer is required. If you use an older B4A version use the V2.31 library. AppCompat 3.30 or above is required. The examples need... www.b4x.com 2) Jetifyied the library + exited the IDE 3) Compiled and was getting a runtime error "java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/emoji2/viewsintegration/EmojiTextViewHelper;". Added the four lines from this post: https://www.b4x.com/android/forum/t...-error-and-force-close-app.161362/post-990264 Whola!
JohnC Expert Licensed User Longtime User Sep 9, 2024 #5 OK, So I just upgraded from B4A 11.5 to 13 and now I get this error: B4X: Copy android.view.InflateException: Binary XML file line #16 in com.omnisoft.voiceit:layout/navdrawer_layout: Binary XML file line #16 in com.omnisoft.voiceit:layout/navdrawer_layout: Error inflating class com.google.android.material.navigation.NavigationView I need to use the DSNavigationDrawer because I don't have time to rewrite the whole drawer to use the B4XDrawer. So, if the Hack I mentioned in my previous post got the DSNavigationDrawer to run without an error for B4A 11.5, why is B4A 13 now causing a new issue? Upvote 0
OK, So I just upgraded from B4A 11.5 to 13 and now I get this error: B4X: Copy android.view.InflateException: Binary XML file line #16 in com.omnisoft.voiceit:layout/navdrawer_layout: Binary XML file line #16 in com.omnisoft.voiceit:layout/navdrawer_layout: Error inflating class com.google.android.material.navigation.NavigationView I need to use the DSNavigationDrawer because I don't have time to rewrite the whole drawer to use the B4XDrawer. So, if the Hack I mentioned in my previous post got the DSNavigationDrawer to run without an error for B4A 11.5, why is B4A 13 now causing a new issue?
drgottjr Expert Licensed User Longtime User Sep 9, 2024 #6 11 to 13 is a big jump, mainly due to the sdk. just to double check: in addition to updating to 13, you also did the whole new sdk update? plus switching to java 19.0.2? i looked at reasons why you would see the failure to inflate error. there are many, most relating to incompatability. making sure you have the right sdk might get you past this. erel added a lot of dependencies for 13, stuff that we used to have to add manually and jetify. it's all internal now. (or the latest versions available with the sdkmanager, if necessary.) Upvote 0
11 to 13 is a big jump, mainly due to the sdk. just to double check: in addition to updating to 13, you also did the whole new sdk update? plus switching to java 19.0.2? i looked at reasons why you would see the failure to inflate error. there are many, most relating to incompatability. making sure you have the right sdk might get you past this. erel added a lot of dependencies for 13, stuff that we used to have to add manually and jetify. it's all internal now. (or the latest versions available with the sdkmanager, if necessary.)
JohnC Expert Licensed User Longtime User Sep 10, 2024 #7 Yes, I installed the "Android SDK Command Line Tools" and "Required Resources" from https://www.b4x.com/b4a.html. But I was able to get it working by instead using the B4A v11 of those two files. I then used the SDK Manager and installed Android SDK Platform 34 and set the path to it and the app compiles and runs without any errors. Will using the version 11 of the Command Line Tools and Required Resources instead of the ones listed on https://www.b4x.com/b4a.html cause any problems? Upvote 0
Yes, I installed the "Android SDK Command Line Tools" and "Required Resources" from https://www.b4x.com/b4a.html. But I was able to get it working by instead using the B4A v11 of those two files. I then used the SDK Manager and installed Android SDK Platform 34 and set the path to it and the app compiles and runs without any errors. Will using the version 11 of the Command Line Tools and Required Resources instead of the ones listed on https://www.b4x.com/b4a.html cause any problems?