gpt4 book ai didi

android - Phonegap 3.3 和 minSdkVersion=8 变为 minSdkVersion=10

转载 作者:太空狗 更新时间:2023-10-29 14:16:24 26 4
gpt4 key购买 nike

我在 www/config.xml 中将 minSdkVersion 设置为 8:

<preference name="android-minSdkVersion" value="8" />
<preference name="android-installLocation" value="auto" />

当我运行“phonegap local build android”时,会生成以下文件:

find /Users/alain/Documents/projects/pg33_3/platforms/android -type d \( -name RCS -o -name CVS -o -name .svn -o -name SCCS \) -prune -o -type f \! -name \*\~ \! -name \*\,v \! -name s.\* \! -name .\#\*  -print0 | xargs -0  grep -n  -e minSdkVersion  /dev/null
/Users/alain/Documents/projects/pg33_3/platforms/android/AndroidManifest.xml:13: <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
/Users/alain/Documents/projects/pg33_3/platforms/android/assets/www/config.xml:26: <preference name="android-minSdkVersion" value="8" />
/Users/alain/Documents/projects/pg33_3/platforms/android/bin/AndroidManifest.xml:13: <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />/Users/alain/Documents/projects/pg33_3/platforms/android/CordovaLib/AndroidManifest.xml:22: <uses-sdk android:minSdkVersion="8" />
/Users/alain/Documents/projects/pg33_3/platforms/android/CordovaLib/bin/AndroidManifest.xml:22: <uses-sdk android:minSdkVersion="8" />
/Users/alain/Documents/projects/pg33_3/platforms/android/res/xml/config.xml:53: <preference name="android-minSdkVersion" value="8" />

那为什么在AndroidManifest.xml和bin/AndroidManifest.xml中突然变成了minSdkVersion=10呢?

这是我的 config.xml 文件:

<?xml version='1.0' encoding='utf-8'?>
<widget id="it.myapp.MyApp" version="1.5.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>MyApp</name>
<description>
My App
</description>
<author email="contact@myapp.it" href="http://myapp.it">
MyApp Team
</author>
<feature name="http://api.phonegap.com/1.0/device" />

<preference name="permissions" value="none" />
<preference name="orientation" value="portrait" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="8" />
<preference name="android-installLocation" value="auto" />
<icon src="icon.png" />
<icon gap:density="ldpi" gap:platform="android" src="res/icon/android/icon-36-ldpi.png" />
<icon gap:density="mdpi" gap:platform="android" src="res/icon/android/icon-48-mdpi.png" />
<icon gap:density="hdpi" gap:platform="android" src="res/icon/android/icon-72-hdpi.png" />
<icon gap:density="xhdpi" gap:platform="android" src="res/icon/android/icon-96-xhdpi.png" />
<icon gap:platform="blackberry" src="res/icon/blackberry/icon-80.png" />
<icon gap:platform="blackberry" gap:state="hover" src="res/icon/blackberry/icon-80.png" />
<icon gap:platform="ios" height="57" src="res/icon/ios/icon-57.png" width="57" />
<icon gap:platform="ios" height="72" src="res/icon/ios/icon-72.png" width="72" />
<icon gap:platform="ios" height="114" src="res/icon/ios/icon-57-2x.png" width="114" />
<icon gap:platform="ios" height="144" src="res/icon/ios/icon-72-2x.png" width="144" />
<icon gap:platform="webos" src="res/icon/webos/icon-64.png" />
<icon gap:platform="winphone" src="res/icon/windows-phone/icon-48.png" />
<icon gap:platform="winphone" gap:role="background" src="res/icon/windows-phone/icon-173.png" />
<gap:splash gap:density="ldpi" gap:platform="android" src="res/screen/android/screen-ldpi-portrait.png" />
<gap:splash gap:density="mdpi" gap:platform="android" src="res/screen/android/screen-mdpi-portrait.png" />
<gap:splash gap:density="hdpi" gap:platform="android" src="res/screen/android/screen-hdpi-portrait.png" />
<gap:splash gap:density="xhdpi" gap:platform="android" src="res/screen/android/screen-xhdpi-portrait.png" />
<gap:splash gap:platform="blackberry" src="res/screen/blackberry/screen-225.png" />
<gap:splash gap:platform="ios" height="480" src="res/screen/ios/screen-iphone-portrait.png" width="320" />
<gap:splash gap:platform="ios" height="960" src="res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1024" src="res/screen/ios/screen-ipad-portrait.png" width="768" />
<gap:splash gap:platform="ios" height="768" src="res/screen/ios/screen-ipad-landscape.png" width="1024" />
<gap:splash gap:platform="winphone" src="res/screen/windows-phone/screen-portrait.jpg" />

<gap:plugin name="org.apache.cordova.splashscreen" />

<access origin="http://127.0.0.1*" />
</widget>

最佳答案

不幸的是,config.xml 中的许多设置似乎仅供 Phonegap Build 服务使用,在添加本地平台时会被忽略。

我遇到了同样的问题,我找到的唯一解决方案是创建 AndroidManifest.xml 的副本并对其进行更改——然后在 .cordova/hooks 中添加一个 Hook > 复制自定义文件并覆盖 cordova 提供的默认文件的文件夹。

从长远来看,您可能会需要它,因为您想要自定义 phonegap config.xml 文件中未表示的 Android 设置。

关于android - Phonegap 3.3 和 minSdkVersion=8 变为 minSdkVersion=10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21575098/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com