maitrungduc1410 / react-native-video-trim

Video trimmer for React Native App
MIT License
34 stars 14 forks source link

App crash on android #46

Open hakymz opened 3 weeks ago

hakymz commented 3 weeks ago

When I call the show showEditor it crashes the app on android but it works fine on ios. Please what can be the issue?

maitrungduc1410 commented 3 weeks ago

hi, can you wrap some log in Logcat (Android studio) at the time it's crashed?

hakymz commented 3 weeks ago

am using react native how do i go about that?

maitrungduc1410 commented 3 weeks ago

Note that you have to use real device for both android and + ios

And to get Android log: open Android studio-> Logcat -> select your physical device -> run-android -> test your app, on crash there should be some red error log printed

hakymz commented 3 weeks ago

ok i have real device

hakymz commented 3 weeks ago

FATAL EXCEPTION: main Process: com.hklive, PID: 17345 java.lang.IllegalArgumentException: /picker/0/com.android.providers.media.photopicker/media/1000179502 does not exist at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:255) at com.videotrim.widgets.ZVideoView.setVideoURI(ZVideoView.java:32) at com.videotrim.widgets.VideoTrimmerView.initVideoByURI(VideoTrimmerView.java:154) at com.videotrim.VideoTrimModule.lambda$showEditor$1$com-videotrim-VideoTrimModule(VideoTrimModule.java:113) at com.videotrim.VideoTrimModule$$ExternalSyntheticLambda4.run(Unknown Source:8) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:204) at android.os.Looper.loop(Looper.java:291) at android.app.ActivityThread.main(ActivityThread.java:8134) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1019)

this is the error

maitrungduc1410 commented 3 weeks ago

java.lang.IllegalArgumentException: /picker/0/com.android.providers.media.photopicker/media/1000179502 does not exist

as the error shows above, high change your video is invalid, the error is thrown by native Android MediaMetadataRetriever not which is not my lib. You may want to try with react-native-image-picker to see if it works

hakymz commented 3 weeks ago

I checked with the isValidVideo function provided it returns true, also the video plays with react-native-video and I am react-native-image-picker and using android 13

maitrungduc1410 commented 3 weeks ago

Can you provide me your input video?

Also which android version are you using? On which model device?

hakymz commented 3 weeks ago

content://media/picker/0/com.android.providers.media.photopicker/media/1000179502

input video

android version 13

Model tecno