From d4de8439e5be195c44ab660c32c49d3c25200966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Thu, 18 Jul 2024 16:00:23 +0200 Subject: [PATCH] fix: Update build patch for react-native-background-upload react-native-background-upload is not maintained. We already had a patch for react-native 0.72, but we are getting an error when uploading a file when targeting Android 34 : "One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts". Fix is done in android-upload-service https://github.com/gotev/android-upload-service/issues/642 New patch is taken from https://github.com/Vydia/react-native-background-upload/pull/347 --- ...nd-upload+6.6.0+001+build-android-34.patch | 36 +++++++++++++++ ...kground-upload+6.6.0+002+build-rn-72.patch | 44 ------------------- 2 files changed, 36 insertions(+), 44 deletions(-) create mode 100644 patches/react-native-background-upload+6.6.0+001+build-android-34.patch delete mode 100644 patches/react-native-background-upload+6.6.0+002+build-rn-72.patch diff --git a/patches/react-native-background-upload+6.6.0+001+build-android-34.patch b/patches/react-native-background-upload+6.6.0+001+build-android-34.patch new file mode 100644 index 000000000..c0ced084b --- /dev/null +++ b/patches/react-native-background-upload+6.6.0+001+build-android-34.patch @@ -0,0 +1,36 @@ +diff --git a/node_modules/react-native-background-upload/android/build.gradle b/node_modules/react-native-background-upload/android/build.gradle +index fa6963f..7a3c908 100755 +--- a/node_modules/react-native-background-upload/android/build.gradle ++++ b/node_modules/react-native-background-upload/android/build.gradle +@@ -1,9 +1,9 @@ + buildscript { + ext { +- kotlinVersion = '1.6.0' +- buildToolsVersion = '29.0.2' +- compileSdkVersion = 29 +- targetSdkVersion = 29 ++ kotlinVersion = '1.8.21' ++ buildToolsVersion = '34.0.8' ++ compileSdkVersion = 34 ++ targetSdkVersion = 34 + minSdkVersion = 18 + } + ext.detoxKotlinVersion = ext.kotlinVersion +@@ -20,7 +20,7 @@ buildscript { + + apply plugin: 'com.android.library' + apply plugin: 'kotlin-android' +-apply plugin: 'kotlin-android-extensions' ++apply plugin: 'kotlin-parcelize' + + def DEFAULT_COMPILE_SDK_VERSION = 28 + def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3" +@@ -64,7 +64,7 @@ dependencies { + + implementation "org.jetbrains.kotlin:$_kotlinStdlib:$_kotlinVersion" + +- implementation 'net.gotev:uploadservice-okhttp:4.7.0' ++ implementation 'net.gotev:uploadservice-okhttp:4.9.2' + + implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' + } diff --git a/patches/react-native-background-upload+6.6.0+002+build-rn-72.patch b/patches/react-native-background-upload+6.6.0+002+build-rn-72.patch deleted file mode 100644 index d771b2387..000000000 --- a/patches/react-native-background-upload+6.6.0+002+build-rn-72.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/node_modules/react-native-background-upload/android/build.gradle b/node_modules/react-native-background-upload/android/build.gradle -index fa6963f..6534084 100755 ---- a/node_modules/react-native-background-upload/android/build.gradle -+++ b/node_modules/react-native-background-upload/android/build.gradle -@@ -1,6 +1,11 @@ - buildscript { -+ // Simple helper that allows the root project to override versions declared by this library. -+ ext.safeExtGet = { prop, fallback -> -+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback -+ } -+ - ext { -- kotlinVersion = '1.6.0' -+ kotlinVersion = safeExtGet('kotlinVersion', '1.7.20') - buildToolsVersion = '29.0.2' - compileSdkVersion = 29 - targetSdkVersion = 29 -@@ -20,16 +25,11 @@ buildscript { - - apply plugin: 'com.android.library' - apply plugin: 'kotlin-android' --apply plugin: 'kotlin-android-extensions' - - def DEFAULT_COMPILE_SDK_VERSION = 28 - def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3" - def DEFAULT_TARGET_SDK_VERSION = 28 - --def safeExtGet(prop, fallback) { -- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback --} -- - android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) -@@ -46,6 +46,9 @@ android { - lintOptions { - abortOnError false - } -+ buildFeatures { -+ viewBinding true -+ } - } - - repositories {