[英]Have an build problem for react-native project
Im create new a react-native project 我创建了一个新的本机项目
react-native init navigationApp--version 0.59.8
But have build problems... When i try run ( react-native run-android
) 但是有构建问题...当我尝试运行时(
react-native run-android
)
Console stay step: app:installDebug
and have some errors in npm
part. 控制台停留步骤:
app:installDebug
,在npm
部分有一些错误。
I tried they step-step; 我试了他们一步一步;
1.rm -rf node_modules package-lock.json 1. rm -rf node_modules package-lock.json
2. npm install
react-native@0.55.2 babel-preset-react-native@4.0.0 2.
npm install
react-native@0.55.2 babel-preset-react-native@4.0.0
3. npm install
3.
npm install
4.react-native run-android 4.react-native运行android
λ react-native run-android λreact-native运行Android
Scanning folders for symlinks in C:\\Users\\MONSTER\\Desktop\\project\\react-navigation\\navigationApp\\node_modules (55ms)
JS server already running. 扫描文件夹中
C:\\Users\\MONSTER\\Desktop\\project\\react-navigation\\navigationApp\\node_modules (55ms)
JS服务器中的符号链接。 Building and installing the app on the device (cd android && gradlew.bat installDebug)... Starting a Gradle Daemon (subsequent builds will be faster) <============-> 97% EXECUT¦NG [7m 40s] 在设备上构建和安装应用程序(cd android && gradlew.bat installDebug)...启动Gradle守护进程(后续构建会更快)<=============-> 97%EXECUT¦ NG [7m 40s]
IDLE IDLE IDLE IDLE IDLE :app:installDebug IDLE IDLE
IDLE IDLE IDLE IDLE IDLE:app:install调试IDLE IDLE
λ npm start
> navigationApp@0.0.1 start C:\Users\MONSTER\Desktop\project\react-navigation\navigationApp
> node node_modules/react-native/local-cli/cli.js start
Scanning folders for symlinks in C:\Users\MONSTER\Desktop\project\react-navigation\navigationApp\node_modules (49ms)
┌───────────────────────────────────────────────────────────────────────────
───┐
│
│
│ Running Metro Bundler on port 8081.
│
│
│
│ Keep Metro running while developing on any JS projects. Feel free to
│
│ close this tab and run your own Metro instance if you prefer.
│
│
│
│ https://github.com/facebook/react-native
│
│
│
└───────────────────────────────────────────────────────────────────────────
───┘
Looking for JS files in
C:\Users\MONSTER\Desktop\project\react-navigation\navigationApp
Metro Bundler ready.
Loading dependency graph, done.
ERROR EPERM: operation not permitted, lstat 'C:\Users\MONSTER\Desktop\project\react-navigation\navigationApp\android\app\build\intermediates\blame\res\debug\multi-v2'
npm ERR! code ELIFECYCLE
npm ERR! errno 11
npm ERR! navigationApp@0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 11
npm ERR!
npm ERR! Failed at the navigationApp@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MONSTER\AppData\Roaming\npm-cache\_logs\2019-07-31T07_51_31_477Z-debug.log
you must clean your project as below 您必须按以下方式清理项目
npm start -- --reset-cache
react-native run-android
Also, you can clear project android gradlew
file, 另外,您可以清除项目android
gradlew
文件,
cd/android
./gradlew clean
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.