React Native视频构建失败

时间:2019-07-16 08:33:48

标签: react-native

在我将React本机视频包添加到我的项目后,我无法构建该项目。我的rn版本是0.60.3我已经安装了最新版本的react-native-video。错误是

> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.android.support:support-media-compat:28.0.0.
     Searched in the following locations:
       - file:/C:/Users/avajang-pc/.m2/repository/com/android/support/support-media-compat/28.0.0/support-media-compat-28.0.0.pom
       - file:/C:/Users/avajang-pc/.m2/repository/com/android/support/support-media-compat/28.0.0/support-media-compat-28.0.0.jar
       - file:/C:/Users/avajang-pc/Desktop/newSpoc/spocplus/node_modules/react-native/android/com/android/support/support-media-compat/28.0.0/support-media-compat-28.0.0.pom
       - file:/C:/Users/avajang-pc/Desktop/newSpoc/spocplus/node_modules/react-native/android/com/android/support/support-media-compat/28.0.0/support-media-compat-28.0.0.jar
       - file:/C:/Users/avajang-pc/Desktop/newSpoc/spocplus/node_modules/jsc-android/dist/com/android/support/support-media-compat/28.0.0/support-media-compat-28.0.0.pom
       - file:/C:/Users/avajang-pc/Desktop/newSpoc/spocplus/node_modules/jsc-android/dist/com/android/support/support-media-compat/28.0.0/support-media-compat-28.0.0.jar
       - https://dl.google.com/dl/android/maven2/com/android/support/support-media-compat/28.0.0/support-media-compat-28.0.0.pom
       - https://dl.google.com/dl/android/maven2/com/android/support/support-media-compat/28.0.0/support-media-compat-28.0.0.jar
       - https://jcenter.bintray.com/com/android/support/support-media-compat/28.0.0/support-media-compat-28.0.0.pom
       - https://jcenter.bintray.com/com/android/support/support-media-compat/28.0.0/support-media-compat-28.0.0.jar
     Required by:
         project :app > project :react-native-video

我添加了maven,我更改了gradle版本,构建了工具版本。

1 个答案:

答案 0 :(得分:0)

尝试运行此命令,react-native 0.60现在使用androidX,并且并非所有库都已更新以支持它(其中之一是react-native-video):

npm install --save-dev jetifier && npx jetify && react-native run-android