找不到 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")
}
}
}
}
但這對我不起作用。

uj5u.com熱心網友回復:
我遇到了同樣的錯誤!但我沒有得到任何完美的解決方案! 我使用了一個 hacky 解決方案。您可以嘗試一下以節省您的時間!
因此,首先您必須閱讀檔案。添加所有額外的代碼后,你必須去
Project Root folder: node_modules/react-native-video
在
包.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'
}
}
保存!并再次運行您的專案!
注意:如果你洗掉你的 node_modules 檔案夾,這將不起作用(你必須再次添加它才能正常作業)我認為這個解決方案將在 react-native-video的下一個版本中添加
希望你一切順利!
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/420550.html
標籤:
