Android Phonegap Build config.xml和地理位置
我在使用地理定位和PhoneGap构建时遇到了一个非常奇怪的问题。我的config.xml如下所示:Android Phonegap Build config.xml和地理位置,android,phonegap-build,phonegap,Android,Phonegap Build,Phonegap,我在使用地理定位和PhoneGap构建时遇到了一个非常奇怪的问题。我的config.xml如下所示: <?xml version='1.0' encoding='utf-8'?> <widget id="net.seekadventure" version="0.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>Seek
<?xml version='1.0' encoding='utf-8'?>
<widget id="net.seekadventure" version="0.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Seek Adventure Map</name>
<description>
A map to help you find your next Adventure!
</description>
<author email="myEmail" href="https://www.seekadventure.net">
Seek ADventure Team
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<preference name="permissions" value="none"/>
<feature name="http://api.phonegap.com/1.0/geolocation"/>
<plugin name="cordova-plugin-geolocation" spec="1" />
<icon src="icon.png" />
<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>
</widget>
寻找冒险地图
一张帮助你找到下一次冒险的地图!
寻找探险队
问题是,当我在手机上安装并打开它时,它会弹出一个窗口,上面写着:
“此应用程序是为旧版本的Android构建的,可能无法正常工作。请尝试检查更新,或与开发人员联系”
因为我犯了这个错误,所以我做了一些研究,并将其添加到config.xml中
<preference name="android-minSdkVersion" value="27" />
<preference name="android-maxSdkVersion" value="29" />
<preference name="android-targetSdkVersion" value="28" />
当我添加上述代码时,它修复了关于在旧版本上构建的错误,但GPS权限不起作用。。。。有什么想法吗
更新:
我还尝试指定插件的源代码和版本,但没有帮助:
<plugin name="cordova-plugin-geolocation" source="npm" spec="4.0.2" />
我没有在config/xml中指定CLI版本,这是导致问题的原因:
<preference name="phonegap-version" value="cli-9.0.0" />