I'm having trouble running my react-native app on my plugged-in android phone. The thing is that I have an iPhone and the available phone around is an old htc, having an android version of 4.1.* When I run the app while having the AVD on it works fine and opens on the virtual device, but android studio really consumes memory, plus I personally would like to test out the app on a physical phone rather than a virtual one. When plugged in: after running
react-native run-android
The metro server opens on another node command window, and the following is written on the original cmd:
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 4 workers...
info Starting JS server...
* daemon not running; starting now at tcp:5037
* daemon started successfully
info Installing the app...
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.
> Task :app:installDebug
11:46:51 V/ddms: execute: running am get-config
11:46:54 V/ddms: execute 'am get-config' on 'xxx' : EOF hit. Read: -1
11:46:54 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'HTC Desire 600 dual sim - 4.1.2' for app:debug
11:46:54 D/app-debug.apk: Uploading app-debug.apk onto device 'xxx'
11:46:54 D/Device: Uploading file onto device 'xxx'
11:46:54 D/ddms: Reading file permision of C:\Users\user\Desktop\Training\ReactNative\Practice\app01\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------
11:47:09 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
11:47:26 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'xxx' : EOF hit. Read: -1
11:47:26 V/ddms: execute: returning
11:47:26 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
11:47:26 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'xxx' : EOF hit. Read: -1
11:47:26 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.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1m 30s
27 actionable tasks: 6 executed, 21 up-to-date
info Connecting to the development server...
adb.exe: error: closed
warn Failed to connect to development server using "adb reverse": Command failed: adb -s xxx
reverse tcp:8081 tcp:8081
info Starting the app on "xxx"...
Starting: Intent { cmp=com.app01/.MainActivity }
**Additional Info:
The installed/running SDK in android studio is of level 30.
in the build.gradle
file of the project the following is found:
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
I looked up and the corresponding API level for my android version is 16. Is the android version related? or is it something that has to do with the adb. I really hope there's a solution to this. Thanks in advance. I'm ready to provide addition/required info.