I'm a new in react native so first thing I made is to install react native by running npm install -g react-native-cli
and after running react-native info
I get this
C:\Users\husam\WebstormProjects\calculator>react-native infoinfo Fetching system and libraries information...System: OS: Windows 10 10.0.18363 CPU: (4) x64 Intel(R) Core(TM) i3-7020U CPU @ 2.30GHz Memory: 815.06 MB / 3.92 GB Binaries: Node: 12.16.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 7, 8, 9 Build Tools: 19.1.0, 28.0.3, 29.0.3 System Images: android-19 | Intel x86 Atom, android-29 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: Version 3.6.0.0 AI-192.7142.36.36.6308749 Languages: Java: 1.8.0_231 Python: 3.7.6 npmPackages: @react-native-community/cli: Not Found react: 16.11.0 => 16.11.0 react-native: 0.62.2 => 0.62.2 npmGlobalPackages: *react-native*: Not Found
after that I create a new project with webstorm from here[https://www.jetbrains.com/help/webstorm/react-native.html]after that I launch the emulator with 19 API leveland then I run the App.js file and I get this
"C:\Program Files\nodejs\node.exe" C:\Users\husam\AppData\Roaming\npm\node_modules\react-native-cli run-androidinfo Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.Jetifier found 960 file(s) to forward-jetify. Using 4 workers...info JS server already running.info Installing the app...> Task :app:generatePackageList> Task :app:preBuild> Task :app:preDebugBuild> Task :app:compileDebugAidl NO-SOURCE> Task :app:checkDebugManifest UP-TO-DATE> Task :app:compileDebugRenderscript NO-SOURCE> Task :app:generateDebugBuildConfig UP-TO-DATE> Task :app:javaPreCompileDebug UP-TO-DATE> Task :app:mainApkListPersistenceDebug UP-TO-DATE> Task :app:bundleDebugJsAndAssets SKIPPED> Task :app:generateDebugResValues UP-TO-DATE> Task :app:generateDebugResources UP-TO-DATE> Task :app:mergeDebugResources UP-TO-DATE> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE> Task :app:processDebugManifest UP-TO-DATE> Task :app:processDebugResources UP-TO-DATE> Task :app:compileDebugJavaWithJavac UP-TO-DATE> Task :app:mergeDebugShaders UP-TO-DATE> Task :app:compileDebugShaders UP-TO-DATE> Task :app:generateDebugAssets UP-TO-DATE> Task :app:mergeDebugAssets UP-TO-DATE> Task :app:copyDebugBundledJs SKIPPED> Task :app:processDebugJavaRes NO-SOURCE> Task :app:mergeDebugJavaResource UP-TO-DATE> Task :app:checkDebugDuplicateClasses UP-TO-DATE> Task :app:desugarDebugFileDependencies UP-TO-DATE> Task :app:transformClassesWithDexBuilderForDebug UP-TO-DATE> Task :app:validateSigningDebug UP-TO-DATE> Task :app:signingConfigWriterDebug UP-TO-DATE> Task :app:mergeExtDexDebug UP-TO-DATE> Task :app:mergeDexDebug UP-TO-DATE> Task :app:mergeDebugJniLibFolders UP-TO-DATE> Task :app:mergeDebugNativeLibs UP-TO-DATE> Task :app:stripDebugDebugSymbols UP-TO-DATE> Task :app:packageDebug UP-TO-DATE> Task :app:installDebug10:21:40 V/ddms: execute: running am get-config10:21:45 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -110:21:45 V/ddms: execute: returningInstalling APK 'app-debug.apk' on 'MY_phone(AVD) - 4.4.2' for app:debug10:21:45 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'10:21:45 D/Device: Uploading file onto device 'emulator-5554'10:21:45 D/ddms: Reading file permision of C:\Users\husam\WebstormProjects\calculator\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------10:21:49 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"10:22:25 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -110:22:25 V/ddms: execute: returning10:22:25 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"10:22:26 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -110:22:26 V/ddms: execute: returningInstalled 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_warningsBUILD SUCCESSFUL in 4m 49s27 actionable tasks: 2 executed, 25 up-to-dateinfo Connecting to the development server...adb.exe: error: closedinfo Starting the app on "emulator-5554"...warn Failed to connect to development server using "adb reverse": Command failed: C:\Users\husam\AppData\Local\Android\Sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.Starting: Intent { cmp=com.calculator/.MainActivity }
the error as showing in the log Is about the adb but I can use the adb command to install and get logcat in both the emulator and the real devices without any error
after searching on the internet I tried to run this two commandsadb reconnect
adb reverse tcp:8081 tcp:8081
but I get the same error as following
C:\Users\husam\WebstormProjects\calculator>adb reconnectreconnecting 4203605bb24a3200 [device]C:\Users\husam\WebstormProjects\calculator>adb reverse tcp:8081 tcp:8081adb.exe: error: closed
the code that I run is the default one that is created by react nativealso the app is installed successfully on my emulator but when I run it I get an error tells me the app will stophow I can solve this issue ?