question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🐛 App crashes after adding enableDangerousExperimentalLeanBuilds in app.json

See original GitHub issue

🐛 Bug Report

package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "expo": "~39.0.2",
    "expo-status-bar": "~1.0.2",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz",
    "react-native-web": "~0.13.12"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0"
  },
  "private": true
}

app.json

{
  "expo": {
    "name": "my_app",
    "slug": "my_app",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "android": {
      "package": "com.myapp",
      "versionCode": 1,
      "enableDangerousExperimentalLeanBuilds": true
    }
  }
}

The app works fine in development, but when I add enableDangerousExperimentalLeanBuilds in app.json file and I build the App Bundle, the application crashes after installing and opening it on my device. I thought the problem was from the splash screen package, but after spending the whole day testing. I finally could figure out the problem.

The problem happens only with the latest expo SDK 39

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
shahidcodescommented, Jan 23, 2021

@brentvatne Unfortunately for me its throwing this error after installing expo-updates and expo-splash-screen when I run expo build:android -t apk

Cannot find module 'jsonfile/utils'
Require stack:
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\configure-splash-screen\node_modules\fs-extra\lib\json\output-json.js
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\configure-splash-screen\node_modules\fs-extra\lib\json\index.js
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\configure-splash-screen\node_modules\fs-extra\lib\index.js
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\configure-splash-screen\build\ios\index.js- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\configure-splash-screen\build\index.js    
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\config-plugins\build\android\SplashScreen.js
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\config-plugins\build\android\index.js     
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\config-plugins\build\index.js
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\config\build\plugins\withConfigPlugins.js 
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\config\build\Config.js
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\node_modules\@expo\config\build\index.js
- E:\projects\react-native\rnapp\node_modules\@expo\metro-config\build\ExpoMetroConfig.js
- E:\projects\react-native\rnapp\metro.config.js
- E:\projects\react-native\rnapp\node_modules\cosmiconfig\node_modules\import-fresh\index.js
- E:\projects\react-native\rnapp\node_modules\cosmiconfig\dist\loaders.js
- E:\projects\react-native\rnapp\node_modules\cosmiconfig\dist\createExplorer.js
- E:\projects\react-native\rnapp\node_modules\cosmiconfig\dist\index.js
- E:\projects\react-native\rnapp\node_modules\metro-config\src\loadConfig.js
- E:\projects\react-native\rnapp\node_modules\metro-config\src\index.js
- E:\projects\react-native\rnapp\node_modules\metro\src\commands\build.js
- E:\projects\react-native\rnapp\node_modules\metro\src\index.js
- C:\Users\shaah\AppData\Roaming\npm\pnpm-global\4\node_modules\.pnpm\@expo\dev-server@0.1.48\node_modules\@expo\dev-server\build\MetroDevServer.js
- C:\Users\shaah\AppData\Roaming\npm\pnpm-global\4\node_modules\.pnpm\@expo\xdl@59.0.14_typescript@4.1.3\node_modules\@expo\xdl\build\Project.js- C:\Users\shaah\AppData\Roaming\npm\pnpm-global\4\node_modules\.pnpm\@expo\xdl@59.0.14_typescript@4.1.3\node_modules\@expo\xdl\build\xdl.js    
- C:\Users\shaah\AppData\Roaming\npm\pnpm-global\4\node_modules\.pnpm\expo-cli@4.0.17_typescript@4.1.3\node_modules\expo-cli\build\exp.js       
- C:\Users\shaah\AppData\Roaming\npm\pnpm-global\4\node_modules\.pnpm\expo-cli@4.0.17_typescript@4.1.3\node_modules\expo-cli\bin\expo.js  

P.S. Tried install jsonfile but got new error Error: Cannot find module 'core-js/es/string/match-all'

Fixed -

  • installed both expo-updates and expo-splash-screen
  • reinstalled node_modules
  • everything is working now
1reaction
brentvatnecommented, Oct 5, 2020

sorry, you may have to eject if you would like more control over your app size for now. we’ll look into this but it’s an experimental feature and we don’t offer any stability guarantees for it

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Expo build crashed when using ... - Stack Overflow
After i searched in google i found that by adding this "enableDangerousExperimentalLeanBuilds" : true to the app.json file will reduce the ...
Read more >
Diagnosing issues using crash reports and device logs
Inspect your running app to isolate bugs, locate crashes, identify excess system resource usage, visualize memory bugs, and investigate view layout problems.
Read more >
Expo app crashes when attempting to write a new record with ...
I created an Expo React Native app using the “Quick start with Expo” documentation. I modified the schema and variable names to match...
Read more >
Troubleshooting build errors and crashes - Expo Documentation
A reference for troubleshooting build errors and crashes when using EAS Build. ... This particular error means that the app is importing ....
Read more >
App Center Crashes for React Native - Microsoft Learn
The log is first written to the device's storage and when the user starts the app again, the crash report will be sent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found