如何在我的手机中运行react原生应用程序,因为avd太慢了



请帮帮我。我的React Native应用程序没有在我的手机上运行。它在android模拟器上运行良好,但性能很差。

错误为:

$ 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 2 workers...
info Starting JS server...
info Installing the app...
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
* 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 8s
error Failed to install the app. Make sure you have the Android development environment set up: 
https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Com
mand failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

这可能是因为Jdk的较低版本。请更新Android Studio 支持的JDK版本

对于Reff:无法初始化类org.codehaus.groovy.runtime.InvokerHelper

尝试React Native环境来升级您的环境,因为这里有一个线程Grovy Error

这很简单,只需将您的手机连接到Android工作室并处于开发模式,然后从Android工作室中选择设备并运行应用程序将在您的手机上打开的项目,除非您在环境中没有任何错误。

相关内容

最新更新