Unable to build app after instaling react-native-video
See original GitHub issueCurrent behavior
`> Task :react-native-video:compileDebugJavaWithJavac FAILED F:\newapp\classcast\node_modules\react-native-video\android-exoplayer\src\main\java\com\brentvatne\exoplayer\ExoPlayerView.java:25: error: cannot find symbol import com.google.android.exoplayer2.ui.SubtitleView; ^ symbol: class SubtitleView location: package com.google.android.exoplayer2.ui F:\newapp\classcast\node_modules\react-native-video\android-exoplayer\src\main\java\com\brentvatne\exoplayer\ExoPlayerView.java:34: error: cannot find symbol private final SubtitleView subtitleLayout; ^ symbol: class SubtitleView location: class ExoPlayerView F:\newapp\classcast\node_modules\react-native-video\android-exoplayer\src\main\java\com\brentvatne\exoplayer\ReactExoplayerView.java:67: error: cannot find symbol import com.google.android.exoplayer2.ui.PlayerControlView; ^ symbol: class PlayerControlView location: package com.google.android.exoplayer2.ui F:\newapp\classcast\node_modules\react-native-video\android-exoplayer\src\main\java\com\brentvatne\exoplayer\ReactExoplayerView.java💯 error: cannot find symbol private PlayerControlView playerControlView; ^ symbol: class PlayerControlView location: class ReactExoplayerView F:\newapp\classcast\node_modules\react-native-video\android-exoplayer\src\main\java\com\brentvatne\exoplayer\ExoPlayerView.java:74: error: cannot find symbol subtitleLayout = new SubtitleView(context); ^ symbol: class SubtitleView location: class ExoPlayerView F:\newapp\classcast\node_modules\react-native-video\android-exoplayer\src\main\java\com\brentvatne\exoplayer\ReactExoplayerView.java:283: error: cannot find symbol playerControlView = new PlayerControlView(getContext()); ^ symbol: class PlayerControlView location: class ReactExoplayerView F:\newapp\classcast\node_modules\react-native-video\android-exoplayer\src\main\java\com\brentvatne\exoplayer\ReactExoplayerView.java:1160: error: cannot find symbol } else if (getChildAt(1) instanceof PlayerControlView && exoPlayerView != null) { ^ symbol: class PlayerControlView location: class ReactExoplayerView Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 7 errors
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ‘:react-native-video:compileDebugJavaWithJavac’.
Compilation failed; see the compiler error output for details.`
Reproduction steps
Installed react-native-video and linked it as per guidlines.
These are my dependencies
"dependencies": { "react": "16.6.3", "react-native": "0.58.5", "react-native-elements": "^1.0.0", "react-native-firebase": "^5.2.2", "react-native-gesture-handler": "^1.0.15", "react-native-linear-gradient": "^2.5.3", "react-native-modal": "^7.0.2", "react-native-snap-carousel": "^3.7.5", "react-native-svg": "^9.2.4", "react-native-svg-charts": "^5.2.0", "react-native-vector-icons": "^6.2.0", "react-native-video": "^4.4.0", "react-navigation": "^3.2.1" },
Expected behavior
A normal build
Platform
Which player are you experiencing the problem on:
- iOS
- Android ExoPlayer
- Android MediaPlayer
- Windows UWP
- Windows WPF
Video sample
If possible, include a link to the video that has the problem that can be streamed or downloaded from.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Related StackOverflow Question
Try unlinking and re-linking with
react-native unlink react-native-videoandreact-native link react-native-video. This sort of thing happens all the time for me and it’s sort of magic to get it working again. Sometimes restarting Android Studio will fix it as well.Have you manually updated exoplayer? Make sure you are using 2.9.3
The errors you are getting should be deprecation warnings on 2.9.3.
Seems you are trying to use a higher version, maybe you have another library setting it to another version?
In any event, if you don’t see any other version being used, try this PR please: https://github.com/react-native-community/react-native-video/pull/1653