react-native-video: Build failures on Android after upgrading from 6.0.0-alpha.4 to 6.0.0-beta.0

Ever since upgrading to 6.0.0-beta.0, I am unable to build our app on Android successfully. Here are the errors:

BUILD FAILED in 8s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/mitcheldowney/repos/podverse-rn/node_modules/react-native-video/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java:25: error: package androidx.activity does not exist
import androidx.activity.OnBackPressedCallback;
                        ^
/Users/mitcheldowney/repos/podverse-rn/node_modules/react-native-video/android/src/main/java/com/brentvatne/exoplayer/FullScreenPlayerView.java:9: error: package androidx.activity does not exist
import androidx.activity.OnBackPressedCallback;
                        ^
/Users/mitcheldowney/repos/podverse-rn/node_modules/react-native-video/android/src/main/java/com/brentvatne/exoplayer/FullScreenPlayerView.java:17: error: cannot find symbol
    private final OnBackPressedCallback onBackPressedCallback;
                  ^
  symbol:   class OnBackPressedCallback
  location: class FullScreenPlayerView
/Users/mitcheldowney/repos/podverse-rn/node_modules/react-native-video/android/src/main/java/com/brentvatne/exoplayer/FullScreenPlayerView.java:19: error: cannot find symbol
    public FullScreenPlayerView(Context context, ExoPlayerView exoPlayerView, LegacyPlayerControlView playerControlView, OnBackPressedCallback onBackPressedCallback) {
                                                                                                                         ^
  symbol:   class OnBackPressedCallback
  location: class FullScreenPlayerView
/Users/mitcheldowney/repos/podverse-rn/node_modules/react-native-video/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java:400: error: cannot find symbol
            fullScreenPlayerView = new FullScreenPlayerView(getContext(), exoPlayerView, playerControlView, new OnBackPressedCallback(true) {
                                                                                                                ^
  symbol:   class OnBackPressedCallback
  location: class ReactExoplayerView
/Users/mitcheldowney/repos/podverse-rn/node_modules/react-native-video/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java:401: error: method does not override or implement a method from a supertype
                @Override
                ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/mitcheldowney/repos/podverse-rn/node_modules/react-native-video/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 errors

I have tried the Android specific steps in the installation docs, but my changes seem to have no effect. I get the same 6 errors every time.

It seemed like this PR https://github.com/react-native-video/react-native-video/pull/3376 might be related, so I tried checking out the master branch from that commit, but I still get the same issues.

Does anyone have insight into what we need to do differently to get this working? Our .gradle files can be found here: https://github.com/podverse/podverse-rn/tree/develop/android

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 16

Most upvoted comments

I just removed my patch file, then upgraded to 6.0.0-beta.2 locally, and it built successfully! It looks like the fix worked. Thanks for the quick attention on this.

@mitchdowney The latest public release

@freeboub cool thanks for the PR!

As for XCode…our latest app version was just accepted for prod to AppStore. We may not be using the latest XCode in our AppCenter build pipeline though, and AppCenter appears to be down right now so I can’t check which one we’re using 😕

One more question, when you say “latest” Xcode are you referring to the latest public release, or latest beta?