找不到 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")
}
}
}
}
但这对我不起作用。
最佳答案
我遇到了同样的错误!但是我没有得到任何完美的解决方案! 我使用一个 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/