Pilloxa / react-native-nordic-dfu

Nordic Device Firmware Update for React Native
MIT License
139 stars 119 forks source link

Update XCode 13 & Android 12 #164

Open manualexSP opened 2 years ago

manualexSP commented 2 years ago

Changes:

vkourtis commented 2 years ago

Confirming that this fixes #166.

For now I added a patch to use no.nordicsemi.android:dfu:2.0.1 and this was all I needed.

Cantinaband commented 2 years ago

Having some troubles with Android 12. Would be great to have this PR released

Hassaan68 commented 2 years ago

Confirming that this fixes #166.

For now I added a patch to use no.nordicsemi.android:dfu:2.0.1 and this was all I needed.

hi @vkourtis. can you please explain the steps needed in more detail?

vkourtis commented 2 years ago

Confirming that this fixes #166. For now I added a patch to use no.nordicsemi.android:dfu:2.0.1 and this was all I needed.

hi @vkourtis. can you please explain the steps needed in more detail?

Sure! You need to use patch-package and add a file under your patches folder with filename react-native-nordic-dfu+3.2.1.patch and the following content:

diff --git a/node_modules/react-native-nordic-dfu/android/build.gradle b/node_modules/react-native-nordic-dfu/android/build.gradle
index eb225b1..d7fa73e 100644
--- a/node_modules/react-native-nordic-dfu/android/build.gradle
+++ b/node_modules/react-native-nordic-dfu/android/build.gradle
@@ -38,6 +38,6 @@ repositories {

 dependencies {
     implementation 'com.facebook.react:react-native:+'
-    implementation 'no.nordicsemi.android:dfu:1.8.0'
+    implementation 'no.nordicsemi.android:dfu:2.0.1'
 }

This assumes that you use the latest version of react-native-nordic-dfu, 3.2.1. If not, I suggest to update this package before applying this patch.

kakonyitibor commented 2 years ago

Hello, I have tried my app with this patch on Android12. It doesn't crash anymore on startDfu (unlike when using the original repo, issue #166 ), but the process gets stuck in the DFU_PROCESS_STARTING state, then throws GATT ERROR. (I don't have this problem with older Android versions. ) Do you have any idea? Thank you!

Edit: turned out that nRF Connect mobile produces a similar behaviour with the Android12 phone I'm using, so this might be a device-specific bug in the Nordic Android DFU library.

RuchiraSwarnapriya commented 1 year ago

Hello,

I also tried my app with this patch on Android 12, now app crashing without opening. Can someone help me to resolve this issue ?