0

When I normally running my react-native from visual code in Android Virtual Device (Emulator) via terminal with npx react-native run android, suddenly I'm facing this error

 1. info Running jetifier to migrate libraries to AndroidX. You can
    disable it using "--no-jetifier" flag. Jetifier found 954 file(s) to
    forward-jetify. Using 8 workers... info Starting JS server... info
    Launching emulator... error Failed to launch emulator. Reason: Could
    not start emulator within 30 seconds.. warn Please launch an
    emulator manually or connect a device. Otherwise app may fail to
    launch. info Installing the app...
    
    > Configure project :react-native-firebase_app :react-native-firebase_app package.json found at
    C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_app:firebase.bom using default value: 28.1.0
    :react-native-firebase_app:play.play-services-auth using default
    value: 19.0.0 :react-native-firebase_app package.json found at
    C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\@react-native-firebase\app\package.json
    :react-native-firebase_app:version set from package.json: 12.1.0
    (12,1,0 - 12001000) :react-native-firebase_app:android.compileSdk
    using custom value: 29 :react-native-firebase_app:android.targetSdk
    using custom value: 29 :react-native-firebase_app:android.minSdk
    using custom value: 21
    :react-native-firebase_app:reactNativeAndroidDir
    C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\react-native\android
    
    > Task :app:installDebug FAILED Skipping device 'emulator-5554' (emulator-5554): Device is OFFLINE. 64 actionable tasks: 2 executed,
    62 up-to-date
    
    FAILURE: Build failed with an exception.
    
    * What went wrong: Execution failed for task ':app:installDebug'.
    > com.android.builder.testing.api.DeviceException: No online devices found.
    
    * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 16s
    
    error Failed to install the app. Make sure you have the Android
    development environment set up:
    https://reactnative.dev/docs/environment-setup. Error: Command
    failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
    
    FAILURE: Build failed with an exception.
    
    * What went wrong: Execution failed for task ':app:installDebug'.
    > com.android.builder.testing.api.DeviceException: No online devices found.
    
    * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 16s
    
        at makeError (C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\execa\index.js:174:9)
        at C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\execa\index.js:278:16
        at processTicksAndRejections (internal/process/task_queues.js:94:5)
        at async runOnAllDevices (C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
        at async Command.handleAction (C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
    info Run CLI with --verbose flag for more details.
James Z
  • 12,209
  • 10
  • 24
  • 44
Mohammed-Dev
  • 41
  • 1
  • 2

1 Answers1

1

I don't know if you already fixed this but I just solved it! I added more space to the Android Virtual Device. You have to:

  1. Edit the device or create a new one
  2. On the ¨Verify Configuration¨ page, click on ¨Show Advanced Settings¨
  3. Scroll down to ¨Memory and Storage¨
  4. Change the Internal Storage MB amount

Initially the device that I've created had 2048MB and so I changed it to 6000MB but that wasn't enough so I finally put 10000MB of Internal Storage and with that amount I didn't get this error anymore.

Hope it works, good luck!

Meli14
  • 11
  • 1