[英]Cordova config.xml preference android-installLocation
<platform name="android">
<preference name="android-installLocation" value="auto" />
</platform>
對 config.xml 中的 android 安裝位置的偏好不起作用。 它不會通過准備或構建在 android 清單 xml 中傳遞。
我在這個問題中找到的解決方案是一個插件,它可以將首選項從 config.cml 傳遞到 android manifest,而不是自動傳遞。
科爾多瓦插件添加科爾多瓦自定義配置
https://github.com/dpa99c/cordova-custom-config
備查:
在config.xml的<platform name="android">
標簽內,輸入以下幾行:
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest">
<manifest android:installLocation="auto" />
</edit-config>
解釋:
edit-config
用於修改基於 XML 的配置文件(在本例中 - app/src/main/AndroidManifest.xml )。target="/manifest"
。mode="merge"
,然后我們將我們自己所需的 XML 元素與其合並(在本例中 - <manifest android:installLocation="auto" />
)。有關cordova edit-config 的詳細信息,請單擊此處。
有關 android 安裝位置的詳細信息,請參閱此處。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.