react-native run-android
> Configure project :app
WARNING: The specified Android SDK Build Tools version (28.0.2) is
ignored, as it is below the minimum supported version (28.0.3) for
Android Gradle Plugin 3.2.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.2'" 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
10:56:07 V/ddms: execute: running am get-config
10:56:07 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -1
10:56:07 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Nexus_5X_API_28(AVD) - 9' for app:debug
10:56:07 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'
10:56:07 D/Device: Uploading file onto device 'emulator-5554'
10:56:07 D/ddms: Reading file permission of /media/rahul/OTHER FILES/mob/practice/android/app/build/outputs/apk/debug/app-debug.apk as: rwxrwxrwx
10:56:07 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
10:56:08 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
10:56:08 V/ddms: execute: returning
10:56:08 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
10:56:09 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
10:56:09 V/ddms: execute: returning
Installed on 1 device.
BUILD SUCCESSFUL in 8s
28 actionable tasks: 1 executed, 27 up-to-date
Running /home/rahul/Android/Sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
Starting the app on emulator-5554 (/home/rahul/Android/Sdk/platform-tools/adb -s emulator-5554 shell am start -n com.practice/com.practice.MainActivity)...
Starting: Intent { cmp=com.practice/.MainActivity }
成功生成后,应用将在模拟器上打开 1 秒,然后出现白屏,然后关闭。然后它说应用程序停止工作。
我在模拟器上运行了我的代码,但它说应用程序停止工作。
只需
将buildToolsVersion更改为"28.0.3"即可解决,在此之后,我做了反应原生运行Android,它的工作:)