如何将react-native连接到android studio

qlckcl4x  于 2023-02-09  发布在  React
关注(0)|答案(1)|浏览(183)

android模拟器打开,但不显示任何内容

npm run android

> hello@0.0.1 android
> react-native run-android

info Starting JS server...
* daemon not running; starting now at tcp:5037
* daemon started successfully
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
5 actionable tasks: 5 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> java.io.IOException: La syntaxe du nom de fichier, de r�pertoire ou de volume est incorrecte

* 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 36s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> java.io.IOException: La syntaxe du nom de fichier, de r�pertoire ou de volume est incorrecte

* 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 36s

    at makeError (C:\Users\jawhar\Desktop\First_React\hello\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
    at C:\Users\jawhar\Desktop\First_React\hello\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (C:\Users\jawhar\Desktop\First_React\hello\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
    at async Command.handleAction (C:\Users\jawhar\Desktop\First_React\hello\node_modules\@react-native-community\cli\build\index.js:108:9)
info Run CLI with --verbose flag for more details.
vltsax25

vltsax251#

我想我知道发生了什么。
此消息:

java.io.IOException: La syntaxe du nom de fichier, de r�pertoire ou de volume est incorrecte
    • 朋友,你的空间太小了**,我想这不是你的错

我有时也会遇到这个错误,这是因为Android Studio默认将模拟器的大小设置为相当低的存储空间。

    • 您需要增加存储模拟器的占用:**

1.进入Android Studio(如果您正在一个项目中,请退出它,这样您将只拥有IDE的菜单)
1.挑三个点
1.选择虚拟设备管理器
1.编辑AVD
1.显示高级设置
1.选择"无SD卡"并使内部存储至少为2000MB
干杯

相关问题