build.phonegap“插件不支持:cordova-plugin-device”

时间:2017-01-29 22:39:21

标签: android cordova phonegap-plugins cordova-plugins phonegap-build

build.phonegap“插件不支持:cordova-plugin-device”

我尝试过在线提到的不同解决方案,但对我来说没有任何作用。请帮我。这适用于Phonegap桌面,但我无法构建应用程序。请给我一个解决方案。

<?xml version="1.0" encoding="utf-8" ?>
    <widget xmlns = "http://www.w3.org/ns/widgets"
        xmlns:gap = "http://phonegap.com/ns/1.0"
        xmlns:android = "http://schemas.android.com/apk/res/android"
        id        = "jyugen.driver.app"
        version   = "1.3.0">
        <name>justyugen Driver App</name>
        <description>
            justyugen Driver App
        </description>
        <author email="info@justyugen.com" href="http://cordova.io">
            justyugen.com
        </author>
        <icon src="icon.png" />           
        <content src="index.html" />

        <preference name="orientation" value="portrait" />
        <preference name="android-build-tool" value="gradle" />
        <preference name="permissions" value="none"/>

        <gap:plugin name="cordova-plugin-whitelist" source="npm" />
        <gap:plugin name="phonegap-plugin-push" source="npm" spec="1.5.3" />
        <gap:plugin name="cordova-plugin-device" />     
        <gap:plugin name="cordova-plugin-inappbrowser" source="npm" />      
        <gap:plugin name="cordova-plugin-splashscreen" />   
        <gap:plugin name="cordova-plugin-geolocation" />
        <gap:plugin name="cordova-plugin-network-information" />    
        <gap:plugin name="cordova-plugin-background-mode" source="npm" />
        <gap:plugin name="cordova-plugin-request-location-accuracy" source="npm" />
        <gap:plugin name="cordova-plugin-x-toast" source="npm" />   
        <gap:plugin name="cordova-plugin-media" />  

        <gap:plugin spec="https://github.com/mapsplugin/cordova-plugin-googlemaps.git" source="git" >
           <param name="API_KEY_FOR_ANDROID" value="XXX" />
           <param name="API_KEY_FOR_IOS" value="XXX" />
        </gap:plugin>

        <plugin name="cordova-plugin-insomnia" version="4.1.0" source="npm" />     

        <gap:splash src="splash.png" />
        <preference name="AutoHideSplashScreen" value="false" />    
        <preference name="SplashScreenDelay" value="5000" />  

        <access origin="*" />
        <access origin="tel:*" launch-external="yes" />

        <gap:config-file platform="android" parent="/manifest">
            <supports-screens android:xlargeScreens="true" android:largeScreens="true" android:smallScreens="true" />
            <application android:theme="@android:style/Theme.NoTitleBar" >            
            </application>
        </gap:config-file> 

        <icon src="icons/android/ldpi.png" platform="android" qualifier="ldpi" />
        <icon src="icons/android/mdpi.png" platform="android" qualifier="mdpi" />
        <icon src="icons/android/hdpi.png" platform="android" qualifier="hdpi" />
        <icon src="icons/android/xhdpi.png" platform="android" qualifier="xhdpi" />
        <icon src="icons/android/xxhdpi.png" platform="android" qualifier="xxhdpi" />
        <icon src="icons/android/fr-xxhdpi.png" platform="android" qualifier="fr-xxhdpi" />

        <splash src="splash/android/ldpi.png" platform="android" qualifier="ldpi" />
        <splash src="splash/android/mdpi.png" platform="android" qualifier="mdpi" />
        <splash src="splash/android/hdpi.png" platform="android" qualifier="hdpi" />
        <splash src="splash/android/xhdpi.png" platform="android" qualifier="xhdpi" />
        <splash src="splash/android/portrait-xxhdpi.png" platform="android" qualifier="port-xxhdpi" />
        <splash src="splash/android/landscape-xxhdpi.png" platform="android" qualifier="land-xxhdpi" />

        <!--IOS 7-->
        <!-- iPhone 6 / 6+ -->
        <icon src="icons/ios/icon-60@3x.png" platform="ios" width="180" height="180" />

        <!-- iPhone / iPod Touch  -->
        <icon src="icons/ios/icon-60.png" platform="ios" width="60" height="60" />
        <icon src="icons/ios/icon-60@2x.png" platform="ios" width="120" height="120" />

        <!-- iPad -->
        <icon src="icons/ios/icon-76.png" platform="ios" width="76" height="76" />
        <icon src="icons/ios/icon-76@2x.png" platform="ios" width="152" height="152" />

        <!-- Settings Icon -->
        <icon src="icons/ios/icon-small.png" platform="ios" width="29" height="29" />
        <icon src="icons/ios/icon-small@2x.png" platform="ios" width="58" height="58" />

        <!-- Spotlight Icon -->
        <icon src="icons/ios/icon-40.png" platform="ios" width="40" height="40" />
        <icon src="icons/ios/icon-40@2x.png" platform="ios" width="80" height="80" />

        <!--IOS 6.1-->
        <!-- iPhone / iPod Touch -->
        <icon src="icons/ios/icon57.png" platform="ios" width="57" height="57" />
        <icon src="icons/ios/icon@2x.png" platform="ios" width="114" height="114" />

        <!-- iPad -->
        <icon src="icons/ios/icon-72.png" platform="ios" width="72" height="72" />
        <icon src="icons/ios/icon-72@2x.png" platform="ios" width="144" height="144" />

        <!-- iPad Spotlight and Settings Icon -->
        <icon src="icons/ios/icon-50.png" platform="ios" width="50" height="50" />
        <icon src="icons/ios/icon-50@2x.png" platform="ios" width="100" height="100" />

        <!--end ICONS-->

        <!-- iPhone and iPod touch -->
        <splash src="splash/ios/Default.png" platform="ios" width="320" height="480" />
        <splash src="splash/ios/Default@2x.png" platform="ios" width="640" height="960" />

        <!-- iPhone 5 / iPod Touch (5th Generation) -->
        <splash src="splash/ios/Default-568h@2x.png" platform="ios" width="640" height="1136" />

        <!-- iPhone 6 -->
        <splash src="splash/ios/Default-667h@2x.png" platform="ios" width="750" height="1334" />
        <splash src="splash/ios/Default-Portrait-736h@3x.png" platform="ios" width="1242" height="2208" />
        <splash src="splash/ios/Default-Landscape-736h@3x.png" platform="ios" width="2208" height="1242" />

        <!-- iPad -->
        <splash src="splash/ios/Default-Portrait.png" platform="ios" width="768" height="1024" />
        <splash src="splash/ios/Default-Landscape.png" platform="ios" width="1024" height="768" />

        <!-- Retina iPad -->
        <splash src="splash/ios/Default-Portrait@2x.png" platform="ios" width="1536" height="2048" />
        <splash src="splash/ios/Default-Landscape@2x.png" platform="ios" width="2048" height="1536" />

    </widget>

1 个答案:

答案 0 :(得分:1)

编辑以下行:

<gap:plugin name="cordova-plugin-device" />  
<gap:plugin name="cordova-plugin-splashscreen" />   
<gap:plugin name="cordova-plugin-geolocation" />
<gap:plugin name="cordova-plugin-network-information" /> 
<gap:plugin name="cordova-plugin-media" />  

要:

<gap:plugin name="cordova-plugin-device" source="npm"/>  
<gap:plugin name="cordova-plugin-splashscreen" source="npm"/>   
<gap:plugin name="cordova-plugin-geolocation" source="npm"/>
<gap:plugin name="cordova-plugin-network-information" source="npm" /> 
<gap:plugin name="cordova-plugin-media" source="npm"/>  

我希望有帮助