phonegap Your android platform does not have Api.js

  • 1
  • Problem
  • Updated 3 years ago
So I am trying to compile my code again with phonegap adobe with errors. last time it run with no problems few months. I didnt do much changes. so not sure what happened there. need to upgrade something but dont know what? any help please?

Error - Plugin error (you probably need to remove plugin files from your app): Fetching plugin "cordova-plugin-whitelist@1.2.0" via npm Installing "cordova-plugin-whitelist" at "1.2.0" for android Failed to install 'cordova-plugin-whitelist': Error: Your android platform does not have Api.js at Object.getPlatformApiFunction (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/cordova/util.js:489:19) at Object.getPlatformApi (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/platforms/platforms.js:56:25) at handleInstall (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/plugman/install.js:618:29) at /home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/plugman/install.js:386:24 at _fulfilled (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:749:13) at /home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:557:44 at flush (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:108:17) at _combinedTickCallback (internal/process/next_tick.js:67:7) Your android platform does not have Api.js - You can fix this


here is part of my config file:
 <!-- ios: only build ios and android  -->
    <platform name="ios|android"/>
    <!-- ios: Specify the version of PG iOS  -->
    <platform name="ios">
        <preference name="phonegap-version" value="3.9.2"/>
    </platform>

    <!-- android: Build android with gradle not ant  -->
    <platform name="android">
        <preference name="android-build-tool" value="gradle"/>
    </platform>

    <!--
        If you do not want any permissions to be added to your app, add the
        following tag to your config.xml; you will still have the INTERNET
        permission on your app, which PhoneGap requires.


    
    -->
    <preference name="permissions" value="none"/>

    <preference name="AndroidPersistentFileLocation" value="Compatibility" />

    <!-- Customize your app and platform with the preference element. -->
    <preference name="orientation" value="default"/>
    <!-- all: default means both landscape and portrait are enabled -->
    <preference name="target-device" value="universal"/>
    <!-- all: possible values handset, tablet, or universal -->
    <preference name="fullscreen" value="true"/>
    <!-- all: hides the status bar at the top of the screen -->
    <preference name="webviewbounce" value="true"/>
    <!-- ios: control whether the screen 'bounces' when scrolled beyond the top -->
    <preference name="prerendered-icon" value="true"/>
    <!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen -->
    <preference name="stay-in-webview" value="false"/>
    <!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in -->
    <preference name="StatusBarBackgroundColor" value="#000000"/>
    <!-- ios: set the background color of the statusbar by a hex string (#RRGGBB) at startup.-->
    <preference name="StatusBarStyle" value="blacktranslucent"/>
    <!-- ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar   Available options default, lightcontent, blacktranslucent, blackopaque -->
    <preference name="detect-data-types" value="true"/>
    <!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system -->
    <preference name="exit-on-suspend" value="false"/>
    <!-- ios: if set to true, app will terminate when home button is pressed -->
    <preference name="show-splash-screen-spinner" value="true"/>
    <!-- ios: if set to false, the spinner won't appear on the splash screen during app loading -->
    <preference name="auto-hide-splash-screen" value="true"/>
    <!-- ios: if set to false, the splash screen must be hidden using a JavaScript API -->
    <preference name="disable-cursor" value="false"/>
    <!-- blackberry: prevents a mouse-icon/cursor from being displayed on the app -->
    <preference name="android-minSdkVersion" value="15"/>
    <!-- android: MIN SDK version supported on the target device. MAX version is blank by default. -->
    <preference name="android-installLocation" value="auto"/>
    <!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. -->
    <preference name="SplashScreen" value="splash.png"/>
    <preference name="SplashScreenDelay" value="10000"/>
    <preference name="StatusBarOverlaysWebView" value="false"/>
    <!-- ios: show the status bar ontop of the app -->
    <preference name="DisallowOverscroll" value="true"/>
    <!-- ios: disable overscroll  -->
    <!-- Define a specific version of PhoneGap to build into your app. -->
    <preference name="phonegap-version" value="cli-5.2.0"/>
    
    <!-- Plugins -->
    <plugin name="cordova-plugin-whitelist" spec="1.2.0"/>
    <plugin name="cordova-plugin-statusbar" spec="2.0.0"/>
    <plugin name="phonegap-plugin-push" spec="1.4.4"/>
    <plugin name="cordova-plugin-camera" spec="1.2.0"/>
    <plugin name="cordova-plugin-device" spec="1.1.0"/>
    <plugin name="cordova-plugin-device-motion" spec="1.2.0"/>
    <plugin name="cordova-plugin-device-orientation" spec="1.0.2"/>
    <plugin name="cordova-plugin-dialogs" spec="1.2.0"/>
    <plugin name="cordova-plugin-file" spec="3.0.0"/>
    <plugin name="cordova-plugin-file-transfer" spec="1.4.0"/>
    <plugin name="cordova-plugin-globalization" spec="1.0.2"/>
    <plugin name="cordova-plugin-inappbrowser" spec="1.1.0"/>
    <plugin name="cordova-plugin-network-information" spec="1.1.0"/>
    <plugin name="cordova-plugin-vibration" spec="2.0.0"/>
    <plugin name="cordova-plugin-splashscreen" spec="3.0.0"/>
    <plugin name="cordova-plugin-x-socialsharing" spec="5.0.7"/>

    <plugin spec="https://github.com/jeduan/cordova-plugin-facebook4#aff9a08a86cc6c6a18019f7adc2896ddf97c11cd"; source="git" >
Photo of Issam Dal

Issam Dal

  • 5 Posts
  • 0 Reply Likes

Posted 3 years ago

  • 1

Be the first to post a reply!