Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/openchs-android/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
AsyncStorage_useNextStorage=true
VisionCamera_enableCodeScanner=true
9 changes: 7 additions & 2 deletions packages/openchs-android/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ module.exports = function (api) {
];
const plugins = [
["@babel/plugin-proposal-decorators", {"legacy": true}],
"@babel/plugin-proposal-object-rest-spread"
"@babel/plugin-proposal-object-rest-spread",
[
'react-native-reanimated/plugin',
{
globals: ['__scanCodes'],
},
]
;
];

return {
presets,
Expand Down
1 change: 1 addition & 0 deletions packages/openchs-android/index.android.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'react-native-reanimated';
/* @flow */
import {AppRegistry} from 'react-native';
// import App from './integrationTest/RealmIssuesApp';
Expand Down
581 changes: 320 additions & 261 deletions packages/openchs-android/package-lock.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions packages/openchs-android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"react-native-keychain": "^8.1.1",
"react-native-mime-types": "2.3.0",
"react-native-randombytes": "^3.6.1",
"react-native-reanimated": "^3.5.4",
"react-native-restart": "0.0.24",
"react-native-safe-area-context": "4.3.1",
"react-native-simple-dialogs": "1.5.0",
Expand All @@ -97,6 +98,7 @@
"react-native-vector-icons": "9.2.0",
"react-native-video": "5.2.1",
"react-native-video-player": "0.12.0",
"react-native-vision-camera": "2.16.2",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Blocking: VisionCamera v2 API mismatch with your QRScanner implementation

QRScanner uses VisionCamera Code Scanner props (onReadCode, codeTypes) that are only available in v4. Your dependency is pinned to 2.16.2, so scanning won’t work. Options:

  • Pin to a RN 0.72–compatible v4 (≤ 4.3.1) and switch to the v4 API (useCodeScanner + codeScanner prop).
  • Or keep 2.x and re-implement scanning via frame processors + a barcode plugin (heavier; not recommended here).

Recommend: upgrade to 4.3.1 and adjust QRScanner accordingly.

Apply:

-    "react-native-vision-camera": "2.16.2",
+    "react-native-vision-camera": "4.3.1",

Follow-up: You’ll also need to change QRScanner to v4 API (see my comment in QRScanner.js). Also ensure VisionCamera_enableCodeScanner=true remains in gradle.properties.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"react-native-vision-camera": "2.16.2",
"react-native-vision-camera": "4.3.1",
🤖 Prompt for AI Agents
In packages/openchs-android/package.json around line 100, the project pins
react-native-vision-camera to 2.16.2 which is incompatible with the QRScanner
implementation that expects the v4 Code Scanner API; update the dependency to
"react-native-vision-camera": "4.3.1" (RN 0.72-compatible), run your package
install to update lockfile, then update QRScanner to use the v4 API (replace
onReadCode/codeTypes usage with useCodeScanner and pass the resulting
codeScanner via the codeScanner prop as noted in the QRScanner.js review
comment), and ensure gradle.properties contains
VisionCamera_enableCodeScanner=true before rebuilding.

"react-native-webview": "11.23.0",
"react-native-zip-archive": "6.0.8",
"realm": "11.10.2",
Expand All @@ -105,13 +107,15 @@
"rules-config": "github:openchs/rules-config#7f34ac91826bbaabb27bf9d86bf7cecb8710d1d8",
"stacktrace-js": "2.0.2",
"transducers-js": "0.4.174",
"uuid": "^9.0.1"
"uuid": "^9.0.1",
"vision-camera-code-scanner": "0.2.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/plugin-proposal-decorators": "7.18.9",
"@babel/plugin-proposal-object-rest-spread": "7.18.9",
"@babel/runtime": "^7.20.0",
"@react-native-community/cli": "latest",
"babel-jest": "^29.2.1",
"bugsnag-sourcemaps": "1.3.0",
"chai": "4.3.6",
Expand All @@ -126,8 +130,7 @@
"patch-package": "6.5.0",
"react-addons-test-utils": "15.6.2",
"react-dom": "18.2.0",
"react-test-renderer": "18.2.0",
"@react-native-community/cli": "latest"
"react-test-renderer": "18.2.0"
},
"engines": {
"node": ">=16"
Expand Down
Loading