Please provide the following:
- SDK Version: from 38 to 41
- Platforms(Android/iOS/web/all): android
- Add the appropriate “Tag” based on what Expo library you have a question on.
The setup of my project is quite complex, because it was started with a boilerplate with integrated react-native/expo, react, apollo and backend server.
This is the boilerplate: GitHub - sysgears/apollo-universal-starter-kit: Apollo Universal Starter Kit is an SEO-friendly, fully-configured, modular starter application that helps developers to streamline web, server, and mobile development with cutting-edge technologies and ultimate code reuse.
Because it seems no longer to be active maintained, we started upgrading some of the used libraries on our own. react-navigation already is upgraded to v5.
Now I wanted to upgrade expo from SDK38 to 41. Because expo upgrade
sadly never worked in this boilerplate, I changed SDK version in app.json and expo version in package.json to 41, started the application and then changed all listed packages to the expected versions. For upgrades in the past, this workflow was good enough.
But now I have a strange behaviour when starting metro.
I read in the blog post for SDK40 about some changes with metro configuration. Maybe that could be connected.
Anyway.
I got used to the error message about “no android device connected”. But now metro sends an exit code and stops my execution. Do you have any idea why this would happen?
Output from metro startup
Starting Metro Bundler
No Android connected device found, and no emulators could be started automatically.
Please connect a device or create an emulator (https://docs.expo.dev/workflow/android-studio-emulator).
Then follow the instructions here to enable USB debugging:
https://developer.android.com/studio/run/device.html#developer-device-options. If you are using Genymotion go to Settings -> ADB, select "Use custom Android SDK tools", and point it at your Android SDK directory.
Error: No Android connected device found, and no emulators could be started automatically.
Please connect a device or create an emulator (https://docs.expo.dev/workflow/android-studio-emulator).
Then follow the instructions here to enable USB debugging:
https://developer.android.com/studio/run/device.html#developer-device-options. If you are using Genymotion go to Settings -> ADB, select "Use custom Android SDK tools", and point it at your Android SDK directory.
at getAllAvailableDevicesAsync (/home/michael/Projekte/JS/app-mivao/node_modules/xdl/src/Android.ts:117:11)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at Object.openProjectAsync (/home/michael/Projekte/JS/app-mivao/node_modules/xdl/src/Android.ts:868:21)
at /home/michael/Projekte/JS/app-mivao/node_modules/expo-cli/src/urlOpts.ts:102:18
at async Promise.all (index 0)
at handleMobileOptsAsync (/home/michael/Projekte/JS/app-mivao/node_modules/expo-cli/src/urlOpts.ts:96:19)
packages/mobile/app.json
{
"expo": {
"name": "mivao",
"description": "",
"icon": "../../app.png",
"version": "0.1.2",
"slug": "mivao",
"sdkVersion": "40.0.0",
"facebookAutoInitEnabled": false,
"facebookAutoLogAppEventsEnabled": false,
"facebookAdvertiserIDCollectionEnabled": false,
"updates": {
"enabled": false,
"checkAutomatically": "ON_ERROR_RECOVERY"
},
"ios": {
"bundleIdentifier": "app.mivaom",
"infoPlist": {
"UIBackgroundModes": [
"location",
"fetch"
]
}
},
"android": {
"package": "app.mivao",
"permissions": [],
"enableDangerousExperimentalLeanBuilds": true,
"useNextNotificationsApi": true,
"versionCode": 1
},
"packagerOpts": {
"config": "metro.config.js",
"sourceExts": [
"jsx",
"js",
"json",
"ts",
"tsx",
"graphql",
"gql"
]
}
}
}
packages/mobile/metro.config.js
const { createMetroConfiguration } = require('expo-yarn-workspaces');
const baseConfig = createMetroConfiguration(__dirname);
const config = {
...baseConfig,
transformer: {
babelTransformerPath: require.resolve('./custom-transformer'),
minifierPath: 'metro-minify-terser',
minifierConfig: {
ecma: 8,
keep_classnames: true,
keep_fnames: true,
module: true,
mangle: {
module: true,
keep_classnames: true,
keep_fnames: true,
},
},
},
};
module.exports = config;
packages/mobile/package.json
{
"name": "mobile",
"private": true,
"version": "1.0.0",
"main": "src",
"scripts": {
"clean": "rimraf build .expo .tmp",
"exp-login": "cross-env NODE_ENV=production expo login -u $EXP_USERNAME -p $EXP_PASSWORD --non-interactive",
"exp-publish": "yarn exp-login && yarn expo p --non-interactive",
"exp-publish:rc": "yarn exp-login && yarn expo p --non-interactive --release-channel rc",
"exp-publish:develop": "yarn exp-login && yarn expo p --non-interactive --release-channel develop",
"test": "yarn lint",
"eslint": "eslint --fix --ext js --ext jsx --ext json src",
"tslint": "tslint --fix -p tsconfig.json -c ../../tslint.json",
"lint": "yarn eslint && yarn tslint",
"watch": "expo start",
"watch:android": "expo start --android --lan --offline",
"watch:ios": "expo start --ios --lan --offline",
"postinstall": "expo-yarn-workspaces postinstall",
"cli": "node ../../tools/cli"
},
"repository": {
"type": "git",
"url": "https://gitlab.com/mivao/app-mivao.git"
},
"bugs": {
"url": "https://mivao.atlassian.net/secure/RapidBoard.jspa?rapidView=3&atlOrigin=eyJpIjoiZDBkZTBiMWVmODcxNGMwYWFlM2Y2MDkxYzMxODAwYjkiLCJwIjoiaiJ9"
},
"homepage": "https://mivao.de",
"keywords": [
"App",
"Selbstmanagement",
"Aufgabenplan"
],
"author": "mivao",
"license": "closed",
"dependencies": {
"@apollo/client": "^3.3.12",
"@expo/vector-icons": "^12.0.0",
"@gqlapp/progress-client-react": "^1.0.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/bottom-tabs": "^5.11.7",
"@react-navigation/compat": "^5.3.10",
"@react-navigation/drawer": "^5.11.4",
"@react-navigation/native": "^5.8.10",
"@react-navigation/stack": "^5.12.8",
"apollo-link-state": "^0.4.1",
"apollo-upload-client": "^10.0.0",
"dayjs": "^1.10.5",
"expo": "~41.0.1",
"expo-background-fetch": "^9.1.0",
"expo-cli": "^4.4.1",
"expo-constants": "~10.1.3",
"expo-device": "^3.2.0",
"expo-file-system": "~11.0.2",
"expo-app-loading": "~1.2.1",
"expo-font": "~9.1.0",
"expo-image-picker": "~10.1.4",
"expo-keep-awake": "~9.1.2",
"expo-localization": "~10.1.0",
"expo-notifications": "~0.11.6",
"expo-permissions": "~12.0.1",
"expo-secure-store": "~10.1.0",
"expo-task-manager": "^9.1.0",
"expo-web-browser": "~9.1.0",
"extract-files": "^5.0.0",
"filesize": "^3.5.11",
"graphql": "^14.3.1",
"graphql-scalars": "^1.10.1",
"graphql-tag": "^2.11.0",
"i18next": "^11.2.3",
"immutability-helper": "^2.6.2",
"jest-expo": "^38.0.0",
"lodash": "^4.17.4",
"metro-minify-terser": "^0.59.0",
"metro-react-native-babel-preset": "^0.59.0",
"minilog": "^3.1.0",
"native-base": "^2.13.5",
"prop-types": "^15.6.0",
"react": "^17.0.1",
"react-debounce-input": "^3.2.3",
"react-i18next": "^11.8.10",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-collapsible": "^1.5.3",
"react-native-easy-grid": "^0.2.2",
"react-native-elements": "^0.19.1",
"react-native-gesture-handler": "~1.10.2",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-mime-types": "^2.2.1",
"react-native-modal": "^5.4.0",
"react-native-reanimated": "~2.1.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "~3.0.0",
"react-native-simple-picker": "^3.1.1",
"react-redux": "^7.2.2",
"redux": "^4.0.1",
"subscriptions-transport-ws": "^0.9.16",
"uuid": "^3.3.2"
},
"devDependencies": {
"@bam.tech/react-native-graphql-transformer": "^0.1.4",
"@types/expo": "^33.0.1",
"@types/jest": "^24.0.13",
"@types/react-native-keyboard-spacer": "^0.4.1",
"@types/react-navigation": "^3.0.5",
"@types/react-test-renderer": "^16.0.2",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"caporal": "^0.10.0",
"chai": "^4.1.2",
"chai-http": "^4.0.0",
"compression": "^1.7.1",
"connect": "^3.6.5",
"cross-env": "^5.1.1",
"exp": "^57.2.1",
"expo-react-native-adapter": "^3.0.1",
"expo-yarn-workspaces": "^1.6.0",
"freeport-async": "^1.1.1",
"image-size": "^0.6.2",
"jsdom": "^11.5.1",
"mkdirp": "^0.5.1",
"react-addons-test-utils": "^16.0.0-alpha.3",
"react-test-renderer": "16.13.1",
"request": "^2.83.0",
"rimraf": "^2.6.2",
"ws": "^5.1.1"
},
"peerDependencies": {
"eslint": "*"
}
}
package.json (main package file)
{
"name": "mivao",
"private": true,
"version": "1.0.0",
"engines": {
"yarn": ">= 1.0.0"
},
"scripts": {
"build": "lerna run --scope={server,client,mobile} --parallel build --stream",
"clean": "lerna run clean --stream",
"clean:tmpfiles": "rimraf /tmp/yarn--* /tmp/metro-cache /tmp/jest_rs",
"clean:all": "yarn clean && yarn clean:tmpfiles",
"start": "lerna run --scope=server start --stream",
"watch": "lerna run --scope={server,client} --parallel watch --stream",
"watch:all": "lerna run --scope={server,client,mobile} --parallel watch --stream",
"watch:android": "npm-run-all --parallel __watch-server __watch-android",
"watch:ios": "npm-run-all --parallel __watch-server __watch-ios",
"storybook": "lerna run --scope=client storybook --stream",
"__watch-android": "yarn workspace mobile watch:android",
"__watch-ios": "yarn workspace mobile watch:ios",
"__watch-client": "cross-env SSR=false lerna run --scope=client watch --stream",
"__watch-server": "cross-env SSR=false lerna run --scope=server watch --stream",
"cli": "node tools/cli",
"stripe:setup": "lerna run --scope=server stripe:setup",
"seed": "lerna run --scope=server seed --stream",
"migrate": "lerna run --scope=server migrate",
"rollback": "lerna run --scope=server rollback",
"exp": "yarn --cwd packages/mobile expo",
"exp-login": "lerna run --scope=mobile exp-login --stream",
"exp-publish": "lerna run --scope=mobile exp-publish --stream",
"exp-publish:develop": "lerna run --scope=mobile exp-publish:develop --stream",
"exp-publish:rc": "lerna run --scope=mobile exp-publish:rc --stream",
"test": "yarn tests && yarn lint",
"tests": "lerna run --parallel tests --stream",
"tests:watch": "lerna run --parallel tests:watch --stream",
"lint": "yarn eslint && yarn tslint",
"eslint": "eslint --fix --ext js --ext jsx --ext json .",
"tslint": "tslint --fix -p tsconfig.json -c tslint.json",
"precommit": "lint-staged",
"license:check": "yarn run license-checker --production --excludePrivatePackages --summary --direct --failOn \"AGPL-1.0-only;AGPL-1.0-or-later;AGPL-3.0-only;AGPL-3.0-or-later;CNRI-Python-GPL-Compatible;GPL-1.0-only;GPL-1.0-or-later;GPL-2.0-only;GPL-2.0-or-later;GPL-3.0-only;GPL-3.0-or-later;LGPL-2.0-only;LGPL-2.0-or-later;LGPL-2.1-only;LGPL-2.1-or-later;LGPL-3.0-only;LGPL-3.0-or-later;LGPLLR;NGPL\"",
"license:report": "yarn run license-checker --production --excludePrivatePackages --direct --out licenses.txt --failOn \"AGPL-1.0-only;AGPL-1.0-or-later;AGPL-3.0-only;AGPL-3.0-or-later;CNRI-Python-GPL-Compatible;GPL-1.0-only;GPL-1.0-or-later;GPL-2.0-only;GPL-2.0-or-later;GPL-3.0-only;GPL-3.0-or-later;LGPL-2.0-only;LGPL-2.0-or-later;LGPL-2.1-only;LGPL-2.1-or-later;LGPL-3.0-only;LGPL-3.0-or-later;LGPLLR;NGPL\"",
"license:export": "yarn run license-checker --production --excludePrivatePackages --direct --out config/licenses.json --json --failOn \"AGPL-1.0-only;AGPL-1.0-or-later;AGPL-3.0-only;AGPL-3.0-or-later;CNRI-Python-GPL-Compatible;GPL-1.0-only;GPL-1.0-or-later;GPL-2.0-only;GPL-2.0-or-later;GPL-3.0-only;GPL-3.0-or-later;LGPL-2.0-only;LGPL-2.0-or-later;LGPL-2.1-only;LGPL-2.1-or-later;LGPL-3.0-only;LGPL-3.0-or-later;LGPLLR;NGPL\""
},
"lint-staged": {
"*.{js,jsx,json}": [
"eslint --fix",
"git add"
],
"*.{ts,tsx}": [
"tslint --fix",
"git add"
],
"*.graphql": [
"prettier --parser graphql --write",
"git add"
]
},
"repository": {
"type": "git",
"url": "https://gitlab.com/mivao/app-mivao.git"
},
"bugs": {
"url": "https://mivao.atlassian.net/secure/RapidBoard.jspa?rapidView=3&atlOrigin=eyJpIjoiZDBkZTBiMWVmODcxNGMwYWFlM2Y2MDkxYzMxODAwYjkiLCJwIjoiaiJ9"
},
"homepage": "https://mivao.de",
"keywords": [
"App",
"Selbstmanagement",
"Aufgabenplan"
],
"author": "Michael Fürmann",
"license": "closed",
"workspaces": [
"config",
"packages/*",
"modules/app/**/client-react",
"modules/app/**/client-react-native",
"modules/app/**/common",
"modules/app/**/common-react",
"modules/app/**/server-ts",
"modules/coremodules/**/client-react",
"modules/coremodules/**/client-react-native",
"modules/coremodules/**/common",
"modules/coremodules/**/common-react",
"modules/coremodules/**/server-ts",
"modules/util/*"
],
"greenkeeper": {
"ignore": [
"graphql"
]
},
"devDependencies": {
"@alienfast/i18next-loader": "^1.0.15",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-destructuring": "^7.8.3",
"@babel/plugin-transform-for-of": "^7.8.4",
"@babel/plugin-transform-regenerator": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/preset-flow": "^7.8.3",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"@babel/register": "^7.8.3",
"@babel/runtime": "^7.8.4",
"@loadable/babel-plugin": "^5.10.0",
"@loadable/server": "^5.12.0",
"@loadable/webpack-plugin": "^5.7.1",
"@tailwindcss/postcss7-compat": "npm:@tailwindcss/postcss7-compat",
"autoprefixer": "^9.5.0",
"babel-core": "^7.0.0-0",
"babel-eslint": "^10.0.1",
"babel-jest": "^25.1.0",
"babel-loader": "^8.0.6",
"babel-plugin-dynamic-import-node": "^2.2.0",
"babel-plugin-import": "^1.7.0",
"babel-preset-minify": "^0.5.0-alpha.5a128fd5",
"clean-webpack-plugin": "^1.0.1",
"core-js": "^3.1.3",
"css-loader": "^1.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jest": "^22.5.1",
"eslint-plugin-json": "^1.4.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^1.6.0",
"file-loader": "^2.0.0",
"fork-ts-checker-webpack-plugin": "^0.4.9",
"hard-source-webpack-plugin": "https://github.com/sysgears/hard-source-webpack-plugin",
"html-webpack-plugin": "^3.2.0",
"http-proxy-middleware": "^0.19.0",
"husky": "^1.1.2",
"ignore-loader": "^0.1.2",
"isomorphic-style-loader": "^5.1.0",
"jest": "^25.1.0",
"jest-transform-graphql": "^2.1.0",
"jest-transform-stub": "^2.0.0",
"lerna": "^4.0.0",
"less": "^3.0.2",
"less-loader": "^4.1.0",
"license-checker": "^25.0.1",
"lint-staged": "^7.1.2",
"mini-css-extract-plugin": "^0.4.1",
"node-hmr-plugin": "^1.0.1",
"node-sass": "^4.7.2",
"npm-run-all": "^4.1.5",
"openurl": "^1.1.1",
"postcss-loader": "^3.0.0",
"prettier": "^2.4.1",
"qrcode-terminal": "^0.12.0",
"raw-loader": "^0.5.1",
"regenerator-runtime": "^0.13.2",
"sass-loader": "^7.1.0",
"shelljs": "^0.8.1",
"source-list-map": "^2.0.0",
"style-loader": "^1.0.2",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"ts-loader": "^4.5.0",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.3.0",
"typescript": "^4.4.3",
"uglifyjs-webpack-plugin": "^1.3.0",
"url-loader": "^1.0.1",
"wait-on": "^3.2.0",
"webpack": "^4.33.0",
"webpack-cli": "^3.3.3",
"webpack-dev-middleware": "^3.1.3",
"webpack-dev-server": "^3.1.5",
"webpack-hot-middleware": "^2.22.3",
"webpack-manifest-plugin": "^2.0.3",
"webpack-merge": "^4.1.4",
"webpack-node-externals": "^1.7.2",
"webpack-sources": "^1.1.0",
"webpack-virtual-modules": "^0.1.10",
"whatwg-fetch": "^2.0.4"
},
"dependencies": {
"classnames": "^2.3.1",
"inquirer": "^6.2.2",
"iterall": "^1.2.2",
"lodash": "^4.17.15",
"upath": "^1.1.0",
"watchpack": "^2.1.0"
},
"resolutions": {
"chokidar": "^3.4.3",
"fbjs": "^3.0.0",
"hard-source-webpack-plugin": "https://github.com/sysgears/hard-source-webpack-plugin",
"kleur": "^3.0.3",
"immutability-helper": "2.8.1",
"graphql": "14.3.1",
"iterall": "^1.2.2",
"upath": "^1.1.0",
"ts-invariant": "^0.6.2"
}
}