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

Attempt to invoke interface method 'long com.google.android.exoplayer2.ExoPlayer.getCurrentPosition()' on a null object reference #145

Open
waltercruz opened this issue Feb 8, 2024 · 3 comments

Comments

@waltercruz
Copy link

Hi!

I'm registering a crash that appears on the Crash Log on google play console. I don't know how to solve, but maybe someome can help

Exception java.lang.NullPointerException: Attempt to invoke interface method 'long com.google.android.exoplayer2.ExoPlayer.getCurrentPosition()' on a null object reference
  at com.jeep.plugin.capacitor.capacitorvideoplayer.FullscreenExoPlayerFragment.getCurrentTime (FullscreenExoPlayerFragment.java:1094)
  at com.jeep.plugin.capacitor.capacitorvideoplayer.FullscreenExoPlayerFragment$5.<init> (FullscreenExoPlayerFragment.java:566)
  at com.jeep.plugin.capacitor.capacitorvideoplayer.FullscreenExoPlayerFragment.playerExit (FullscreenExoPlayerFragment.java:563)
  at com.jeep.plugin.capacitor.capacitorvideoplayer.FullscreenExoPlayerFragment.onStop (FullscreenExoPlayerFragment.java:667)
  at androidx.fragment.app.Fragment.performStop (Fragment.java:3341)
  at androidx.fragment.app.FragmentStateManager.stop (FragmentStateManager.java:679)
  at androidx.fragment.app.FragmentStateManager.moveToExpectedState (FragmentStateManager.java:310)
  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:883)
  at android.os.Handler.dispatchMessage (Handler.java:100)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7386)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:980)
@jepiqueau
Copy link
Collaborator

@waltercruz can you share your project on github so i can have look on what your are doing and try to find an explanation

@waltercruz
Copy link
Author

Unfortunately I can't, and the bug don't happen on my devices (either simulator or real phone). If I can't thing on somwthing I will update this issue!

@jepiqueau
Copy link
Collaborator

@waltercruz i do not know if you can test this on devices where you get the crash modify the FullscreenExoPlayerFragment file by cutting the lines 563to568

    Map<String, Object> info = new HashMap<String, Object>() {
      {
        put("dismiss", "1");
        put("currentTime", getCurrentTime());
      }
    };

and put them just after line 569

  public void playerExit() {
    if (player != null) {
      Map<String, Object> info = new HashMap<String, Object>() {
        {
          put("dismiss", "1");
          put("currentTime", getCurrentTime());
        }
      };
      player.seekTo(0);
      player.setVolume(curVolume);
    }
    releasePlayer();
    ...
 }

and tell me if its works

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