'error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`, I've added an avg in android studio manually also

I'm new to react native and trying to install it and facing this problems, I've tried many fixes but they don't work.

full error- npx react-native run-android 
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 936 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
/bin/sh: 1: adb: not found
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...

> Configure project :app
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}api-level>
unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}api-level>
unexpected element (uri:"", local:"base-extension"). Expected elements are <{}vendor>,<{}codename>,<{}abi>,<{}api-level>,<{}tag>
unexpected element (uri:"", local:"base-extension"). Expected elements are <{}vendor>,<{}codename>,<{}abi>,<{}api-level>,<{}tag>
unexpected element (uri:"", local:"base-extension"). Expected elements are <{}vendor>,<{}codename>,<{}abi>,<{}api-level>,<{}tag>
unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Errors limit exceeded. To receive all errors set com.sun.xml.bind logger to FINEST level.
unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}api-level>
Checking the license for package Android SDK Tools in /home/t/Android/Sdk/licenses
License for package Android SDK Tools accepted.
Preparing "Install Android SDK Tools (revision: 26.1.1)".
"Install Android SDK Tools (revision: 26.1.1)" ready.
Installing Android SDK Tools in /home/tannu/Android/Sdk/tools
"Install Android SDK Tools (revision: 26.1.1)" complete.
"Install Android SDK Tools (revision: 26.1.1)" finished.
Checking the license for package Android SDK Build-Tools 30.0.2 in /home/tannu/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 /home/t/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.
Checking the license for package Android SDK Platform 31 in /home/t/Android/Sdk/licenses
License for package Android SDK Platform 31 accepted.
Preparing "Install Android SDK Platform 31 (revision: 1)".
"Install Android SDK Platform 31 (revision: 1)" ready.
Installing Android SDK Platform 31 in /home/t/Android/Sdk/platforms/android-31
"Install Android SDK Platform 31 (revision: 1)" complete.
"Install Android SDK Platform 31 (revision: 1)" finished.

> Task :app:compileDebugJavaWithJavac

> Task :app:stripDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libbutter.so, libc++_shared.so, libevent-2.1.so, libevent_core-2.1.so, libevent_extra-2.1.so, libfabricjni.so, libfb.so, libfbjni.so, libflipper.so, libfolly_futures.so, libfolly_json.so, libglog.so, libglog_init.so, libimagepipeline.so, libjsc.so, libjscexecutor.so, libjsi.so, libjsijniprofiler.so, libjsinspector.so, liblogger.so, libmapbufferjni.so, libnative-filters.so, libnative-imagetranscoder.so, libreact_codegen_rncore.so, libreact_config.so, libreact_debug.so, libreact_nativemodule_core.so, libreact_render_animations.so, libreact_render_attributedstring.so, libreact_render_componentregistry.so, libreact_render_core.so, libreact_render_debug.so, libreact_render_graphics.so, libreact_render_imagemanager.so, libreact_render_leakchecker.so, libreact_render_mapbuffer.so, libreact_render_mounting.so, libreact_render_runtimescheduler.so, libreact_render_scheduler.so, libreact_render_telemetry.so, libreact_render_templateprocessor.so, libreact_render_textlayoutmanager.so, libreact_render_uimanager.so, libreact_utils.so, libreactnativeblob.so, libreactnativejni.so, libreactnativeutilsjni.so, libreactperfloggerjni.so, librrc_image.so, librrc_root.so, librrc_text.so, librrc_unimplementedview.so, librrc_view.so, libruntimeexecutor.so, libturbomodulejsijni.so, libyoga.so.

> Task :app:installDebug

> Task :app:installDebug FAILED
37 actionable tasks: 31 executed, 6 up-to-date
Note: /home/t/quizApp/android/app/src/debug/java/com/quizapp/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
[adb]: * daemon not running; starting now at tcp:5037
[adb]: * daemon started successfully

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 to get full insights.

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

BUILD FAILED in 3m 13s

error Failed to install the app. Make sure you have an Android emulator running or a device connected.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: /home/t/quizApp/android/app/src/debug/java/com/quizapp/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
[adb]: * daemon not running; starting now at tcp:5037
[adb]: * daemon started successfully

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 to get full insights.

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

BUILD FAILED in 3m 13s

    at makeError (/home/tannu/quizApp/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
    at /home/t/quizApp/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/home/tannu/quizApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/home/t/quizApp/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source