简体   繁体   English

在Android Studio上模拟ionic 2应用程序时出错

[英]error when emulate ionic 2 app on android studio

On my ionic 2 application, I would like to emaulte the application on android studio . 在我的ionic 2应用程序上,我想在android studio上对该应用程序进行Emaulte。

When I run this command on my terminal ionic emulate -l -s android I have this error: 当我在终端ionic emulate -l -s android上运行此命令时,出现以下错误:

Error: Cannot find module './version' 错误:找不到模块“ ./version”

This is the output on my terminal: 这是我终端上的输出:

watch failed: watcher error: 

/home/user/Workspace/ionic-app/home/user/Workspace/ionic-app/src/assets/**/*,/home/user/Workspace/ionic-app/src/index.html,/home/user/Workspace/ionic-app/src/manifest.json,/home/user/Workspace/ionic-app/src/service-worker.js,/home/user/Workspace/ionic-app/node_modules/ionicons/dist/fonts/**/*,/home/user/Workspace/ionic-app/node_modules/ionic-angular/fonts/**/*,/home/user/Workspace/ionic-app/node_modules/ionic-angular/polyfills/polyfills.js,/home/user/Workspace/ionic-app/node_modules/sw-toolbox/sw-toolbox.js:

Error: watch 
/home/user/Workspace/ionic-app/node_modules/ionicons/dist/fonts ENOSPC 
dev server running: http://192.168.0.149:8101/ 

Error: Cannot find module './version'

I don't understand where am I wrong. 我不明白我在哪里错。 Why this error occured and what is this ./version module ? 为什么会发生此错误,并且此./version模块是什么?

I found the solution. 我找到了解决方案。 During my project developpement, there was an update of android studio (sdk manager, sdk tools, gradle ... etc). 在我的项目开发过程中,有一个android studio的更新(sdk管理器,sdk工具,gradle ...等)。

I have to delete the folder ionic-app/platforms/android , then re-build the application through android studio by importing the ionic application with gradle. 我必须删除ionic-app/platforms/android文件夹,然后通过使用gradle导入ionic应用程序,通过android studio重新构建应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM