首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >react本机运行-android不工作:/

react本机运行-android不工作:/
EN

Stack Overflow用户
提问于 2021-07-08 13:15:29
回答 2查看 974关注 0票数 0

运行react windows中的本机运行-android,但是得到以下错误:

代码语言:javascript
复制
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.   
  (node:8484) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
Jetifier found 896 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
'gradlew.bat' n'est pas reconnu en tant que commande interne
ou externe, un programme ex�cutable ou un fichier de commandes.
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: spawn gradlew.bat ENOENT
    at notFoundError (C:\cygwin64\home\Abderrahmane\app\node_modules\cross-spawn\lib\enoent.js:6:26)      
    at verifyENOENT (C:\cygwin64\home\Abderrahmane\app\node_modules\cross-spawn\lib\enoent.js:40:16)      
    at ChildProcess.cp.emit (C:\cygwin64\home\Abderrahmane\app\node_modules\cross-spawn\lib\enoent.js:27:25)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
info Run CLI with --verbose flag for more details.`

我已经安装了android studio并创建了一个项目,我还运行了仿真程序,并做到了。

代码语言:javascript
复制
create-react-native-app project
react-native init project
react-native start
react-native run-android
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-07-09 05:26:45

Stack Overflow用户

发布于 2021-10-28 11:14:04

对于android,请尝试以下代码:

代码语言:javascript
复制
 # Reset metro bundler cache : 
`npx react-native start --reset-cache`
    
# Remove Android assets cache : 
`cd android && ./gradlew clean`
    
# Relaunch metro server : 
`npx react-native run-android`

若要删除"Jetifier",请使用:

代码语言:javascript
复制
react-native run-android --no-jetifier
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68302374

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档