uxcam / react-native-ux-cam

52 stars 10 forks source link

React Native iOS app and keyboard freeze when typing in a multiline TextInput on v5.4.5 #86

Closed tharinduIB closed 1 year ago

tharinduIB commented 1 year ago

React Native iOS app freezes when typing in a multiline TextInput. First few letters can be typed but then the keyboard and app are getting frozen/lagged. Cannot do anything (swipe, scroll, close the keyboard) when this happens. When I remove multiline={true} from the TextInput, no issue present.

How I know this is related to UXCam? I removed this line RNUxcam.startWithConfiguration(configuration); and re-built, then there's no such issue.

Tested on: Platform: iOS XCode: v14.3 macOS 13.3 (M1) React Native: v0.64.4 react-native-ux-cam: v5.4.4 & v5.4.5

Also tested on (same happens): Platform: iOS XCode: v14.3 macOS 13.3 (M1) React Native: v0.71.6 react-native-ux-cam: v5.4.5

Since UXCam is a required in our project, I had to downgrade to v5.3.4. The above issue isn't there in this version.

There is no issue in Android at all.

thallada commented 1 year ago

I am also experiencing this issue, however I cannot downgrade to 5.3.4 since my android build fails with the following error:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-ux-cam:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/root/mobile/node_modules/react-native-ux-cam/android/build/intermediates/merged_res/release/values/values.xml:2717: AAPT: error: resource android:attr/lStar not found.

I believe this is because lStar needs compileSdkVersion 31 or greater, but react-native-ux-cam version 5.3.4 has compileSdkVersion 29: https://github.com/uxcam/react-native-ux-cam/blob/5.3.4/uxcam-react-wrapper/android/build.gradle

Is it possible to fix the ANR in the latest 5.4.6 version, or fix this lStar build issue in 5.3.4?

thallada commented 1 year ago

For now, I made a fork of this repo at version 5.3.4 and upgraded compileSdkVersion to 32 and updated my package.json to it:

"react-native-ux-cam": "https://gitpkg.now.sh/Outcomes4Me/react-native-ux-cam/uxcam-react-wrapper?main"

I confirmed that the iOS TextInput ANR bug is still fixed, the android build now succeeds, and I'm still receiving UXCam sessions.

Alternatively, use this patch-package:

// Fixes android builds on an old version of react-native-ux-camera.
// See this issue for more details:
// https://github.com/uxcam/react-native-ux-cam/issues/86#issuecomment-1546077844
diff --git a/node_modules/react-native-ux-cam/android/build.gradle b/node_modules/react-native-ux-cam/android/build.gradle
index be49e65..44b275b 100644
--- a/node_modules/react-native-ux-cam/android/build.gradle
+++ b/node_modules/react-native-ux-cam/android/build.gradle
@@ -12,12 +12,12 @@ buildscript {
 apply plugin: 'com.android.library'

 android {
-    compileSdkVersion 29
-    buildToolsVersion "29.0.2"
+    compileSdkVersion 32
+    buildToolsVersion "32.0.0"

     defaultConfig {
-        minSdkVersion 16
-        targetSdkVersion 29
+        minSdkVersion 19
+        targetSdkVersion 32
         versionCode 1
         versionName "1.0"
     }
gabrieluxcam commented 1 year ago

Hello @tharinduIB @thallada this has been fixed on the latest update of the SDK 5.4.6, please let us know should you encounter any issue still.

Thanks!

gabrieluxcam commented 1 year ago

Closing this, please always make sure to use the latest SDK version, change log is available here

tharinduIB commented 1 year ago

Hello @tharinduIB @thallada this has been fixed on the latest update of the SDK 5.4.6, please let us know should you encounter any issue still.

Thanks!

Thanks, working now..