Closed sindu12jun closed 4 years ago
Hi! Does it only happen in production when you're using proguard? In that case see https://github.com/henninghall/react-native-date-picker/blob/master/README.md#why-does-the-android-app-crash-in-production
In other cases, could you provide an example where the values of the variables are visible?
Hi, sorry about that, here's the simpler one case which will crash:
<ReactDatePicker mode={'date'} date={new Date()} onDateChange={(date) => { console.log(date); }}/>
And, I am running in develop mode, also tried the suggestion in https://github.com/henninghall/react-native-date-picker/blob/master/README.md#why-does-the-android-app-crash-in-production, but still the same
Ok thanks, could you try these solutions?
Thank you for your suggestion, I tried but doesn't change, it might not be an issue with this library anyway, I might change it to a mask input, thank you
Hmm it feels like it has to do with some Android config and related to the time4j library that datepicker is dependent on. I'm happy to try to figure it out if you want!
What is your targetsdkverion, compilesdkversion and which android version are you running on the phone?
Hi, thank you very much!
Here is my compile configuration:
buildToolsVersion = "28.0.3" minSdkVersion = 23 compileSdkVersion = 28 targetSdkVersion = 28
I am running on android 9, thanks again!
@henninghall Getting the same issue on android pie and up. Any updates on this?
Try this one ! It fixed the issue for me. Don't forget to clean and rebuild the project
@sindu12jun @virendravidyarthee Have a look at my comment above
I haven't managed to reproduce this so far. If anyone could share a full example where this is present it would help a lot!
For me it was a missing style at the activity in the AndroidManifest.xml of my project. So maybe if you remove that, you can reproduce it. It became an error after installing your package. Maybe it relies on some resources of AppCompat ?
Did you get the same error as in the Stackoverflow thread? ie the
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity
Seems like a different error than the one sindu12jun got:
java.lang.NoClassDefFoundError: Failed resolution of: Lnet/time4j/android/ApplicationStarter
You are right. Maybe it is unrelated to the mentioned error. The behaviour was the same though.
@henninghall @felixspitzer Thanks for your responses. Turns out, it was crashing due to an old gradle plugin version. Updated our gradle and it started working like a charm.
Great to hear! Thanks for letting us know 🙂
Describe the bug When open the screen contains the date picker in App in Android, the app will instantly crash and exit
Expected behavior The app should display the date picker without crashing
To Reproduce Add example code that reproduces the behavior.
Smartphone (please complete the following information):
Error Log This is the error log in android studio
2020-02-19 11:19:20.605 11528-11528/com.billiapprn6 E/AndroidRuntime: FATAL EXCEPTION: main Process: com.billiapprn6, PID: 11528 java.lang.NoClassDefFoundError: Failed resolution of: Lnet/time4j/android/ApplicationStarter; at com.henninghall.date_picker.DatePickerManager.createViewInstance(DatePickerManager.java:32) at com.henninghall.date_picker.DatePickerManager.createViewInstance(DatePickerManager.java:16) at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139) at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:82) at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:269) at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:179) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:972) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:943) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:28) at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:174) at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:84) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:947) at android.view.Choreographer.doCallbacks(Choreographer.java:761) at android.view.Choreographer.doFrame(Choreographer.java:693) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7050) 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:965) Caused by: java.lang.ClassNotFoundException: Didn't find class "net.time4j.android.ApplicationStarter" on path: DexPathList[[zip file "/data/app/com.billiapprn6-jfs-cyvifH4UlZBlt6kj0Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.billiapprn6-jfs-cyvifH4UlZBlt6kj0Q==/lib/arm64, /data/app/com.billiapprn6-jfs-cyvifH4UlZBlt6kj0Q==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312)