Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13544

Can't install plugin. Your android platform does not have Api.js



    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 6.3.0
    • None
    • Node: v8.9.0
      NPM: 5.5.1
      Cordova: 7.1.0
      Plugman: 1.5.1
      cordova-android: 6.3.0


      I'm trying to create an Android/iOS plugin but while trying Cordova is throwing an error. Here are the steps I follow:

      plugman create --name myplugin --plugin_id org.nov.myplugin --plugin_version 0.0.1
      cd myplugin
      plugman platform add --platform_name android

      cd ..
      cordova create myapp && cd myapp
      cordova platform add android@latest

      cd ..
      plugman install --platform android --project ./myapp --plugin ./myplugin

      And this is the output:

      Creating a new cordova project.
      Using cordova-fetch for cordova-android@latest
      Adding android project...
      Creating Cordova project for the Android platform:
      Path: platforms/android
      Package: io.cordova.hellocordova
      Name: HelloCordova
      Activity: MainActivity
      Android target: android-26
      Subproject Path: CordovaLib
      Android project created with cordova-android@6.3.0
      Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
      Installing "cordova-plugin-whitelist" for android

      This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do not need this plugin since the whitelist will be built in.

      Adding cordova-plugin-whitelist to package.json
      Saved plugin info for "cordova-plugin-whitelist" to config.xml
      --save flag or autosave detected
      Saving android@latest into config.xml file ...
      Installing "org.nov.myplugin" for android
      Unable to load PlatformApi from platform. Error: Cannot find module '/Users/diego/cordovaplayground/myapp/cordova/Api.js'
      The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.
      Failed to install 'org.nov.myplugin': Error: Your android platform does not have Api.js
      at Object.getPlatformApiFunction (/usr/local/lib/node_modules/plugman/node_modules/cordova-lib/src/cordova/util.js:514:19)
      at Object.getPlatformApi (/usr/local/lib/node_modules/plugman/node_modules/cordova-lib/src/platforms/platforms.js:55:25)
      at handleInstall (/usr/local/lib/node_modules/plugman/node_modules/cordova-lib/src/plugman/install.js:593:29)
      at /usr/local/lib/node_modules/plugman/node_modules/cordova-lib/src/plugman/install.js:364:24
      at _fulfilled (/usr/local/lib/node_modules/plugman/node_modules/q/q.js:787:54)
      at self.promiseDispatch.done (/usr/local/lib/node_modules/plugman/node_modules/q/q.js:816:30)
      at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/plugman/node_modules/q/q.js:749:13)
      at /usr/local/lib/node_modules/plugman/node_modules/q/q.js:557:44
      at flush (/usr/local/lib/node_modules/plugman/node_modules/q/q.js:108:17)
      at _combinedTickCallback (internal/process/next_tick.js:131:7)
      Your android platform does not have Api.js

      Any help would be appreciated, thanks!.

      Edit: removed formatting.




            bowserj Joey Robert Bowser
            diego.rubio.nov Diego Rubio
            0 Vote for this issue
            2 Start watching this issue