typescript - react-native-video 5.2.0 Android 构建错误 RNC 0.66.3

标签 typescript react-native

找不到 com.google.android.exoplayer:exoplayer:2.13.2 每次我尝试在 android 中构建时都会显示此错误。 IOS 适合我。

我将 jcenter 添加到 android/build.gradle 中,如下所示:

allprojects {
    repositories {
        .... # rest of your code
        jcenter() {
            content {
                includeModule("com.yqritc", "android-scalablevideoview")
            }
        }
    }
}

但这对我不起作用。

enter image description here

最佳答案

我遇到了同样的错误!但是我没有得到任何完美的解决方案! 我使用一个 hacky 解决方案。您可以尝试一下以节省您的时间!

因此,首先您必须阅读文档。 添加所有额外的代码后,你必须去

项目根文件夹:node_modules/react-native-video

package.json

"dependencies": {
    ...
    ...
    "shaka-player": "^3.2.1" // Add this line
},

下一步:转到

/android-exoplayer/build.gradle

dependencies {
    ...
    ...
   - implementation('com.google.android.exoplayer:exoplayer:2.13.2') { // delete this line
   + implementation('com.google.android.exoplayer:exoplayer:2.13.3') {  // add this line
        exclude group: 'com.android.support'
    }

    ...
    ...

   - implementation('com.google.android.exoplayer:extension-okhttp:2.13.2') { // delete this line
   + implementation('com.google.android.exoplayer:extension-okhttp:2.13.3') { // add this line
        exclude group: 'com.squareup.okhttp3', module: 'okhttp'
    }
}

保存它!并再次运行您的项目!

Note: This will not work if you delete your node_modules folder (You have to add it again for working properly) I think this solution will be added in the next release of react-native-video

希望你一切顺利!

关于typescript - react-native-video 5.2.0 Android 构建错误 RNC 0.66.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70829457/

相关文章:

android - 如何在 React Native 中将焦点或光标设置在 TextInput 上

react-native - RN Firebase 动态链接,如何解析嵌入式链接

typescript - 停止 typescript-eslint/explicit-module-boundary-types 应用于不使用 Typescript 的 vue 组件

javascript - 读取 json 文件并以 Angular 显示值

react-native - React Native 中 DatePickerIOS 的 Prop 问题

javascript - 将本地 JavaScript 加载到 Web View 中?

react-native - 每次击键后 TextInput 都会失去焦点 react-native

javascript - 在没有 authguard 的情况下禁用 Angular 7 中的 url 更改导航或直接页面访问?

angular - 使用日期管道以不同语言设置带有月份名称的日期格式

javascript - Angular 6如何从YTS API获取数据