【发布时间】:2020-07-15 14:13:25
【问题描述】:
我按照本教程编写了自己的 android cordova 应用程序:
https://www.npmjs.com/package/vue-cli-plugin-cordova
我将我的应用程序的图像添加到公用文件夹中。我的整个文件夹 看起来像这样:
my-app2:
|-.git
|-node_modules
|-public --> there are my images in the img folder, the index.css in the css folder and the index.html as main entry point
|-src --> there is my Sourcecode folder which works fine
|-src-cordova --> In this folder are the settings for my app (config.xml)
|-tests
|-.gitignore
|-babel.config
|-cypress
|-my-release-key.keystore
|-package
|-package-lock
|-README.md
|-vue.config
|-yarn.lock
公用文件夹包含所有图像和主入口点 我的应用程序:index.html 文件
我用这个相对路径引用了这些图像文件:
img/weiss.png
现在我运行以下命令,一切正常。
npm run cordova-serve-browser
然后我用cordova for android构建了它:
npm run cordova-build-android
然后我将它安装在我的 avd 上并没有得到这些图像 显示。 (你必须安装jdk 1.8, gradle, android studio, android sdk ...)
我现在的问题是,我如何参考这些图片 我必须在我的 cordova 配置中设置什么?
【问题讨论】:
标签: android cordova vue.js resources avd