Ionic Pro iOS package tries to build with Android plugins & fails

cli packages: (C:\Users\mysuperuser\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.0.1
    Node              : v9.3.0
    npm               : 5.5.1
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Program Files (x86)\Android\android-sdk

Misc:

    backend : pro

iOS App Store build goes fine till it starts trying installing Android packages:

iOS project created with cordova-ios@4.5.4
Discovered plugin "ionic-plugin-keyboard" in config.xml. Adding it to the project
Fetching plugin "ionic-plugin-keyboard@^2.2.1" via npm
Installing "ionic-plugin-keyboard" for android
Unable to load PlatformApi from platform. Error: Cannot find module '/Users/ionic/builds/project-1/platforms/android/cordova/Api.js'

From this point on all similar errors for plugins.

Any ideas how to fix it?

Good people of Ionic Pro team helped me out.

Apparently I’ve added few files (like build.gradle) to repo in the past that shouldn’t be there and they were causing this problem. Only keeping the files that should be there gave me a successful package build.

git rm -r --cached .
git add . 
git commit -m 'restoring gitignore'
git push ionic master