Reputation: 2068
I want to build a new App without Expo and without Yarn.
So I launched a new Projekt with react-native init and navigated inside the folder starting the Metro Server (works fine) - but when I want to start the android App on my emulator (AS Emulator) I get this Error:
PS C:\Dev\Programmierung\FitnessApp\FitnessApp> npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 6 workers...
info JS server already running.
Der Befehl "adb" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
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...
> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.
> Task :app:installDebug
01:14:59 V/ddms: execute: running am get-config
01:15:00 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -1
01:15:00 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Nexus_5X_API_29_x86(AVD) - 10' for app:debug
01:15:00 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'
01:15:00 D/Device: Uploading file onto device 'emulator-5554'
01:15:00 D/ddms: Reading file permision of C:\Dev\Programmierung\FitnessApp\FitnessApp\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------
01:15:00 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
01:15:00 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
01:15:00 V/ddms: execute: returning
01:15:00 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
01:15:00 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
01:15:00 V/ddms: execute: returning
Installed on 1 device.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 4s
27 actionable tasks: 2 executed, 25 up-to-date
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT
info Starting the app...
Der Befehl "adb" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
error Failed to start the app. Run CLI with --verbose flag for more details.
Error: Command failed: adb shell am start -n com.fitnessapp/com.fitnessapp.MainActivity
at makeError (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\execa\index.js:174:9)
at Function.module.exports.sync (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\execa\index.js:338:15)
at tryLaunchAppOnDevice (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\tryLaunchAppOnDevice.js:57:22)
at C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:104:39
at Array.forEach (<anonymous>)
at runOnAllDevices (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:102:48)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async Command.handleAction (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
I already tried to fix it but with no luck.
Before this error I had this Error:
Task 'installDebug' not found in project ':app'.
My Project Android Folder is selected in AS and the Emulator is running.
Upvotes: 0
Views: 1148
Reputation: 89
take the terminal goto your project folder using cd command and type npx jetify.
Upvotes: 0
Reputation: 791
I got this error every time.
Follow this steps to get rid of it:
1) Open Android Studio.
2) Open your android folder of react native project in android studio.
Now it'll start downloading all the necessary files
3) Click on run button.
Now once application gets installed in your android device you can use react-native-run-android
Upvotes: 1