Error failed to launch emulator reason emulator exited before boot

I just can't compile and run my react native app, and I'm getting this message : FAILURE: Build failed with an exception. Where: Script 'C:UsersmeReactNativeMyAppnode_modules@react...

hi, i’m facing this problem and its weird cause it happened when i created a new project with react-native init two days ago. i can run the old project but when i try to use command react-native run-android in the new project it gives me an error.( i don’t even have a build folder to delete ((: )
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
Memory: 2.20 GB / 7.95 GB
Binaries:
Node: 8.11.3 — C:Program Filesnodejsnode.EXE
npm: 5.6.0 — C:Program Filesnodejsnpm.CMD
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2

info Running jetifier to migrate libraries to AndroidX. You can disable it using «—no-jetifier» flag.
Jetifier found 863 file(s) to forward-jetify. Using 8 workers…
info Starting JS server…
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
info Launching emulator…
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app…

FAILURE: Build failed with an exception.

  • Where:
    Script ‘C:UsersomidazmDesktopweblearningreact-nativegreen26node_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 182

  • What went wrong:
    A problem occurred evaluating script.

Unable to determine the current character, it is not a string, number, array, or object

The current character read is ‘C’ with an int value of 67
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
C:UsersomidazmDesktopweblearningreact-nativegreen26node_modulesreact-nativecli.js{ «root»: «C:UsersomidazmDesktopweblearningreact-nativegreen26», «reactNativePath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26node_modulesreact-native», «dependencies»: {}, «commands»: [ { «name»: «log-ios», «description»: «starts iOS device syslog tail» }, { «name»: «run-ios», «description»: «builds your app and starts it on iOS simulator», «examples»: [ { «desc»: «Run on a different simulator, e.g. iPhone 5», «cmd»: «react-native run-ios —simulator «iPhone 5″» }, { «desc»: «Pass a non-standard location of iOS directory», «cmd»: «react-native run-ios —project-path «./app/ios»» }, { «desc»: «Run on a connected device, e.g. Max’s iPhone», «cmd»: «react-native run-ios —device «Max’s iPhone»» }, { «desc»: «Run on the AppleTV simulator», «cmd»: «react-native run-ios —simulator «Apple TV» —scheme «helloworld-tvOS»» } ], «options»: [ { «name»: «—simulator [string]», «description»: «Explicitly set simulator to use. Optionally include iOS version betweenparenthesis at the end to match an exact version: «iPhone 6 (10.0)»», «default»: «iPhone 11» }, { «name»: «—configuration [string]», «description»: «Explicitly set the scheme configuration to use», «default»: «Debug» }, { «name»: «—scheme [string]», «description»: «Explicitly set Xcode scheme to use» }, { «name»: «—project-path [string]», «description»: «Path relative to project root where the Xcode project (.xcodeproj) lives.», «default»: «ios» }, { «name»: «—device [string]», «description»: «Explicitly set device to use by name. The value is not required if you have a single device connected.» }, { «name»: «—udid [string]», «description»: «Explicitly set device to use by udid» }, { «name»: «—no-packager», «description»: «Do not launch packager while building» }, { «name»: «—verbose», «description»: «Do not use xcpretty even if installed» }, { «name»: «—port [number]», «default»: 8081 }, { «name»: «—terminal [string]», «description»: «Launches the Metro Bundler in a new window using the specified terminal path.» } ] }, { «name»: «log-android», «description»: «starts logkitty» }, { «name»: «run-android», «description»: «builds your app and starts it on a connected Android emulator or device», «options»: [ { «name»: «—root [string]», «description»: «Override the root directory for the android build (which contains the android directory)», «default»: «» }, { «name»: «—variant [string]», «description»: «Specify your app’s build variant», «default»: «debug» }, { «name»: «—appFolder [string]», «description»: «Specify a different application folder name for the android source. If not, we assume is «app»», «default»: «app» }, { «name»: «—appId [string]», «description»: «Specify an applicationId to launch after build.», «default»: «» }, { «name»: «—appIdSuffix [string]», «description»: «Specify an applicationIdSuffix to launch after build.», «default»: «» }, { «name»: «—main-activity [string]», «description»: «Name of the activity to start», «default»: «MainActivity» }, { «name»: «—deviceId [string]», «description»: «builds your app and starts it on a specific device/simulator with the given device id (listed by running «adb devices» on the command line).» }, { «name»: «—no-packager», «description»: «Do not launch packager while building» }, { «name»: «—port [number]», «default»: 8081 }, { «name»: «—terminal [string]», «description»: «Launches the Metro Bundler in a new window using the specified terminal path.» }, { «name»: «—tasks [list]», «description»: «Run custom Gradle tasks. By default it’s «installDebug»» }, { «name»: «—no-jetifier», «description»: «Do not run «jetifier» – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don’t support AndroidX yet. See more at: https://www.npmjs.com/package/jetifier.», «default»: false } ] } ], «assets»: [], «platforms»: { «ios»: {}, «android»: {} }, «haste»: { «providesModuleNodeModules»: [ «react-native» ], «platforms»: [ «ios», «android» ] }, «project»: { «ios»: { «sourceDir»: «C:UsersomidazmDesktopweblearningreact-nativegreen26ios», «folder»: «C:UsersomidazmDesktopweblearningreact-nativegreen26», «pbxprojPath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26iosgreen26.xcodeprojproject.pbxproj», «podfile»: «C:UsersomidazmDesktopweblearningreact-nativegreen26iosPodfile», «podspecPath»: null, «projectPath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26iosgreen26.xcodeproj», «projectName»: «green26.xcodeproj», «libraryFolder»: «Libraries», «sharedLibraries»: [], «plist»: [], «scriptPhases»: [] }, «android»: { «sourceDir»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidapp», «isFlat»: false, «folder»: «C:UsersomidazmDesktopweblearningreact-nativegreen26», «stringsPath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainresvaluesstrings.xml», «manifestPath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainAndroidManifest.xml», «buildGradlePath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidappbuild.gradle», «settingsGradlePath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidsettings.gradle», «assetsPath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainassets», «mainFilePath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainjavacomgreen26MainApplication.java», «packageName»: «com.green26» } }}
^

  • 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 23s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with —verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • Where:
    Script ‘C:UsersomidazmDesktopweblearningreact-nativegreen26node_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 182

  • What went wrong:
    A problem occurred evaluating script.

Unable to determine the current character, it is not a string, number, array, or object

The current character read is ‘C’ with an int value of 67
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
C:UsersomidazmDesktopweblearningreact-nativegreen26node_modulesreact-nativecli.js{ «root»: «C:UsersomidazmDesktopweblearningreact-nativegreen26», «reactNativePath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26node_modulesreact-native», «dependencies»: {}, «commands»: [ { «name»: «log-ios», «description»: «starts iOS device syslog tail» }, { «name»: «run-ios», «description»: «builds your app and starts it on iOS simulator», «examples»: [ { «desc»: «Run on a different simulator, e.g. iPhone 5», «cmd»: «react-native run-ios —simulator «iPhone 5″» }, { «desc»: «Pass a non-standard location of iOS directory», «cmd»: «react-native run-ios —project-path «./app/ios»» }, { «desc»: «Run on a connected device, e.g. Max’s iPhone», «cmd»: «react-native run-ios —device «Max’s iPhone»» }, { «desc»: «Run on the AppleTV simulator», «cmd»: «react-native run-ios —simulator «Apple TV» —scheme «helloworld-tvOS»» } ], «options»: [ { «name»: «—simulator [string]», «description»: «Explicitly set simulator to use. Optionally include iOS version betweenparenthesis at the end to match an exact version: «iPhone 6 (10.0)»», «default»: «iPhone 11» }, { «name»: «—configuration [string]», «description»: «Explicitly set the scheme configuration to use», «default»: «Debug» }, { «name»: «—scheme [string]», «description»: «Explicitly set Xcode scheme to use» }, { «name»: «—project-path [string]», «description»: «Path relative to project root where the Xcode project (.xcodeproj) lives.», «default»: «ios» }, { «name»: «—device [string]», «description»: «Explicitly set device to use by name. The value is not required if you have a single device connected.» }, { «name»: «—udid [string]», «description»: «Explicitly set device to use by udid» }, { «name»: «—no-packager», «description»: «Do not launch packager while building» }, { «name»: «—verbose», «description»: «Do not use xcpretty even if installed» }, { «name»: «—port [number]», «default»: 8081 }, { «name»: «—terminal [string]», «description»: «Launches the Metro Bundler in a new window using the specified terminal path.» } ] }, { «name»: «log-android», «description»: «starts logkitty» }, { «name»: «run-android», «description»: «builds your app and starts it on a connected Android emulator or device», «options»: [ { «name»: «—root [string]», «description»: «Override the root directory for the android build (which contains the android directory)», «default»: «» }, { «name»: «—variant [string]», «description»: «Specify your app’s build variant», «default»: «debug» }, { «name»: «—appFolder [string]», «description»: «Specify a different application folder name for the android source. If not, we assume is «app»», «default»: «app» }, { «name»: «—appId [string]», «description»: «Specify an applicationId to launch after build.», «default»: «» }, { «name»: «—appIdSuffix [string]», «description»: «Specify an applicationIdSuffix to launch after build.», «default»: «» }, { «name»: «—main-activity [string]», «description»: «Name of the activity to start», «default»: «MainActivity» }, { «name»: «—deviceId [string]», «description»: «builds your app and starts it on a specific device/simulator with the given device id (listed by running «adb devices» on the command line).» }, { «name»: «—no-packager», «description»: «Do not launch packager while building» }, { «name»: «—port [number]», «default»: 8081 }, { «name»: «—terminal [string]», «description»: «Launches the Metro Bundler in a new window using the specified terminal path.» }, { «name»: «—tasks [list]», «description»: «Run custom Gradle tasks. By default it’s «installDebug»» }, { «name»: «—no-jetifier», «description»: «Do not run «jetifier» – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don’t support AndroidX yet. See more at: https://www.npmjs.com/package/jetifier.», «default»: false } ] } ], «assets»: [], «platforms»: { «ios»: {}, «android»: {} }, «haste»: { «providesModuleNodeModules»: [ «react-native» ], «platforms»: [ «ios», «android» ] }, «project»: { «ios»: { «sourceDir»: «C:UsersomidazmDesktopweblearningreact-nativegreen26ios», «folder»: «C:UsersomidazmDesktopweblearningreact-nativegreen26», «pbxprojPath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26iosgreen26.xcodeprojproject.pbxproj», «podfile»: «C:UsersomidazmDesktopweblearningreact-nativegreen26iosPodfile», «podspecPath»: null, «projectPath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26iosgreen26.xcodeproj», «projectName»: «green26.xcodeproj», «libraryFolder»: «Libraries», «sharedLibraries»: [], «plist»: [], «scriptPhases»: [] }, «android»: { «sourceDir»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidapp», «isFlat»: false, «folder»: «C:UsersomidazmDesktopweblearningreact-nativegreen26», «stringsPath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainresvaluesstrings.xml», «manifestPath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainAndroidManifest.xml», «buildGradlePath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidappbuild.gradle», «settingsGradlePath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidsettings.gradle», «assetsPath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainassets», «mainFilePath»: «C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainjavacomgreen26MainApplication.java», «packageName»: «com.green26» } }}
^

  • 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 23s

at checkExecSyncError (child_process.js:601:13)
at execFileSync (child_process.js:621:13)
at runOnAllDevices (C:UsersomidazmDesktopweblearningreact-nativegreen26node_modules@react-native-communitycli-platform-androidbuildcommandsrunAndroidrunOnAllDevices.js:94:39)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

Содержание

  1. can’t compile and run my react native app #25936
  2. Comments
  3. Steps To Reproduce
  4. Не удалось запустить эмулятор. Причина: эмулятор завершился до загрузки в React Native, когда реагирует на собственный запуск-android
  5. Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds #29617
  6. Comments
  7. Won’t find Android studio emulator. #1
  8. Comments
  9. Footer

can’t compile and run my react native app #25936

I just can’t compile and run my react native app, and I’m getting this message :

FAILURE: Build failed with an exception.

Where:
Script ‘C:UsersmeReactNativeMyAppnode_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 190

What went wrong:
A problem occurred evaluating settings ‘MyApp’.

Unable to determine the current character, it is not a string, number, array, or object

The current character read is ‘E’ with an int value of 69
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0.

React Native version:

Steps To Reproduce

Describe what you expected to happen:

Snack, code example, screenshot, or link to a repository:

The text was updated successfully, but these errors were encountered:

I finally found the solution, something I was quite sure about doing, but thanks to this this guy #24733 (comment) :I had to delete «appbuildintermediatessigning_configdebugoutsigning-config.json» and now it works.

thanks, you just saved my ass in the nick of a meeting

hi, i’m facing this problem and its weird cause it happened when i created a new project with react-native init two days ago. i can run the old project but when i try to use command react-native run-android in the new project it gives me an error.( i don’t even have a build folder to delete ((: )
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
Memory: 2.20 GB / 7.95 GB
Binaries:
Node: 8.11.3 — C:Program Filesnodejsnode.EXE
npm: 5.6.0 — C:Program Filesnodejsnpm.CMD
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2

info Running jetifier to migrate libraries to AndroidX. You can disable it using «—no-jetifier» flag.
Jetifier found 863 file(s) to forward-jetify. Using 8 workers.
info Starting JS server.
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
info Launching emulator.
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app.

FAILURE: Build failed with an exception.

Where:
Script ‘C:UsersomidazmDesktopweblearningreact-nativegreen26node_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 182

What went wrong:
A problem occurred evaluating script.

Unable to determine the current character, it is not a string, number, array, or object

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.

BUILD FAILED in 23s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with —verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

Where:
Script ‘C:UsersomidazmDesktopweblearningreact-nativegreen26node_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 182

What went wrong:
A problem occurred evaluating script.

Unable to determine the current character, it is not a string, number, array, or object

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.

BUILD FAILED in 23s

hi, i’m facing this problem and its weird cause it happened when i created a new project with react-native init two days ago. i can run the old project but when i try to use command react-native run-android in the new project it gives me an error.( i don’t even have a build folder to delete ((: )
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
Memory: 2.20 GB / 7.95 GB
Binaries:
Node: 8.11.3 — C:Program Filesnodejsnode.EXE
npm: 5.6.0 — C:Program Filesnodejsnpm.CMD
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2

info Running jetifier to migrate libraries to AndroidX. You can disable it using «—no-jetifier» flag.
Jetifier found 863 file(s) to forward-jetify. Using 8 workers.
info Starting JS server.
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
info Launching emulator.
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
‘C:Program’ is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app.

FAILURE: Build failed with an exception.

  • Where:
    Script ‘C:UsersomidazmDesktopweblearningreact-nativegreen26node_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 182
  • What went wrong:
    A problem occurred evaluating script.

Unable to determine the current character, it is not a string, number, array, or object

  • 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 23s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with —verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • Where:
    Script ‘C:UsersomidazmDesktopweblearningreact-nativegreen26node_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 182
  • What went wrong:
    A problem occurred evaluating script.

Unable to determine the current character, it is not a string, number, array, or object

  • 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 23s

same problem here i just ran the react-native run-android after i init the project

Источник

Не удалось запустить эмулятор. Причина: эмулятор завершился до загрузки в React Native, когда реагирует на собственный запуск-android

Я устанавливаю React Native в соответствии с этим сайтом https://medium.com/@leonardobrunolima/react-native-tips-setting-up-your-development-environment-for-windows-d326635604ea , это очень полезно, пока я не запустил команду react-native run-android , это ошибка, которую я получаю:

У меня версия узла 10, и я работаю в Windows, пожалуйста, помогите, спасибо.

  1. Проверьте свою конфигурацию и настройку среды с помощью инструкций здесь , будьте очень осторожны с настройками путей. Проверьте $ PATH в терминале IDE.
  2. проверьте в AVD, что определенная ОС Android выбрана и установлена ​​для используемого вами виртуального устройства (в моем случае этого не было, у меня был желтый восклицательный знак предупреждения в столбце «Действия» в списке устройств AVD).
  3. Обновите Gradle до версии не ниже 6.6 в
  1. В Ubuntu после запуска мне приходилось «нажимать» кнопку включения на виртуальном устройстве.

Наконец, я запустил его как в Windows 10, так и в Ubuntu 20.04 LTS с Android 30.

В моем случае мне нужно стереть данные на виртуальном устройстве. Android Studio -> AVD -> Действия (↓) -> Wipe Data

Я столкнулся с аналогичной проблемой при выполнении моего собственного кода реакции на физическом устройстве Android. Не уверен, поможет ли мое решение.

Все мы знаем, что ADB требует авторизации от устройства Android для связи с ним. Только разрешив отладку по USB и проверив отпечаток ключа RSA компьютера, мы позволяем демону ADB подключаться к нашему телефону и управлять им. Это функция безопасности.

Мой телефон был подключен к USB, и при изменении конфигурации USB на устройстве мой телефон выдал мне еще один запрос: «Разрешить отладку по USB?». Изображение доступно для справки . У меня есть решение по отладке reallow USB

Источник

Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds #29617

After I run the project flutter, running the react_native project won’t connect to the simulator.
Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds
why?How to solve.

The text was updated successfully, but these errors were encountered:

⚠️ Missing Environment Information
ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

Please stop posting these issues on facebook/react-native .
It has nothing to do with this library!

Getting same error : error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with —verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

React native Info:
Node: 12.18.4 — /usr/local/bin/node
Yarn: Not Found
npm: 6.14.8 — /usr/local/bin/npm
Watchman: 4.9.0 — /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 — /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: 12.0/12A7209 — /usr/bin/xcodebuild
Languages:
Java: javac 15 — /usr/bin/javac
Python: 2.7.16 — /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

My answer is, If you have changed the directory of avds, you should set ANDROID_SDK_HOME environment variable to the parent directory of .android.

Here is the detail:
It seems like when you run «emulator -list-avds» in cmd, the result is empty. (be sure to first add «ANDROID_HOME» with value of your sdk directory to your user environment variable, and «%ANDROID_HOME%emulator» in the Path too.)

When you use this option, it displays a list of AVD names from your Android home directory. Note that you can override the default home directory by setting the ANDROID_SDK_HOME environment variable: the root of the user-specific directory where all configuration and AVD content is stored. You could set the environment variable in the terminal window before launching a virtual device, or you could set it through your user settings in the operating system.»

and in another page:
https://developer.android.com/studio/command-line/variables#envar
it said:
«Some older tools, such as Android Studio 4.3 and below, do not read ANDROID_USER_HOME. To override the user preferences location for those older tools set ANDROID_SDK_HOME to the parent directory you would like the .android directory to be created under.»

So I guess the reason is «npx react-native run-android» will invoke «emulator -list-avds» to find the emulator. And «emulator» is really an older tools, so ANDROID_SDK_HOME environment variable is necessary.

And if all goes well, you really don’t need to run android studio before run «npx reactive-native run-android».

So I guess the reason is «npx react-native run-android» will invoke «emulator -list-avds» to find the emulator. And «emulator» is really an older tools, so ANDROID_SDK_HOME environment variable is necessary.

Yes that’s exactly the case. Thanks for your thorough explanation @akaigyouhou.

Closing as the issue is not necessarily related to React Native, but more to your Android SDK setup. If you manage to call emulator -list-avds and get a valid result in your terminal, then run-android will also work.

Источник

Won’t find Android studio emulator. #1

am running your app on an android studio emulator and it looks like this demo can’t find it!

Whenever I run react-native run-android it gives error

My emulator is up and other projects can use it and install apps normally.

The text was updated successfully, but these errors were encountered:

@maotora You may specify which emulator to run on like ..
react-native run-android —deviceId emulator-5554

To get list of emulators run
adb devices -l

Thanks for replying.

I tried your method unfortunately still fails.

The problem is not that it cant find the Android Emulator, There’s an error in compiling your projects, have you linked your dependencies well ?

Hi @aivene25 ,
Thank you for your response but it still doesn’t work.

I re-cloned the project, then ran yarn then react-native link then ran yarn again then npm run start and lastly react-native run android still same issue.

Facing the same issue, any fix yet?

Hi, this might resolve the issue —

  1. Just run sudo chmod -R 777 react-native-track-player-demo(Project Name) after that
  2. npm install
  3. react-native link
  4. react-native run android

I didn’t work, sadly.

This repo is not active for last couple of months.
Try the new example Instead.

I tried your solution and it gave a different error.

⚠️ long stacktrace ahead.

I can see some light in this, do you have any solutions to this issue?

Now I feel stupid..

Ran npm install & react-native link

Ran react-native run-android

Gets a different error.

@moonstruck that’s the only branch I have.

@maotora Open emulator and try this
git clone https://github.com/react-native-kit/react-native-track-player.git
git checkout dev
cd example
yarn install
react-native run-android

Hey, is the dev branch still working?

info Running jetifier to migrate libraries to AndroidX. You can disable it using «—no-jetifier» flag.
Jetifier found 959 file(s) to forward-jetify. Using 2 workers.
info Starting JS server.
info Launching emulator.
error Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds .
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app.

every run my project always appear error like that
do you can handle my problem?

I found that specifically adding the emulator path (and in fact the platform-tools) folders to my PATH environment variable, those issues go away. Why it doesn’t append to the ANDROID_SDK_ROOT environment variable in Windows I’m not sure.

Hi Guys, if anyone still has this issue. An easy fix is just to open the ‘android‘ folder from your react-native project in android studio and build directly from there. None of the other solutions above worked for me. however this worked straight away.

Hi Guys, if anyone still has this issue. An easy fix is just to open the ‘android‘ folder from your react-native project in android studio and build directly from there. None of the other solutions above worked for me. however this worked straight away.

where did you build? I dont have a build button when I go into Android studio -> Android folder.

Hi Guys, if anyone still has this issue. An easy fix is just to open the ‘android‘ folder from your react-native project in android studio and build directly from there. None of the other solutions above worked for me. however this worked straight away.

where did you build? I dont have a build button when I go into Android studio -> Android folder.

Make sure you’re opening the build.gradle file found in the /android directory in your react-native app folder when opening in Android Studio. Then you should be able to press the green ‘play’ button at the top of Android Studio. If this doesn’t work make sure you’ve opened the emulator first and have it selected in the dropdown menu next to the ‘play’ button. Hope this helps 🙂

Flutter is able to detect open emulator, but react-native is not able to.
Facing same issue as others are facing it here.
What’s the final call for resolution?

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Issue

I am currently building a react-native app and I get this error message everytime I run: react-native run-android

Error Message:

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1052 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
error Failed to launch emulator. Reason: Emulator exited before boot..
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 /Users/asakoulas/BODYBOX/Bodybox/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 /Users/asakoulas/BODYBOX/Bodybox/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 /Users/myuser/appname/appname/node_modules/react-native/android
Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Checking the license for package Android SDK Build-Tools 30.0.2 in /Users/username/Library/Android/sdk/licenses
License for package Android SDK Build-Tools 30.0.2 accepted.
Preparing "Install Android SDK Build-Tools 30.0.2 (revision: 30.0.2)".
"Install Android SDK Build-Tools 30.0.2 (revision: 30.0.2)" ready.
Installing Android SDK Build-Tools 30.0.2 in /Users/asakoulas/Library/Android/sdk/build-tools/30.0.2
"Install Android SDK Build-Tools 30.0.2 (revision: 30.0.2)" complete.
"Install Android SDK Build-Tools 30.0.2 (revision: 30.0.2)" finished.
Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
WARNING:: The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.2.
Android SDK Build Tools 30.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING:: The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.2.
Android SDK Build Tools 30.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:installDebug FAILED
Skipping device 'emulator-5554' (emulator-5554): Device is OFFLINE.
134 actionable tasks: 2 executed, 132 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 14s

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 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 14s

    at makeError (/Users/username/Appname/app/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
    at /Users/username/Appname/app/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async runOnAllDevices (/Users/username/Appname/app/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
    at async Command.handleAction (/Users/username/Appname/app/node_modules/@react-native-community/cli/build/index.js:186:9)
info Run CLI with --verbose flag for more details.

The command (react-native run-android) was working perfecly until I tried to integrate Firebase and updated Android Studio.

I tried to do several things to fix this problem like reinstalling android studio or updating the sdk tools.

When I run (react-native run-android), the JS server runs successfully and the android emulator opens but it doesn’t download the app.

And when I run: adb devices in my terminal I get:

List of devices attached
emulator-5554   offline

I already tried to delete, cold reboot, restart the emulator but it doesn’t help and always shows offline.

I would really appreciate some help please.

Thanks in advance!

Solution

To everyone who is reading this and is having the same problem:.

I finally resolved it by following this guide on Medium.com:.

Click here to see the guide.

It turned out to be an error with android studio and the emulator with the new mac m1 chip.

**Someone previously deleted the answer and I am not sure why. Can you please at least explain why you delete it before you delete it.

Answered By — sakoulas

#android #react-native #react-native-android

Вопрос:

Когда я запускаю react-native run-android свое приложение React Native, я получаю эту ошибку, а затем сборка завершается неудачно:

 'C:UsersAlexAppDataLocalAndroidSdk/platform-tools/adb' is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
 

Я получаю эту ошибку независимо от того, выполняю ли я команду с помощью подключения телефона по USB или если я запускаю ее с помощью эмулятора, открытого из Android Studio. Однако, когда я запускаю adb devices и эмулятор, и мое устройство появляются.
Я почти уверен, что это не проблема с собственным кодом React, потому что я пробовал запускать несколько разных приложений и получал одну и ту же ошибку.

Кто-нибудь знает, в чем может быть проблема и почему устройство и эмулятор не обнаружены?

Комментарии:

1. не могли бы вы, пожалуйста, опубликовать результаты react-native info

Ответ №1:

Проблема заключалась в том, что антивирус моего компьютера удалил adb.exe поэтому, как только я переустановил папку инструментов платформы, содержащую adb.exe, react-native run-android работал нормально, и мое подключенное устройство было обнаружено.

Я устанавливаю React Native в соответствии с этим сайтом https://medium.com/@leonardobrunolima/react-native-tips-setting-up-your-development-environment-for-windows-d326635604ea, это очень полезно, пока я не запустил команду react-native run-android , это ошибка, которую я получаю:

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
error Failed to launch emulator. Reason: Emulator exited before boot..
> Task :app:transformNativeLibsWithMergeJniLibsForDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
24 actionable tasks: 4 executed, 20 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
> Could not read path 'C:JesusAppandroidappbuildintermediatestransformsmergeJniLibsdebuglibx86_64'.

* 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 7s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
> Could not read path 'C:JesusAppandroidappbuildintermediatestransformsmergeJniLibsdebuglibx86_64'.

* 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 7s

    at checkExecSyncError (child_process.js:629:11)
    at execFileSync (child_process.js:647:13)
    at runOnAllDevices (C:JesusAppnode_modules@react-native-communitycli-platform-androidbuildcommandsrunAndroidrunOnAllDevices.js:94:39)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    

У меня версия узла 10, и я работаю в Windows, пожалуйста, помогите, спасибо.

Ситуация происходит при запуске команды

npx react-native run-android

Вывод

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.                          
Jetifier found 864 file(s) to forward-jetify. Using 2 workers...                                                                
info JS server already running.                                                                                                 
info Launching emulator...                                                                                                      
error Failed to launch emulator. Reason: Emulator exited before boot..                                                          
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.                                  
info Installing the app...                                                                                                      
> Task :app:installDebug FAILED                                                                                                 

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.                                     
Use '--warning-mode all' to show the individual deprecation warnings.                                                           
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings                                 
27 actionable tasks: 2 executed, 25 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 connected devices!                                                        

* Try:                                                                                                                          
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan t
o get full insights.                                                                                                            

* Get more help at https://help.gradle.org                                                                                      

BUILD FAILED in 10s                                                                                                             

error Failed to install the app. Make sure you have an Android emulator running or a device connected. Run CLI with --verbose fl
ag for more details.                                                                                                            
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 connected devices!                                                        

* Try:                                                                                                                          
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan t
o get full insights.                                                                                                            

* Get more help at https://help.gradle.org                                                                                      

BUILD FAILED in 10s                                                                                                             

    at checkExecSyncError (child_process.js:621:11)                                                                             
    at execFileSync (child_process.js:639:15)                                                                                   
    at runOnAllDevices (K:androidAwesomeProjectnode_modules@react-native-communitycli-platform-androidbuildcommandsrunAn
droidrunOnAllDevices.js:94:39)                                                                                                 
    at processTicksAndRejections (internal/process/task_queues.js:93:5)                                                         
    at async Command.handleAction (K:androidAwesomeProjectnode_modulesreact-nativenode_modules@react-native-communitycli
buildindex.js:164:9)                                                                                                           

Я так понимаю все ошибки в выводе возникают из за того, что приложение не нашло устройство.

При отдельном запуске эмулятора

emulator -avd Nexus_4_API_28 -noaudio
Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.
Failed to open /qemu.conf, err: 2
HAX is working and emulator runs in fast virt mode.
VCPU shutdown request
emulator: WARNING: Not saving state: RAM not mapped as shared

Но эмулятор запускается и не закрывается при таком вызове

emulator -avd Nexus_4_API_28 -noaudio -no-accel

или при таком

emulator -avd Nexus_4_API_28 -noaudio -accel off

В интернете вычитал, что в AVD Manager за этот параметр отвечает настройка Graphics в значении Software. Но после изменения у себя эмулятор все равно закрывается.

Понравилась статья? Поделить с друзьями:
  • Error failed to install packages to new root arch
  • Error failed to install app 90 disk write failure
  • Error failed to install app 730 no subscription
  • Error failed to install app 4020 no subscription что делать
  • Error failed to install app 258550 no subscription