错误 无法安装应用程序.确保您已设置 Android 开发环境

编程入门 行业动态 更新时间:2024-10-23 21:33:13
本文介绍了错误 无法安装应用程序.确保您已设置 Android 开发环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我创建了 react-native 项目,然后在终端打开文件夹;在运行npm start"然后react-native run-android"之后,我能够在虚拟设备上运行它.但是,当我从 vscode 终端执行此操作时,出现以下错误;

I created the react-native project, then open the folder, at the terminal; After running "npm start" and then "react-native run-android" I was able to run it on the virtual device. However, when I do this from the vscode terminal, I get the following error;

info 运行 jetifier 以将库迁移到 AndroidX.您可以使用--no-jetifier"标志禁用它.Jetifier 找到了 863 个要转发 Jetify 的文件.使用 4 个工人...info JS 服务器已经在运行.信息 安装应用程序...错误:无法找到或加载主类 org.gradle.wrapper.GradleWrapperMain引起:java.lang.ClassNotFoundException:org.gradle.wrapper.GradleWrapperMain

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 863 file(s) to forward-jetify. Using 4 workers... info JS server already running. info Installing the app... Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain

错误无法安装应用程序.确保您已设置 Android 开发环境:facebook.github.io/react-native/docs/getting-started.html#android-development-environment.使用 --verbose 标志运行 CLI 以获取更多详细信息.错误:命令失败:./gradlew app:installDebug -PreactNativeDevServerPort=8081错误:无法找到或加载主类 org.gradle.wrapper.GradleWrapperMain引起:java.lang.ClassNotFoundException:org.gradle.wrapper.GradleWrapperMain

error Failed to install the app. Make sure you have the Android development environment set up: facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain

at checkExecSyncError (child_process.js:601:13) at execFileSync (child_process.js:621:13) at runOnAllDevices (/home/myworldsoftware-u/İndirilenler/project2/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:74:39) at buildAndRun (/home/myworldsoftware-u/İndirilenler/project2/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41) at then.result (/home/myworldsoftware-u/İndirilenler/project2/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)

推荐答案

npx react-native doctor

此命令检查您的环境并显示 react-native 安装状态的报告.仔细检查您可能需要安装的其他软件的输出

This command checks your environment and displays a report of the status of react-native installation. Check the output carefully for other software you might need to install

更多推荐

错误 无法安装应用程序.确保您已设置 Android 开发环境

本文发布于:2023-11-07 00:54:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565114.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:确保您   应用程序   已设置   错误   环境

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!