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

ExoPlayer throws NullPointerException on Nexus 5X (MTC20F) / Android 6.0.1 #1633

Closed
kristerkari opened this issue Jun 24, 2019 · 4 comments
Closed
Labels
stale Closed due to inactivity or lack or resources

Comments

@kristerkari
Copy link

kristerkari commented Jun 24, 2019

Bug

I noticed from our Sentry that one of the Android test track users with Nexus 5X / Android 6.0.1 had gotten a NullPointerException from ExoPlayer.

I have used 5 different Android devices (e.g. Galaxy A5, OnePlus 3T) to test the video playback, and it has been working just fine on them.

I don't have the Nexus 5X device myself, so I'm not able to verify the crash happening.

Here's the stacktrace:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
    at com.google.android.exoplayer2.util.Util.getUserAgent(Util.java:1101)
    at com.brentvatne.exoplayer.DataSourceUtil.getUserAgent(DataSourceUtil.java:38)
    at com.brentvatne.exoplayer.DataSourceUtil.buildHttpDataSourceFactory(DataSourceUtil.java:80)
    at com.brentvatne.exoplayer.DataSourceUtil.buildDataSourceFactory(DataSourceUtil.java:72)
    at com.brentvatne.exoplayer.DataSourceUtil.getDefaultDataSourceFactory(DataSourceUtil.java:57)
    at com.brentvatne.exoplayer.ReactExoplayerView.buildDataSourceFactory(ReactExoplayerView.java:542)
    at com.brentvatne.exoplayer.ReactExoplayerView.createViews(ReactExoplayerView.java:198)
    at com.brentvatne.exoplayer.ReactExoplayerView.<init>(ReactExoplayerView.java:180)
    at com.brentvatne.exoplayer.ReactExoplayerViewManager.createViewInstance(ReactExoplayerViewManager.java:70)
    at com.brentvatne.exoplayer.ReactExoplayerViewManager.createViewInstance(ReactExoplayerViewManager.java:22)
    at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:45)
    at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:260)
    at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:200)
    at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:1109)
    at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1080)
    at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
    at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:166)
    at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:110)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
    at android.view.Choreographer.doCallbacks(Choreographer.java:670)
    at android.view.Choreographer.doFrame(Choreographer.java:603)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5421)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Environment info

React native info output:

  React Native Environment Info:
    System:
      OS: macOS 10.14.4
      CPU: (4) x64 Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz
      Memory: 1.35 GB / 16.00 GB
      Shell: 3.0.2 - /usr/local/bin/fish
    Binaries:
      Node: 8.16.0 - /usr/local/opt/node@8/bin/node
      Yarn: 1.16.0 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/opt/node@8/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
      Android SDK:
        API Levels: 17, 18, 19, 21, 22, 23, 25, 26, 27, 28
        Build Tools: 23.0.1, 23.0.3, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.0, 28.0.3
        System Images: android-19 | Intel x86 Atom, android-21 | ARM EABI v7a, android-21 | Intel x86 Atom_64, android-22 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5522156
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.58.6 => 0.58.6 

Library version: 4.4.1

Device info from Sentry:

Family | Nexus
Model | Nexus 5X (MTC20F)
Architecture | armeabi-v7a
Battery Level | 43%
Orientation | portrait
Memory | Total: 4.0 GB / Free: 3.2 GB
Capacity | Total: 3.0 GB / Free: 2.1 GB
Simulator | False
brand | google
charging | True
low_memory | False
manufacturer | LGE
online | True
screen_density | 0.6625
screen_dpi | 106
screen_resolution | 448x288

Steps To Reproduce

  1. Try to play an .mp4 file with react-native-video on Nexus 5X (MTC20F) / Android 6.0.1

Reproducible sample code

<Video
  source={video.source}
  repeat={true}
  allowsExternalPlayback={false}
  controls={false}
  muted={true}
/>
@kristerkari
Copy link
Author

I wonder if updating to a newer version of ExoPlayer would fix the issue?

https://github.com/google/ExoPlayer/blob/release-v2/RELEASENOTES.md

@ku8ar
Copy link

ku8ar commented Nov 5, 2020

This is the error that the Google Play Bot returns when adding a new version of the application to the Play Store.
For some reason, Google uses a rooted simulator for scanning which has a trash in its internal libraries.

@happyfloat
Copy link
Contributor

@ku8ar So you are saying it is only related to their simulators? I'm also seeing these crashes in sentry from the test lab bots. Works on two devices I tested so far.

@ku8ar
Copy link

ku8ar commented Feb 26, 2021

@happyfloat Yes, only bots. But I have a theory that this crash is causing the longer publishing time for app in the Play Store (but I can't prove it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Closed due to inactivity or lack or resources
Projects
None yet
Development

No branches or pull requests

4 participants