facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.05k stars 24.19k forks source link

The app runs correctly with expo start, but after building the APK, it gets stuck on the launch screen. #39027

Closed bielb2 closed 1 year ago

bielb2 commented 1 year ago

Description

The application functions flawlessly during the development phase when launched with the command expo start. However, an issue arises after the APK is built and installed on a device. The app appears to become unresponsive, getting stuck on the launch screen without progressing further. This behavior is not observed when running the app through the development server. The discrepancy between the behavior during development and the behavior of the APK suggests there might be an underlying problem that arises specifically when building the Android package.

some package.json info


"overrides": {
    "react-error-overlay": "6.0.9"
  },
  "dependencies": {
    "@expo-google-fonts/space-grotesk": "^0.2.2",
    "@expo/config-plugins": "~6.0.0",
    "@expo/metro-config": "^0.7.1",
    "@expo/webpack-config": "^18.0.1",
    "@georstat/react-native-image-gallery": "^1.1.0",
    "@react-native-async-storage/async-storage": "1.17.11",
    "@react-native-community/netinfo": "9.3.7",
    "@react-native-masked-view/masked-view": "0.2.8",
    "@react-navigation/bottom-tabs": "^6.3.2",
    "@react-navigation/native": "^6.0.2",
    "@react-navigation/native-stack": "^6.0.2",
    "apisauce": "2.1.5",
    "date-fns": "^2.29.2",
    "expo": "^48.0.15",
    "expo-application": "~5.1.1",
    "expo-constants": "~14.2.1",
    "expo-crypto": "~12.2.1",
    "expo-dev-client": "~2.2.1",
    "expo-device": "~5.2.1",
    "expo-file-system": "~15.2.2",
    "expo-font": "~11.1.1",
    "expo-image-picker": "~14.1.1",
    "expo-linear-gradient": "~12.1.2",
    "expo-linking": "~4.0.1",
    "expo-localization": "~14.1.1",
    "expo-media-library": "~15.2.3",
    "expo-module-scripts": "^3.0.11",
    "expo-modules-core": "~1.2.3",
    "expo-sharing": "~11.2.2",
    "expo-splash-screen": "~0.18.1",
    "expo-status-bar": "~1.4.4",
    "firebase": "^10.1.0",
    "formik": "^2.4.2",
    "i18n-js": "3.9.2",
    "jsc-android": "^250231.0.0",
    "mobx": "6.6.0",
    "mobx-react-lite": "3.4.0",
    "mobx-state-tree": "5.1.5",
    "react": "18.2.0",
    "react-native": "0.71.12",
    "react-native-bootsplash": "4.5.0",
    "react-native-gesture-handler": "~2.9.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-mask-input": "^1.2.3",
    "react-native-reanimated": "~2.14.4",
    "react-native-safe-area-context": "4.5.0",
    "react-native-screens": "~3.20.0",
    "reactotron-mst": "3.1.4",
    "reactotron-react-js": "^3.3.7",
    "reactotron-react-native": "5.0.3",
    "yup": "^1.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native-community/cli-platform-ios": "^8.0.2",
    "@rnx-kit/metro-config": "^1.3.5",
    "@rnx-kit/metro-resolver-symlinks": "^0.1.26",
    "@types/i18n-js": "3.8.2",
    "@types/jest": "^29.2.1",
    "@types/react": "~18.0.27",
    "@types/react-native": "^0.72.2",
    "@types/react-test-renderer": "^18.0.0",
    "@typescript-eslint/eslint-plugin": "^5.59.0",
    "@typescript-eslint/parser": "^5.59.0",
    "babel-jest": "^29.2.1",
    "babel-loader": "8.2.5",
    "babel-plugin-root-import": "^6.6.0",
    "eslint": "8.17.0",
    "eslint-config-prettier": "8.5.0",
    "eslint-config-standard": "17.0.0",
    "eslint-config-universe": "^11.3.0",
    "eslint-plugin-import": "2.26.0",
    "eslint-plugin-n": "^15.0.0",
    "eslint-plugin-node": "11.1.0",
    "eslint-plugin-promise": "6.0.0",
    "eslint-plugin-react": "7.30.0",
    "eslint-plugin-react-native": "4.0.0",
    "expo-modules-autolinking": "~1.1.0 || ~1.2.0",
    "fbjs-scripts": "3.0.1",
    "husky": "^8.0.3",
    "jest": "^29.2.1",
    "jest-circus": "29",
    "jest-environment-node": "29",
    "jest-expo": "^48.0.0",
    "metro-config": "0.75.1",
    "metro-react-native-babel-preset": "0.75.1",
    "metro-source-map": "0.75.1",
    "mocha": "6",
    "patch-package": "6.4.7",
    "postinstall-prepare": "1.0.1",
    "prettier": "2.8.8",
    "query-string": "^7.0.1",
    "react-devtools-core": "4.24.7",
    "react-dom": "18.2.0",
    "react-native-web": "~0.18.7",
    "react-test-renderer": "18.2.0",
    "reactotron-core-client": "^2.8.10",
    "regenerator-runtime": "^0.13.4",
    "ts-jest": "29",
    "typescript": "^4.9.4"
  },
  "resolutions": {
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "@expo/config-plugins": "~6.0.0",
    "@expo/prebuild-config": "~6.0.0"
  },
  "engines": {
    "node": ">=18"
  },

adb log cat:

❯ adb logcat -v color -e com.acesso_fotos

--------- beginning of system
08-15 18:15:12.523   539  4615 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.acesso_fotos cmp=com.acesso_fotos/.MainActivity} from uid 1000
08-15 18:15:12.542   539   567 I ActivityManager: Start proc 18416:com.acesso_fotos/u0a155 for pre-top-activity {com.acesso_fotos/com.acesso_fotos.MainActivity}
--------- beginning of main
08-15 18:15:12.580 18416 18416 V GraphicsEnvironment: ANGLE Developer option for 'com.acesso_fotos' set to: 'default'
08-15 18:15:13.489   539  4615 D ConnectivityService: requestNetwork for uid/pid:10155/18416 activeRequest: null callbackRequest: 368 [NetworkRequest [ REQUEST id=369, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10155 RequestorUid: 10155 RequestorPkg: com.acesso_fotos] ]] callback flags: 0 priority: 2147483647
08-15 18:15:13.491   539   640 D WifiNetworkFactory: got request NetworkRequest [ REQUEST id=369, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10155 RequestorUid: 10155 RequestorPkg: com.acesso_fotos] ]
08-15 18:15:13.491   539   640 D UntrustedWifiNetworkFactory: got request NetworkRequest [ REQUEST id=369, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10155 RequestorUid: 10155 RequestorPkg: com.acesso_fotos] ]
08-15 18:15:13.492   539   640 D OemPaidWifiNetworkFactory: got request NetworkRequest [ REQUEST id=369, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10155 RequestorUid: 10155 RequestorPkg: com.acesso_fotos] ]

expo doctor:

❯ npx expo-doctor
✔ Check Expo config for common issues
✔ Check package.json for common issues
✖ Check dependencies for packages that should not be installed directly
✖ Check for common project setup issues
✔ Check npm/ yarn versions
✖ Check Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that native modules use compatible support package versions for installed Expo SDK

Detailed check results:

Error: Problem validating fields in app.json. Learn more.
 • Field: ios/bundleIdentifier - 'ios/bundleIdentifier' should be a iOS bundle identifier notation unique name for your app. For example, `host.exp.expo`, where `exp.host` is our domain and `expo` is our app name..

The package "expo-modules-core" should not be installed directly in your project. It is a dependency of other Expo packages, which will install it automatically as needed.
The package "expo-modules-autolinking" should not be installed directly in your project. It is a dependency of other Expo packages, which will install it automatically as needed.
The package  "@types/react-native" should not be installed directly in your project, as types are included with the "react-native" package.

This project has native project folders but is also configured to use Prebuild. EAS Build will not sync your native configuration if the ios or android folders are present. Add these folders to your .gitignore file if you intend to use prebuild (aka "managed" workflow).

React Native Version

0.71.8

Output of npx react-native info

info Fetching system and libraries information... System: OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish) CPU: (12) x64 Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz Memory: 4.54 GB / 15.52 GB Shell: 5.8.1 - /usr/bin/zsh Binaries: Node: 16.20.1 - ~/.nvm/versions/node/v16.20.1/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.19.4 - ~/.nvm/versions/node/v16.20.1/bin/npm Watchman: Not Found SDKs: Android SDK: Not Found IDEs: Android Studio: Not Found Languages: Java: 20.0.1 - /home/linuxbrew/.linuxbrew/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.8 => 0.71.8 npmGlobalPackages: react-native: Not Found info React Native v0.72.4 is now available (your project is running on v0.71.8). info Changelog: https://github.com/facebook/react-native/releases/tag/v0.72.4 info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.71.8 info For more info, check out "https://reactnative.dev/docs/upgrading".

Steps to reproduce

1 - ./gradlew clean 2 - ./gradlew bundleRelease

Snack, screenshot, or link to a repository

.

github-actions[bot] commented 1 year ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
github-actions[bot] commented 1 year ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.71.12. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
github-actions[bot] commented 1 year ago
:warning: Issue is Related to Expo
:information_source: It looks like your issue is related to Expo and not React Native core. Please open your issue in Expo's repository. If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open.