简体   繁体   中英

How Can I run react-native app in my mobile because avd is too slow

Please help me. My React Native app is not running in my mobile. It works fine on the android simulator, but the performance is quiet bad.

The error is:

$ 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

尝试使用React Native 环境升级你的环境,因为这里有一个线程Grovy 错误

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

This might be because lower version of Jdk. Please update JDK version supported by Android Studio

For Reff : Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM