简体   繁体   English

Cordova混合应用程序(从我的项目中丢失文件)

[英]Cordova hybrid app (missing files from my project)

Im working on a hybrid app on cordova 6, I added android, Ios and browser, currently working on android only. 我正在使用cordova 6上的混合应用程序,我添加了android,Ios和浏览器,目前只在Android上工作。 My project is in c:/myApp/www and the same content of it is in c:/myApp/platforms/android/assets/www , when I run cordova on browser everything is there and I can see the project from Chrome DevTools => source ; 我的项目在c:/myApp/www ,它的相同内容在c:/myApp/platforms/android/assets/www ,当我在浏览器上运行cordova时,一切都在那里,我可以看到来自Chrome DevTools => source的项目Chrome DevTools => source ; but when I run it in android, deploy it to my phone (samsung s5), debug with cable, I look into Chrome Devtools => source , I see only index.html and assets folder, while there has to be a login.html and images folder and other JS files. 但是当我在android中运行它时,将它部署到我的手机(samsung s5),使用有线调试,我查看Chrome Devtools => source ,我只看到index.htmlassets文件夹,而必须有一个login.htmlimages文件夹和其他JS文件。 I even moved the images folder to assets folder but the assets folder is there and images folder is not in it!!! 我甚至将images文件夹移动到assets文件夹,但assets文件夹在那里, images文件夹不在其中!

All your html and images should be in your main www folder or subfolders of it. 您的所有html和图像都应位于主www文件夹或其子文件夹中。

Make sure your images folder exists here: c:/myApp/www/images 确保您的图像文件夹存在于此处:c:/ myApp / www / images

If that's not working, you could try removing and re-adding the platform using the CLI: 如果这不起作用,您可以尝试使用CLI删除并重新添加平台:

cordova platform remove android
cordova platform add android

You shouldn't edit your c:/myApp/platforms/android/assets/www folder directly, and you should just let the CLI automatically copy files there when you run cordova run android . 你不应该直接编辑你的c:/ myApp / platforms / android / assets / www文件夹,你应该让CLI在运行cordova run android时自动复制文件。

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

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