WindSekirun/MediaResizer

Sample App is crashed: Caused by: kotlin.TypeCastException: null cannot be cast to non-null type pyxis.uzuki.live.mediaresizer.data.VideoResizeOption

Closed this issue · 4 comments

I download apk from link given in descriptoin. I am trying to capture image at that time it is crash:
Exception:

Process: pyxis.uzuki.live.mediaresizersample, PID: 30368

java.lang.RuntimeException: Failure delivering result ResultInfo{who=android:fragment:1, request=0, result=-1, data=Intent { act=inline-data (has extras) }} to activity {pyxis.uzuki.live.mediaresizersample/pyxis.uzuki.live.mediaresizersample.activity.JavaActivity}: kotlin.TypeCastException: null cannot be cast to non-null type pyxis.uzuki.live.mediaresizer.data.VideoResizeOption
add dependenciesat android.app.ActivityThread.deliverResults(ActivityThread.java:4094)
add dependenciesat android.app.ActivityThread.handleSendResult(ActivityThread.java:4137)
add dependenciesat android.app.ActivityThread.-wrap20(ActivityThread.java)
add dependenciesat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1529)
add dependenciesat android.os.Handler.dispatchMessage(Handler.java:102)
add dependenciesat android.os.Looper.loop(Looper.java:154)
add dependenciesat android.app.ActivityThread.main(ActivityThread.java:6123)
add dependenciesat java.lang.reflect.Method.invoke(Native Method)
add dependenciesat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
add dependenciesat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)

Caused by: kotlin.TypeCastException: null cannot be cast to non-null type pyxis.uzuki.live.mediaresizer.data.VideoResizeOption
add dependenciesat pyxis.uzuki.live.mediaresizer.data.ResizeOption$Builder.build(ResizeOption.kt:61)
add dependenciesat pyxis.uzuki.live.mediaresizersample.activity.JavaActivity.processImage(JavaActivity.java:99)
add dependenciesat pyxis.uzuki.live.mediaresizersample.activity.JavaActivity.resultProcess(JavaActivity.java:80)
add dependenciesat pyxis.uzuki.live.mediaresizersample.activity.JavaActivity.lambda$clickCamera$0$JavaActivity(JavaActivity.java:46)
add dependenciesat pyxis.uzuki.live.mediaresizersample.activity.JavaActivity$$Lambda$0.invoke(Unknown Source)
add dependenciesat pyxis.uzuki.live.richutilskt.utils.RPickMedia$pickFromCamera$1.invoke(RPickMedia.kt:66)
add dependenciesat pyxis.uzuki.live.richutilskt.utils.RPickMedia$pickFromCamera$1.invoke(RPickMedia.kt:23)
add dependenciesat pyxis.uzuki.live.richutilskt.utils.RPickMedia$ResultFragment.onActivityResult(RPickMedia.kt:189)
add dependenciesat android.app.Activity.dispatchActivityResult(Activity.java:6955)
add dependenciesat android.app.ActivityThread.deliverResults(ActivityThread.java:4090)

Thanks for reporting.

i need some information to solve this issue.

  1. can you write down reproduce process?
  2. can you provide full log of crash?

by default, all variable of VideoResizeOption except MediaFormatStrategy can not be null.

Oh, i don't see 'edited'.

so, i will check my sample project, then i will upload new apk file.

I uploaded new sample apk in 101c9f0. please check.

I try to find reproduce process to solve this issue, but my device is operated successfully.
but i fix crash issue related your issue in a874421.
i hope this commits help you.

I made another commit which make nullable VideoResizingOption, ImageResizingOption in ResizeOption in 124c036.