【发布时间】:2018-03-02 12:40:59
【问题描述】:
我目前正在尝试将 Angular-Application 移植到 Cordova。我在科尔多瓦的经验是有限的,我尝试过的大部分事情似乎都有效,但我面临一个主要问题。除了来自外部源(我的后端)的资源外,所有资源都没有加载。
这是我的 config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.timmaex.app" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>CheckMeTest</name>
<description>
Test Application
</description>
<author email="censored" href="censored">
Me
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<access launch-external="yes" origin="tel:*" />
<allow-navigation href="*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />
<allow-intent href="*" />
<access origin="*" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<engine name="android" spec="6.2.1" />
<engine name="browser" spec="^5.0.3" />
</widget>
我使用 Angular cli 进行了 AOT 构建,并将 dist 文件夹移动到我的 Cordova 项目中的 www/ 文件夹,包括资产。
然后我们开始了,它编译并运行得很好。除了在 Android 上加载本地资产外,我什么都能做。为什么会这样,我该怎么办?
【问题讨论】:
标签: android angular cordova assets