shahen94 / react-native-video-processing

Native Video editing/trimming/compressing :movie_camera: library for React-Native
https://shahen94.github.io/react-native-video-processing/
MIT License
1.25k stars 325 forks source link

release build issue - ReactNative: CatalystInstanceImpl caught native exception - java.lang.RuntimeException: Could not invoke RNTrimmerManager.getVideoInfo #328

Open rohitrkbe opened 3 years ago

rohitrkbe commented 3 years ago

2021-01-08 17:49:35.581 7482-7743/? E/unknown:ReactNative: CatalystInstanceImpl caught native exception java.lang.RuntimeException: Could not invoke RNTrimmerManager.getVideoInfo at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:193) at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:21) at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0) at android.os.Looper.loop(Looper.java:201) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:149) at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:21)  at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)  at android.os.Handler.handleCallback(Handler.java:873)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0)  at android.os.Looper.loop(Looper.java:201)  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37)  at java.lang.Thread.run(Thread.java:764)  Caused by: java.lang.NoSuchFieldError: no "J" field "mNativeContext" in class "Lwseemann/media/FFmpegMediaMetadataRetriever;" or its superclasses at wseemann.media.FFmpegMediaMetadataRetriever.native_init(Native Method) at wseemann.media.FFmpegMediaMetadataRetriever.(Unknown Source:43) at com.shahenlibrary.Trimmer.a.p(Unknown Source:4) at com.shahenlibrary.Trimmer.TrimmerManager.getVideoInfo(Unknown Source:24) at java.lang.reflect.Method.invoke(Native Method)  at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:149)  at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:21)  at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)  at android.os.Handler.handleCallback(Handler.java:873)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0)  at android.os.Looper.loop(Looper.java:201)  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37)  at java.lang.Thread.run(Thread.java:764)  2021-01-08 17:49:35.583 7482-7743/? E/unknown:DisabledDevSupportManager: Caught exception java.lang.RuntimeException: Could not invoke RNTrimmerManager.getVideoInfo at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:193) at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:21) at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0) at android.os.Looper.loop(Looper.java:201) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:149) at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:21)  at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)  at android.os.Handler.handleCallback(Handler.java:873)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0)  at android.os.Looper.loop(Looper.java:201)  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37)  at java.lang.Thread.run(Thread.java:764)  Caused by: java.lang.NoSuchFieldError: no "J" field "mNativeContext" in class "Lwseemann/media/FFmpegMediaMetadataRetriever;" or its superclasses at wseemann.media.FFmpegMediaMetadataRetriever.native_init(Native Method) at wseemann.media.FFmpegMediaMetadataRetriever.(Unknown Source:43) at com.shahenlibrary.Trimmer.a.p(Unknown Source:4) at com.shahenlibrary.Trimmer.TrimmerManager.getVideoInfo(Unknown Source:24)

Current Behavior

working fine in debug mode, but not working in release mode

Expected Behavior

should work in both the modes as same.

Your Environment

software version
react-native-video-processing 2.0.0
react-native 0.63.3
node 10.19.0
codefromhimanshu commented 3 years ago

@jackyleehong Can you help me fix this issue.

superandrew213 commented 3 years ago

Is it a locally saved video?

williardx commented 3 years ago

I'm currently getting this issue on my debug build for Android devices for locally saved videos. Did anyone ever figure out how to fix it?

williardx commented 3 years ago

My issue ended up being passing media URIs instead of actual file paths to FFmpegMediaMetadataRetriever. The fix there is to convert URIs like content:// to a file path.

Seems like getting the error in this issue was unrelated to my original issue of debug crashing. This issue is related to ProGuard rules and this should fix it: https://github.com/wseemann/FFmpegMediaMetadataRetriever/issues/182.

edwinckc commented 2 years ago

Thanks for linking to the ProGuard issue! I knew my issue was ProGuard related, and searching for RNTrimmerManager.getVideoInfo led me here, whereas the other issue didn't show up at all.