Answer the question
In order to leave comments, you need to log in
How to make Expo and BarCodeScanner friends from its own documentation?
Good afternoon, for several days I can not understand what the problem is. BarCodeScanner works in develop mode, and after building it in apk it stops working (I tried it on 6 different devices).
You need to scan a barcode on an android phone. I generate a new application expo init testApp. I execute expo install expo-barcode-scanner to install the package and take a piece of code from the example in the documentation from here https://docs.expo.io/versions/v37.0.0/sdk/bar-code... paste it into App.js with replacement. I launch the expo start application and it works on all phones . Next, I publish and build the application to get apk: expo publish and expo build: android. I take apk and a request for rights to the camera comes up, the camera works and the picture is there, but the scanning itself does not occur. I just don't know what I could be wrong about. There is a suspicion that something is missing in app.json ...
this is how my app.json looks like
{
"expo": {
"name": "testApp",
"slug": "test-app",
"privacy": "public",
"sdkVersion": "37.0.0",
"platforms": [
"android"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"android": {
"package": "com.example.testapp",
"versionCode": 1,
"permissions": [
"CAMERA"
]
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question