android - 如何为 Nativescript 捆绑运行 android
问题描述
当我按照步骤使用 Angular 将 Web 项目迁移到代码共享时,在执行 tns run android --bundle 之后,出现以下错误:
ERROR in Could not resolve module C:\Ideas\Source\b2bAngular\src\app.module
Webpack 编译完成。监视文件更改。Webpack 构建完成!从 C:\Ideas\Source\b2bAngular\hooks\before-shouldPrepare\nativescript-dev-webpack.js 执行 before-shouldPrepare 挂钩 从 C:\Ideas\Source\b2bAngular\hooks\before-cleanApp\nativescript 执行 before-cleanApp 挂钩-dev-webpack.js 正在准备项目...从 C:\Ideas\Source\b2bAngular\hooks\before-prepareJSApp\nativescript-dev-webpack.js 执行 before-prepareJSApp 钩子... + 设置 applicationId + 应用用户- 从 C:\Ideas\Source\b2bAngular\App_Resources\Android\app.gradle 定义配置 + 添加 nativescript 运行时包依赖项:nativescript-optimized-with-inspector + 添加 aar 插件依赖项:C:\Ideas\Source\b2bAngular\node_modules \tns-core-modules-widgets\platforms\android\widgets-release.aar
FAILURE:构建失败并出现异常。
出了什么问题:任务':app:clean'执行失败。
无法删除目录:C:\Ideas\Source\b2bAngular\platforms\android\app\build\intermediates\assets\debug\app\app\cars\model
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
在https://help.gradle.org获得更多帮助
4 秒内构建失败无法在设备上应用更改:c1f7d849。错误是:命令 gradlew.bat 失败,退出代码为 1。从 C:\Ideas\Source\b2bAngular\hooks\after-watch\nativescript-dev-webpack.js 执行监视后挂钩C:\Ideas\Source\b2bAngular\hooks\after-watch\nativescript-dev-webpack.js
任何帮助都非常感谢!
解决方案
当我再次启动该过程时它起作用了,但是这次我没有执行 update-ns-webpack 脚本,它起作用了。
所以我开始了一个执行该脚本的新项目,但它没有工作,但是当我创建一个新项目而不执行它时,一切都很完美。
我认为与该脚本有关
推荐阅读
- java - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的“null”附近使用正确的语法
- docker - 更改/降级 Docker API 版本
- android - LiveData 在打开应用程序时不会立即显示数据
- algorithm - 具有两个不同参数的嵌套循环的时间复杂度
- javascript - 退出第三方服务后 Javascript 更改视图 - Gmail 插件
- html - 即使有背景颜色,如何制作我的 CSS 网格?
- python - 如何在 VSCode 中更改工作区(不是文件夹)的默认 python 路径
- android - 嗨朋友们,我怎样才能检索联系人列表来保存他们
- pandas - 'float' 对象不可下标/无法将浮点数放入数据框中
- audio - FFmpeg - 与音频帧大小及其计算的概念混淆