Android Question [Solved]Error While running the App

AndroidMadhu

Active Member
Licensed User
Hello,
I am following the below link from @DonManfred ....
https://www.b4x.com/android/forum/threads/materialdatetimepicker.68323/

But I am getting while running the App[When I am press the button].
When I am press the Date Button I am getting the below error :
===========
B4X:
 ** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/ContextCompat;
at com.wdullaer.materialdatetimepicker.date.DatePickerDialog.onCreateView(DatePickerDialog.java:313)
at android.app.Fragment.performCreateView(Fragment.java:2522)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1298)
at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2431)
at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2210)
at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2166)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2067)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:738)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6820)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:922)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.ContextCompat" on path: DexPathList[[zip file "/data/app/b4a.example-cmMFxefixVEdeBjY5MRQ7w==/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-cmMFxefixVEdeBjY5MRQ7w==/lib/arm, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:171)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 15 more
** Activity (main) Resume **

The below error I am getting while pressing the time button :

B4X:
 ** Activity (main) Create, isFirst = true **
main_activity_create (java line: 352)
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/kunzisoft/switchdatetimesample/Sample;
at switchdatetimepickerwrapper.switchdatetimepickerWrapper.Initialize(switchdatetimepickerWrapper.java:74)
at JHS.SwitchDateTimePicker.main._activity_create(main.java:352)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at JHS.SwitchDateTimePicker.main.afterFirstLayout(main.java:105)
at JHS.SwitchDateTimePicker.main.access$000(main.java:17)
at JHS.SwitchDateTimePicker.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6820)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:922)
Caused by: java.lang.ClassNotFoundException: com.kunzisoft.switchdatetimesample.Sample
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 14 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/app/AppCompatActivity;

Any mistake I am doing?
Please advice

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Did you Jetified the Libraries? The lib is using old android support components...
 
Upvote 0

AndroidMadhu

Active Member
Licensed User
I have use Jetifier from Tools-> Jetifier.
After that I again compile the code and ran the App.
Still the same error I am facing.

Please advice
 
Upvote 0
Top