MSMaterialDrawer

DonManfred

Expert
Licensed User
Longtime User
The best solution is not to use this library anymore. It is no longer mantained/autor no longer active in forum
 

chompina

Member
Licensed User
Longtime User
hi
my error is


B4X:
** Activity (home) Resume **
Error occurred on line: 485 (Home)
android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.v4.widget.DrawerLayout
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.v4.widget.DrawerLayout
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.widget.DrawerLayout" on path: DexPathList[[zip file "/data/app/ir.whtapp.groupwhatsapp-Z7dJSzAA4hmKRk-3dA5UtA==/base.apk"],nativeLibraryDirectories=[/data/app/ir.whtapp.groupwhatsapp-Z7dJSzAA4hmKRk-3dA5UtA==/lib/arm64, /system/lib64, /system/vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    at android.view.LayoutInflater.createView(LayoutInflater.java:606)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
    at com.mikepenz.materialdrawer.Drawer.withDrawerLayout(Drawer.java:334)
    at com.mikepenz.materialdrawer.Drawer.build(Drawer.java:1090)
    at com.maximussoft.msmaterialdrawer.MSMaterialDrawerBuilder.Build(MSMaterialDrawerBuilder.java:122)
    at ir.whtapp.groupwhatsapp.home._activity_resume(home.java:1301)
    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 ir.whtapp.groupwhatsapp.home.afterFirstLayout(home.java:110)
    at ir.whtapp.groupwhatsapp.home.access$000(home.java:17)
    at ir.whtapp.groupwhatsapp.home$WaitForLayout.run(home.java:82)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:169)
    at android.app.ActivityThread.main(ActivityThread.java:6521)

View attachment 82938

View attachment 82939


View attachment 82940

View attachment 82941
View attachment 82942

hi, i clean install, b4x 10.6, last sdk & resources, jettified library msmaterialdrawer.. same error...

lot hour of searching, i got solution,very simple, in the additional res md-lib folder

edit md-lib\res\layout\material_drawer.xml

Change this:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!--
    the clickable here should fix the hanging which occurs sometimes
    http://stackoverflow.com/questions/18044277/android-navigation-drawer-bug-using-the-sample
    -->
    <com.mikepenz.materialdrawer.view.ScrimInsetsFrameLayout
        android:clickable="true"
        android:id="@+id/content_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</android.support.v4.widget.DrawerLayout>

To this:
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!--
    the clickable here should fix the hanging which occurs sometimes
    http://stackoverflow.com/questions/18044277/android-navigation-drawer-bug-using-the-sample
    -->
    <com.mikepenz.materialdrawer.view.ScrimInsetsFrameLayout
        android:clickable="true"
        android:id="@+id/content_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</androidx.drawerlayout.widget.DrawerLayout>


in another words , converted to androidx something like that ?
before -> android.support.v4.widget.DrawerLayout after -> androidx.drawerlayout.widget.DrawerLayout

save it,, set android target to 30
compile and test it., this solution work for me to build the menu, i dont know if there is another issues.

hope this helps
 

Attachments

  • WhatsApp Image 2021-02-22 at 1.02.57 PM.jpeg
    WhatsApp Image 2021-02-22 at 1.02.57 PM.jpeg
    22.7 KB · Views: 330
Top