Cordova-plugin-firebase: Platform android already exists/platform "android" does not appear to be a valid cordova platform

Created on 9 May 2019  路  2Comments  路  Source: arnesson/cordova-plugin-firebase

Describe the bug
While trying to solve this issue I had to run:

  1. ionic cordova platform rm android
  2. ionic cordova plugin rm cordova-plugin-firebase
  3. ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue

I now have new problems.
When trying to run:
ionic cordova platform add android. error-> Platform android already exists.
The folder platforms/android is not there!!!!

When trying to run:
ionic cordova plugin add cordova-plugin-firebase error-> Unhandled error. (The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.)

To Reproduce
Steps to reproduce the behavior:

image

Expected behavior
Tried to solve this problem but now can't reinstall android platform

Screenshots
Mostly empty android platform folder
image

Plugin Version
cordova-android-firebase-gradle-release 1.0.3 "cordova-android-firebase-gradle-release"
cordova-android-play-services-gradle-release 1.4.4 "cordova-android-play-services-gradle-release"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-googleplus 5.3.2 "Google SignIn"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 2.1.4 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 2.4.0 "Cordova sqlite storage plugin"

ionic info
[ERROR] Error loading @ionic/angular-toolkit package.json: Error: Cannot find module '@ionic/angular-toolkit/package'

Ionic:

ionic (Ionic CLI) : 4.7.1 (C:UsersHenryAppDataRoamingnpmnode_modulesionic)
Ionic Framework : @ionic/angular 4.0.2
@angular-devkit/build-angular : 0.7.5
@angular-devkit/schematics : 0.7.5
@angular/cli : 6.1.5
@ionic/angular-toolkit : not installed

Cordova:
cordova (Cordova CLI) : 9.0.0 ([email protected])
Cordova Platforms : android, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.1.4, (and 9 other plugins)

System:
Android SDK Tools : 26.1.1 (C:UsersxxxAppDataLocalAndroidsdk)
NodeJS : v10.1.0 (C:Program Filesnodejsnode.exe)
npm : 5.6.0
OS : Windows 10

package.json

{
  "name": "reaper",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~6.1.1",
    "@angular/core": "~6.1.1",
    "@angular/fire": "^5.0.2",
    "@angular/forms": "~6.1.1",
    "@angular/http": "~6.1.1",
    "@angular/platform-browser": "~6.1.1",
    "@angular/platform-browser-dynamic": "~6.1.1",
    "@angular/router": "~6.1.1",
    "@ionic-native/core": "5.0.0-beta.21",
    "@ionic-native/firebase": "^5.0.0-beta.21",
    "@ionic-native/google-plus": "^5.0.0-beta.21",
    "@ionic-native/splash-screen": "5.0.0-beta.21",
    "@ionic-native/status-bar": "5.0.0-beta.21",
    "@ionic/angular": "^4.0.2",
    "@ionic/storage": "^2.2.0",
    "@ngrx/effects": "^6.1.0",
    "@ngrx/entity": "^6.1.0",
    "@ngrx/router-store": "^6.1.0",
    "@ngrx/store": "^6.1.0",
    "cordova-android": "7.1.1",
    "cordova-android-firebase-gradle-release": "^1.0.3",
    "cordova-android-play-services-gradle-release": "^1.4.4",
    "cordova-ios": "4.5.5",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-firebase": "2.0.4",
    "cordova-plugin-googleplus": "5.3.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.1.4",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "2.4.0",
    "core-js": "^2.5.3",
    "firebase": "^5.5.3",
    "rxjs": "6.2.2",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.7.2",
    "@angular-devkit/build-angular": "~0.7.2",
    "@angular-devkit/core": "~0.7.2",
    "@angular-devkit/schematics": "~0.7.2",
    "@angular/cli": "~6.1.1",
    "@angular/compiler": "~6.1.1",
    "@angular/compiler-cli": "~6.1.1",
    "@angular/language-service": "~6.1.1",
    "@ionic/ng-toolkit": "^1.0.0",
    "@ionic/schematics-angular": "^1.0.0",
    "@ngrx/schematics": "^6.1.0",
    "@ngrx/store-devtools": "^6.1.0",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~10.11.3",
    "codelyzer": "~4.4.2",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ngrx-store-freeze": "^0.2.4",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "^2.9.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-googleplus": {
        "REVERSED_CLIENT_ID": "xxxxxxxxxx",
        "WEB_APPLICATION_CLIENT_ID": "xxxxxxxxxxx",
        "PLAY_SERVICES_VERSION": "11.8.0"
      },
      "cordova-android-play-services-gradle-release": {
        "PLAY_SERVICES_VERSION": "+"
      },
      "cordova-android-firebase-gradle-release": {
        "FIREBASE_VERSION": "+"
      }
    },
    "platforms": [
      "android",
      "ios"
    ]
  }
}

Most helpful comment

Solved by deleting the entire platforms folder and running _ionic cordova plugin add cordova-android-support-gradle-release_ and _ionic cordova platform add android_ and _ionic cordova platform add ios_

All 2 comments

Solved by deleting the entire platforms folder and running _ionic cordova plugin add cordova-android-support-gradle-release_ and _ionic cordova platform add android_ and _ionic cordova platform add ios_

still the exists.

Was this page helpful?
0 / 5 - 0 ratings