MaterialDateTimePicker icon indicating copy to clipboard operation
MaterialDateTimePicker copied to clipboard

datepicker crash sometime.

Open Meggi07 opened this issue 7 years ago • 16 comments

in datepickerdialog show me this type error java.lang.RuntimeException: Font asset not found fonts/Roboto-Medium.ttf sometime please give me solution how to fix that?

I am using this gradle "compile 'com.wdullaer:materialdatetimepicker:2.3.0'"

Meggi07 avatar Nov 03 '17 13:11 Meggi07

You should first start with using the latest version. It would also useful if you could post a complete stacktrace.

wdullaer avatar Nov 03 '17 19:11 wdullaer

I am putting latest version but it not support design24.4.0 gradle what I am doing?

On 04-Nov-2017 12:50 am, "wdullaer" [email protected] wrote:

You should first start with using the latest version. It would also useful if you could post a complete stacktrace.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wdullaer/MaterialDateTimePicker/issues/420#issuecomment-341801756, or mute the thread https://github.com/notifications/unsubscribe-auth/ARo2m4l6VqhxPUCePkgn6gJxKtBNCy_uks5sy2dqgaJpZM4QRHPE .

Meggi07 avatar Nov 04 '17 03:11 Meggi07

Either you upgrade the support library to the latest version as well, or you exclude the support library transitive dependency from this library as explained in the FAQ.

wdullaer avatar Nov 05 '17 13:11 wdullaer

I am adding latest version then show me error like this Error:(15, 21) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'. after solve this error again same error occurs FATAL EXCEPTION:Process: com.anandniketan.skool360teacher, PID: 6524 java.lang.RuntimeException: Font asset not found fonts/Roboto-Medium.ttf at android.graphics.Typeface.createFromAsset(Typeface.java:297) at com.wdullaer.materialdatetimepicker.TypefaceHelper.get(TypefaceHelper.java:31) at com.wdullaer.materialdatetimepicker.date.DatePickerDialog.onCreateView(DatePickerDialog.java:371) at android.app.Fragment.performCreateView(Fragment.java:2069) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:899) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1072) at android.app.BackStackRecord.run(BackStackRecord.java:852) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1478) at android.app.FragmentManagerImpl$1.run(FragmentManager.java:452) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:6102) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)

Meggi07 avatar Nov 06 '17 04:11 Meggi07

Are you using gradle / android studio to build your app? This is necessary for the assets of a library to be packaged into your app (otherwise you'll have to include the font in your application assets rather than relying on the version shipped with this library) https://stackoverflow.com/questions/5583608/difference-between-res-and-assets-directories

wdullaer avatar Nov 07 '17 13:11 wdullaer

Thank you so much but problem solve another way

On Tue, Nov 7, 2017 at 7:29 PM, wdullaer [email protected] wrote:

Are you using gradle / android studio to build your app? This is necessary for the assets of a library to be packaged into your app (otherwise you'll have to include the font in your application assets rather than relying on the version shipped with this library) https://stackoverflow.com/questions/5583608/difference- between-res-and-assets-directories

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wdullaer/MaterialDateTimePicker/issues/420#issuecomment-342490118, or mute the thread https://github.com/notifications/unsubscribe-auth/ARo2mz_tgMr1S0Nd9bRaYHWKdaTLTOOJks5s0GJJgaJpZM4QRHPE .

-- Good Morning mam/sir,

                                        Thanks&Regards,

                                          Megha Shah

                                         (8672952197)

Meggi07 avatar Nov 08 '17 04:11 Meggi07

hey @Meggi07 how did you solved the problem? I am using lastest version of everything and is still crashing

luckpizza avatar Nov 15 '17 11:11 luckpizza

you can check date format if you set date format like-15-11-2017 then change to 15/11/2017 and try

Meggi07 avatar Nov 15 '17 11:11 Meggi07

you can check date format if you set date format like-15-11-2017 then change to 15/11/2017 and try

On Wed, Nov 15, 2017 at 4:35 PM, Luca [email protected] wrote:

hey @Meggi07 https://github.com/meggi07 how did you solved the problem? I am using lastest version of everything and is still crashing

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wdullaer/MaterialDateTimePicker/issues/420#issuecomment-344560066, or mute the thread https://github.com/notifications/unsubscribe-auth/ARo2m1oAj9f2vNoA3Z8q4vdmCY3AD7dyks5s2sWJgaJpZM4QRHPE .

-- Good Morning mam/sir,

                                        Thanks&Regards,

                                          Megha Shah

                                         (8672952197)

Meggi07 avatar Nov 16 '17 04:11 Meggi07

I was having the problem with the font. I could not solve it, but anyway I needed the "Spinner" like picker, so I went for a different lib :(

luckpizza avatar Nov 16 '17 08:11 luckpizza

Were you getting the same stack trace? Are you using gradle to build? Which library version were you using? Can you supply a bit more information in general?

wdullaer avatar Nov 16 '17 09:11 wdullaer

Hi @wdullaer I have quite and updated configuration:

buildscript { ext.kotlin_version = '1.1.51' ext.google_support_version = '27.0.1' ext.firebase_version = '11.6.0' ext.min_sdk = 16 ext.target_sdk = 26

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0'
    classpath ':dexguard:'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.firebase:firebase-plugins:1.1.4'
}

}

I was having the same problem initializing Roboto-Medium.ttf, I now switched to another library that actually provided the "spinner" look I was looking for, that's why I can't help u much :( if someone is interested here is it: https://github.com/luckpizza/SpinnerDatePicker (I made it compatible with android >= 16)

luckpizza avatar Nov 16 '17 09:11 luckpizza

Which version works of this library works with API 15?

Technically this is my issue:

03-11 17:31:03.604 31974-31974/org.development.aihd.app E/AndroidRuntime: FATAL EXCEPTION: main Process: org.development.aihd.app, PID: 31974 java.lang.IllegalStateException: Could not find a method dob(View) in the activity class android.support.v7.widget.TintContextWrapper for onClick handler on view class customfonts.EditText_Roboto_Regular with id 'birthdate' at android.view.View$1.onClick(View.java:3847) at android.view.View.performClick(View.java:4508) at android.view.View$PerformClick.run(View.java:18675) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5590) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1280) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1096) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NoSuchMethodException: dob [class android.view.View] at java.lang.Class.getConstructorOrMethod(Class.java:472) at java.lang.Class.getMethod(Class.java:857)

cromwel avatar Mar 11 '19 14:03 cromwel

I am having same problem with version 3.6.4. It crash

java.lang.RuntimeException: Font asset not found fonts/Roboto-Medium.ttf at android.graphics.Typeface.createFromAsset(Typeface.java:284) at com.wdullaer.materialdatetimepicker.TypefaceHelper.get(TypefaceHelper.java:31) at com.wdullaer.materialdatetimepicker.date.DatePickerDialog.onCreateView(DatePickerDialog.java:426) at android.app.Fragment.performCreateView(Fragment.java:2352) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171) at android.app.BackStackRecord.run(BackStackRecord.java:815) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1582) at android.app.FragmentManagerImpl$1.run(FragmentManager.java:483) 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:6688) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

tmhmxy8 avatar Sep 18 '19 14:09 tmhmxy8

I only support the latest version.

If you can't do that, at least try to update the build toolchain to the latest version.

wdullaer avatar Sep 23 '19 11:09 wdullaer

Check this for alternative https://arkapp.medium.com/ios-date-time-picker-for-android-93af45fdfaf0

abdulrehmank7 avatar May 31 '21 06:05 abdulrehmank7