reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
219 stars 328 forks source link

rn 运行项目的时候报错... #177

Closed wushiwen123456 closed 2 years ago

wushiwen123456 commented 4 years ago

请按以下格式提供问题的相关信息。

问题的具体描述

PS D:\android-project\rn-app> react-native run-android Scanning 694 folders for symlinks in D:\android-project\rn-app\node_modules (24ms) JS server already running. Building and installing the app on the device (cd android && gradlew.bat installDebug)...

Configure project :app WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore. Use 'android.enableAapt2=true' to remove this warning. It will be removed at the end of 2018. Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

BUILD FAILED in 0s Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html PS D:\android-project\rn-app>

请描述完整的环境/版本信息

-node版本: 10.12.0 -npm版本6.4.1

以下是package.json的相关信息: { "name": "myReactProject", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "antd-mobile-rn": "^2.2.0", "mime-db": "^1.44.0", "native-echarts": "^0.3.0", "prop-types": "^15.7.2", "react": "16.0.0-alpha.12", "react-dom": "^16.4.1", "react-native": "0.48.1", "react-native-camera": "1.8.0", "react-native-datepicker": "^1.7.2", "react-native-device-info": "^0.13.0", "react-native-http-cache": "^0.2.0", "react-native-image-picker": "^0.26.7", "react-native-image-zoom-viewer": "^2.2.15", "react-native-menu": "^0.23.0", "react-native-picker": "^4.3.7", "react-native-qrcode-scanner-view": "^2.0.0", "react-native-side-menu": "^1.1.3", "react-native-tree-select": "^2.0.4", "react-native-vector-icons": "^4.4.0", "react-navigation": "^1.5.12" }, "devDependencies": { "babel-jest": "21.0.0", "babel-plugin-import": "^1.8.0", "babel-preset-react-native": "2.1.0", "jest": "21.0.1", "react-test-renderer": "16.0.0-alpha.12" }, "jest": { "preset": "react-native"

}, "optionalDependencies": {} }

QQ截图20200606195202

这是错误截图: QQ截图20200606201954

预期结果

sunnylqm commented 4 years ago

签名配置有问题,应该是拉的别人的项目,但是代码里缺乏对应的配置和证书

sunnylqm commented 4 years ago

参考 https://reactnative.cn/docs/signed-apk-android

sunnylqm commented 4 years ago

react 0.49之前入口文件分index.ios.js和index.android.js,0.49之后合并为index.js

--原始邮件--- 发件人: "wushiwen123456"<notifications@github.com> 发送时间: 2020年6月6日(周六) 晚上7:34 收件人: "reactnativecn/react-native-website"<react-native-website@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: [reactnativecn/react-native-website] rn 运行项目的时候报错... (#177)

请按以下格式提供问题的相关信息。

问题的具体描述

我在运行rn项目的时候出现错误,总是卡在Loading dependency graph, done.这一行,然后过了一会出现报错信息如下,当我在浏览器中输入http://localhost:8081/index.bundle时,打印如下信息: {"message":"Cannot find entry file index.js in any of the roots: ["D:\android-project\rn-app"]","name":"NotFoundError","type":"NotFoundError","status":404,"errors":[{}]}

以下是错误信息:

Looking for JS files in D:\android-project\rn-app

React packager ready.

Loading dependency graph, done. Bundling index.js [development, non-minified, hmr disabled] 0.0% (0/1), failed. error: bundling failed: "Cannot find entry file index.js in any of the roots: ["D:\android-project\rn-app"]" ::1 - - [06/Jun/2020:11:19:44 +0000] "GET /favicon.ico HTTP/1.1" 404 24 "http://localhost:8081/index.bundle" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36" Bundling index.js [development, non-minified, hmr disabled] 0.0% (0/1), failed.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2020-06-06T11_22_46_681Z-debug.log

请描述完整的环境/版本信息

-node版本: 10.12.0 -npm版本6.4.1

以下是package.json的相关信息: { "name": "myReactProject", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "antd-mobile-rn": "^2.2.0", "mime-db": "^1.44.0", "native-echarts": "^0.3.0", "prop-types": "^15.7.2", "react": "16.0.0-alpha.12", "react-dom": "^16.4.1", "react-native": "0.48.1", "react-native-camera": "1.8.0", "react-native-datepicker": "^1.7.2", "react-native-device-info": "^0.13.0", "react-native-http-cache": "^0.2.0", "react-native-image-picker": "^0.26.7", "react-native-image-zoom-viewer": "^2.2.15", "react-native-menu": "^0.23.0", "react-native-picker": "^4.3.7", "react-native-qrcode-scanner-view": "^2.0.0", "react-native-side-menu": "^1.1.3", "react-native-tree-select": "^2.0.4", "react-native-vector-icons": "^4.4.0", "react-navigation": "^1.5.12" }, "devDependencies": { "babel-jest": "21.0.0", "babel-plugin-import": "^1.8.0", "babel-preset-react-native": "2.1.0", "jest": "21.0.1", "react-test-renderer": "16.0.0-alpha.12" }, "jest": { "preset": "react-native" }, "optionalDependencies": {} }

预期结果

请描述你觉得代码正常运行的情况应该是什么样子。

如果问题比较模糊,没有具体方案,那么请具体描述你想要实现什么功能。

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

github-actions[bot] commented 2 years ago

👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 2 years ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.