今天开始出现此错误(项目没有任何更改)。
Could not find androidx.tonyodev.fetch2:xfetch2:3.1.4
Jcenter 好像不再提供这个包了。
更新到 3.1.5 或 3.1.6 并不能解决问题。
此套餐是
react-native-background-downloader
的一部分
经过一番研究,解决办法是切换到
implementation "com.github.tonyofrancis.Fetch:xfetch2:3.1.6"
来自 https://jitpack.io/#tonyofrancis/Fetch/3.1.6
来源:https://github.com/tonyofrancis/Fetch/issues/586
我们必须修补
react-native-background-downloader
diff --git a/node_modules/react-native-background-downloader/android/build.gradle b/node_modules/react-native-background-downloader/android/build.gradle
index 3018efe..95ebb2b 100644
--- a/node_modules/react-native-background-downloader/android/build.gradle
+++ b/node_modules/react-native-background-downloader/android/build.gradle
@@ -22,7 +22,7 @@ dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+'
if (project.properties['android.useAndroidX'] == 'true' || project.properties['android.useAndroidX'] == true) {
- api "androidx.tonyodev.fetch2:xfetch2:3.1.4"
+ api "com.github.tonyofrancis.Fetch:xfetch2:3.1.6"
} else {
api "com.tonyodev.fetch2:fetch2:3.0.10"
}
我也遇到了同样的问题。希望你的解决方案对我有帮助,但是你能更具体一些吗?这部分放在哪里:
diff --git a/node_modules/react-native-background-downloader/android/build.gradle b/node_modules/react-native-background-downloader/android/build.gradle
index 3018efe..95ebb2b 100644
--- a/node_modules/react-native-background-downloader/android/build.gradle
+++ b/node_modules/react-native-background-downloader/android/build.gradle
@@ -22,7 +22,7 @@ dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+'
if (project.properties['android.useAndroidX'] == 'true' || project.properties['android.useAndroidX'] == true) {
- api "androidx.tonyodev.fetch2:xfetch2:3.1.4"
+ api "com.github.tonyofrancis.Fetch:xfetch2:3.1.6"
} else {
api "com.tonyodev.fetch2:fetch2:3.0.10"
}