expo: undefined is not an object (evaluating m.getExponentPushTokenAsync) running Android Standalone APK
Hi,
My app works nicely running in the exponent client, but the android apk fails at launch with the following error:
undefined is not an object (evaluating m.getExponentPushTokenAsync)
I bootstrapped initially using CRNA, but have modified to look a little more like an Expo project (maybe I’ve missed something!)
My app.json looks like this:
{
"expo": {
"name": "Switch",
"version": "1.0.0",
"sdkVersion": "18.0.0",
"orientation": "portrait",
"icon": "./assets/switch_icon.png",
"slug": "switch",
"privacy": "unlisted",
"primaryColor": "#000000",
"ios": {
"bundleIdentifier": "com.switchapp.switch"
},
"android": {
"package": "com.switchapp.switch"
}
}
}
And my package.json looks like so:
{
"name": "switch",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "0.0.40",
"jest-expo": "~18.0.0",
"react-test-renderer": "16.0.0-alpha.12"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"aws-sdk": "^2.82.0",
"babili": "^0.1.4",
"base-64": "^0.1.0",
"base64-arraybuffer": "^0.1.5",
"blob-to-buffer": "^1.2.6",
"buffer": "^5.0.6",
"expo": "^18.0.3",
"gnirts": "^1.1.1",
"js-base64": "^2.1.9",
"jwt-decode": "^2.2.0",
"react": "16.0.0-alpha.12",
"react-native": "https://github.com/expo/react-native/archive/sdk-18.0.3.tar.gz",
"react-navigation": "^1.0.0-beta.11",
"react-navigation-is-focused-hoc": "^1.0.0",
"utf8": "^2.1.2"
}
}
Thanks, Jack
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 23 (7 by maintainers)
Commits related to this issue
- [docs] fix refresh on nav bug (#379) — committed to expo/expo by abi 7 years ago
i updated my expo version to 20.1.2 and its work…
@dikaiosune, I’ve got the same issue with sdk 20 on android too. I’ve cleaned all the cache I don’t explicitly use getExponentPushTokenAsync and still get the error:
One thing worth mentioning is that I ejected the project but then converted back. Here are my
exp.jsonandpackage.json.What should I do about it? It really is a stopper since I cannot get inside my app on android.
So I think this is a bug with the initial bundle that is preloaded into the app. After installing the APK, with my android device not connected to the internet I got the same error launching the app. When I connected to the wifi and relaunched the app, it started fine. Subsequent launches while offline worked fine too.