Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: app crashes #6

Open
JumBay opened this issue Dec 12, 2024 · 5 comments
Open

Android: app crashes #6

JumBay opened this issue Dec 12, 2024 · 5 comments
Assignees

Comments

@JumBay
Copy link

JumBay commented Dec 12, 2024

Hi,

Thanks for the plugin.

I did a try on android an got the error:

Serious error executing plugin
                                                                                                    java.lang.reflect.InvocationTargetException
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:138)
                                                                                                    	at com.getcapacitor.Bridge.lambda$callPluginMethod$0(Bridge.java:821)
                                                                                                    	at com.getcapacitor.Bridge.$r8$lambda$FNYM7cvgeBk0k8YXQH7M96Mrf-c(Unknown Source:0)
                                                                                                    	at com.getcapacitor.Bridge$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:224)
                                                                                                    	at android.os.Looper.loop(Looper.java:318)
                                                                                                    	at android.os.HandlerThread.run(HandlerThread.java:67)
                                                                                                    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.getcapacitor.JSObject com.getcapacitor.JSObject.getJSObject(java.lang.String)' on a null object reference
                                                                                                    	at dev.eduardoroth.mediaplayer.MediaPlayerPlugin.create(MediaPlayerPlugin.java:58)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                    	at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:138) 
                                                                                                    	at com.getcapacitor.Bridge.lambda$callPluginMethod$0(Bridge.java:821) 
                                                                                                    	at com.getcapacitor.Bridge.$r8$lambda$FNYM7cvgeBk0k8YXQH7M96Mrf-c(Unknown Source:0) 
                                                                                                    	at com.getcapacitor.Bridge$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0) 
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:958) 
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:224) 
                                                                                                    	at android.os.Looper.loop(Looper.java:318) 
                                                                                                    	at android.os.HandlerThread.run(HandlerThread.java:67) 

The code I use :

 const playerId = Math.random().toString(36).substring(2, 15);

    await MediaPlayer.create({
      playerId,
      url: 'https://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4',
      // extra: {
      //   title,
      //   // poster,
      //   autoPlayWhenReady: true,
      //   showControls: true,
      //   rate: 1.0,
      // },
      // ios: {
      //   enablePiP: true,
      //   enableBackgroundPlay: true,
      //   openInFullscreen: true,
      //   fullscreenOnLandscape: true,
      // },
      // android: {
      //   enablePiP: false,
      //   enableBackgroundPlay: false,
      //   openInFullscreen: true,
      //   fullscreenOnLandscape: true,
      // },
    });
    ```
@eduardoRoth
Copy link
Owner

@JumBay thank you for trying my plugin! This error is fixed on version 2.0.5

@eduardoRoth eduardoRoth self-assigned this Dec 12, 2024
@JumBay
Copy link
Author

JumBay commented Dec 13, 2024

Thx, but it still crashes:

FATAL EXCEPTION: main
                                                                                                    Process: app.wako, PID: 10333
                                                                                                    java.lang.IllegalArgumentException: No view found for id 0x7f0a000c (app.wako:id/MediaPlayerFragmentContainerView) for fragment MediaPlayerContainer{e5cdb60} (44a34cbd-cbe9-4c0e-ae50-c0ffbaa7887d id=0x7f0a000c tag=rwfyig0iilo)
                                                                                                    	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:547)
                                                                                                    	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
                                                                                                    	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
                                                                                                    	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1839)
                                                                                                    	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
                                                                                                    	at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:565)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:224)
                                                                                                    	at android.os.Looper.loop(Looper.java:318)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8772)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
                                                                                                    	

Moreover I had to set default value for top, start, width... otherwise it throw a null pointer exception

@eduardoRoth
Copy link
Owner

@JumBay Sorry, for the delay, v2.0.6 should fix these issues.

@eduardoRoth
Copy link
Owner

@JumBay , please let me know if the issue is fixed.

@JumBay
Copy link
Author

JumBay commented Dec 23, 2024

Thx I've been busy lately, I'll check it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants