Failed to install react-native-quick-sqlite: React Native is not running on-device. QuickSQLite can only be used when synchronous method invocations (JSI) are possible
I install and I get this error, new architecture is enabled
Error: Failed to install react-native-quick-sqlite: React Native is not running on-device. QuickSQLite can only be used when synchronous method invocations (JSI) are possible. If you are using a remote debugger (e.g. Chrome), switch to an on-device debugger (e.g. Flipper) instead.
"react-native-quick-sqlite": "^8.1.0", "react-native": "0.74.2",
import { typeORMDriver } from 'react-native-quick-sqlite'
export const datasource = new DataSource({ type: 'react-native', database: 'mydb.db', location: '.', driver: typeORMDriver, entities: [ User
], synchronize: true, logging: DEV,
});
I fill like error is do to typeorm typeORMDriver
I get the same issue after updating RN to "0.74.2" from "0.73.4" and using the new architecture.
I'm experiencing this as well. The suggested workaround didn't work for me sadly.
Can confirm I'm also receiving this error after upgrading to 0.74 w/ New Arch.
Has anyone managed to resolve it?
I am also facing the same on RN 0.75.2 only when new arch is enabled, on both Android and iOS
There's a similar issue on the MMKV https://github.com/mrousavy/react-native-mmkv/issues/688 I will try to see if any patch from MMKV works here.
I am also facing the same on RN 0.75.2 only when new arch is enabled, on both Android and iOS
There's a similar issue on the MMKV [mrousavy/react-native-mmkv#688](https://github.com/mrousavy/react-native-mmkv/issues/688) I will try to see if any patch from MMKV works here.
@pranshuchittora did you find any solution to this error? After upgrading to ReactNative 0.76.1 (with New Arch) I got the same issue (after some code fixes). I'm not able to run the app now. I was also checking the MMKV solution, but it is a little more complex than I thought.
Ok, seems that bypassing the check on the global.nativeCallSyncHook == null it goes better the build / running of the app. Still I'm not able to verify if this is working 100% because I have some other libraries issues when upgrading to RN 0.76.1, but here is my patch file for version 8.2.3 (react-native-quick-sqlite+8.2.3.patch).
NOTE: I'm using:
buildToolsVersion = "35.0.0"
minSdkVersion = 26
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "27.2.12479018"
kotlinVersion = '1.9.24'
diff --git a/node_modules/react-native-quick-sqlite/android/CMakeLists.txt b/node_modules/react-native-quick-sqlite/android/CMakeLists.txt
index b7ba2ff..550c44e 100644
--- a/node_modules/react-native-quick-sqlite/android/CMakeLists.txt
+++ b/node_modules/react-native-quick-sqlite/android/CMakeLists.txt
@@ -20,6 +20,10 @@ file(GLOB_RECURSE cpp_files RELATIVE ${CMAKE_SOURCE_DIR}
"src/main/cpp/cpp-adapter.cpp"
)
+find_package(ReactAndroid REQUIRED CONFIG)
+find_package(fbjni REQUIRED CONFIG)
+find_library(LOG_LIB log)
+
add_library(${PACKAGE_NAME} SHARED
${cpp_files}
)
@@ -31,17 +35,11 @@ set_target_properties(
POSITION_INDEPENDENT_CODE ON
)
-find_package(ReactAndroid REQUIRED CONFIG)
-find_package(fbjni REQUIRED CONFIG)
-find_library(LOG_LIB log)
-
-
target_link_libraries(
${PACKAGE_NAME}
${LOG_LIB}
fbjni::fbjni
ReactAndroid::jsi
- ReactAndroid::turbomodulejsijni
- ReactAndroid::react_nativemodule_core
+ ReactAndroid::reactnative
android
)
diff --git a/node_modules/react-native-quick-sqlite/android/build.gradle b/node_modules/react-native-quick-sqlite/android/build.gradle
index 42367f2..32028a1 100644
--- a/node_modules/react-native-quick-sqlite/android/build.gradle
+++ b/node_modules/react-native-quick-sqlite/android/build.gradle
@@ -107,8 +107,8 @@ android {
"**/libhermes_executor.so",
"**/libreactnative.so",
"**/libreactnativejni.so",
- "**/libturbomodulejsijni.so",
- "**/libreact_nativemodule_core.so",
+ // "**/libturbomodulejsijni.so",
+ // "**/libreact_nativemodule_core.so",
"**/libjscexecutor.so"
]
}
diff --git a/node_modules/react-native-quick-sqlite/src/index.ts b/node_modules/react-native-quick-sqlite/src/index.ts
index 1bbcdca..ceef7e4 100644
--- a/node_modules/react-native-quick-sqlite/src/index.ts
+++ b/node_modules/react-native-quick-sqlite/src/index.ts
@@ -25,7 +25,7 @@ if (global.__QuickSQLiteProxy == null) {
}
// Check if we are running on-device (JSI)
- if (global.nativeCallSyncHook == null || QuickSQLiteModule.install == null) {
+ if (QuickSQLiteModule.install == null) {
throw new Error(
'Failed to install react-native-quick-sqlite: React Native is not running on-device. QuickSQLite can only be used when synchronous method invocations (JSI) are possible. If you are using a remote debugger (e.g. Chrome), switch to an on-device debugger (e.g. Flipper) instead.'
)
Yes, seems to be working the above for me. The only detail that I cannot say if it was before or after is that I disabled the bridgless option for now on RN 0.76.1 because other libraries won't support it. Here is a guide I found on how to do it: https://medium.com/@dwslalit/empowering-react-native-enabling-and-disabling-bridgeless-mode-fad6043d2488
This should be fixed in https://github.com/margelo/react-native-quick-sqlite/releases/tag/v8.2.4.
Please let me know if this keeps to be an issue, then i can reopen the issue :)
There's a similar issue on the MMKV [mrousavy/react-native-mmkv#688](https://github.com/mrousavy/react-native-mmkv/issues/688) I will try to see if any patch from MMKV works here.