Reputation: 241
I have created the app with Expo.
Everything is fine I can run the app on ios and android emulator.
When I use cd android && ./gradlew assembleRelease
command to have an apk file.
I have a successful result. But When I install that apk on any android device It crashes immidiately after running the app
I managed to get a stack trace from the device and here is what it says.
The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo. Visit https://docs.expo.io to learn more about developing an Expo project., stack:
Version Information
"@expo/vector-icons": "^10.0.6",
"@react-native-community/netinfo": "^4.6.0",
"expo": "^35.0.0",
"expo-barcode-scanner": "^7.0.0",
"expo-font": "^7.0.0",
"expo-image-manipulator": "^7.0.0",
"expo-image-picker": "^7.0.0",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "0.59.10",
"react-native-custom-qr-codes-expo": "^2.2.0",
"react-native-gesture-handler": "~1.3.0",
"react-native-image-placeholder": "^1.0.14",
As I result I cant publish my app to playstore.
Any help or suggestion will be appriciated.
Upvotes: 1
Views: 133
Reputation: 12210
See, the problem is you chose expo and now you are generating the APK via the normal bare react native project, that is without using expo. The command
cd android && ./gradlew assembleRelease
is used to generate apk for bare react native app. So that's why its asking that Expo SDK requires expo to run. And its throwing the error , coz APK wasnt build with the expo wrapper on top of it.
For expo , you need to use expo build:android or expo build:ios
, you can refer the docs here Expo apk link. After that i hope it will solve the error.
Hope it helps.Feel free to ask any doubts.
Upvotes: 3