when i do the npm run android, the app works just fine, but when i compile it into apk (which is being built successfully) then when i run it the app crashes.
the other raised question solutions doesn’t seem to solve the problem!
app.json
`{
"expo": {
"name": "AgriApp",
"slug": "AgriApp",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"platforms": [
"ios",
"android",
"web"
],
"splash": {
"image": "./assets/splash.png",
"resizeMode":"contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"package": "com.AgriAPP.AgriAPP",
"versionCode": 1,
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"web": {
"favicon": "./assets/favicon.png"
},
"extra": {
"eas": {
"projectId": "2da3b6b9-d9fb-47d9-b0b1-fae65f387b52"
}
}
}
}
`
eas.json
{
"cli": {
"version": ">= 5.6.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"android": {
"buildType": "apk"
}
},
"production": {}
},
"submit": {
"production": {}
}
}
package.json
`{
"name": "agriapp",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"@react-native-community/slider": "4.4.2",
"@react-navigation/native": "^6.1.9",
"@react-navigation/stack": "^6.3.20",
"expo": "~49.0.15",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-native": "0.72.6"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}
`
Output : Want build and run the app on the android without being crashed
2
Answers
The error: [react-native-gesture-handler] react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install & cd ..).
Make sure to import 'react-native-gesture-handler' On the first line of your App.js code
You need to install other additional dependencies :