My Ionic project fails with the following error and searched a lot but unable to resolve. FOllowing is the complete output i get on ionic cordova build android
G:\Development\ionic\RoTheCi\app>ionic cordova run android
Running app-scripts build: --platform android --target cordova
[19:09:25] build dev started ...
[19:09:26] clean started ...
[19:09:26] clean finished in 26 ms
[19:09:26] copy started ...
[19:09:26] deeplinks started ...
[19:09:27] deeplinks finished in 810 ms
[19:09:27] transpile started ...
[19:09:50] transpile finished in 22.94 s
[19:09:50] preprocess started ...
[19:09:50] preprocess finished in 4 ms
[19:09:50] webpack started ...
[19:09:51] copy finished in 24.90 s
[19:10:34] webpack finished in 43.83 s
[19:10:34] sass started ...
[19:10:41] sass finished in 7.12 s
[19:10:41] postprocess started ...
[19:10:41] postprocess finished in 37 ms
[19:10:41] lint started ...
[19:10:41] build dev finished in 75.48 s
> cordova run android
Android Studio project detected
(node:7800) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cannot find module '../cordova/platform_metadata'
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?
[19:11:02] tslint: .../Development/ionic/RobTheCity/app/node_modules/ng-socket-io/socket-io.service.ts, line: 1
'Injectable' is declared but never used.
L1: import { Injectable, Inject } from '@angular/core';
L2: import { Observable } from 'rxjs/Observable';
[19:11:02] tslint: G:/Development/ionic/RobTheCity/app/src/pages/rob/rob.ts, line: 13
'AttemptResp' is declared but never used.
L13: interface AttemptResp {
L14: id?: string;
[19:11:02] tslint: G:/Development/ionic/RobTheCity/app/src/pages/modal-defense/modal-defense.ts, line: 12
All imports are unused.
L12: import differenceInSeconds from 'date-fns/difference_in_seconds';
[19:11:02] tslint: ...ment/ionic/RobTheCity/app/src/providers/http-error-handler/http-error-handler.ts, line: 21
'error' is declared but never used.
L21: private error(error: Response | any) {
L22: let errMsg = '';
[19:11:02] tslint: G:/Development/ionic/RobTheCity/app/src/app/app.module.ts, line: 16
All imports are unused.
L15: import { FCM } from '@ionic-native/fcm';
L16: import { Config } from '../config/config';
L17: const ioConfig: SocketIoConfig = {
[19:11:02] lint finished in 20.82 s
G:\Development\ionic\RobTheCity\app>
My Ionic info is
cli packages: (C:\Users\Imdad Turi\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.6
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 25.2.3
Node : v6.9.1
npm : 4.6.1
OS : Windows 8.1
Environment Variables:
ANDROID_HOME : C:\Users\Public
Misc:
backend : pro
I am not able to find the root cause of the issue, I installed angularfire2 and firebase that resulted into some issues, as I uninstalled firebase and angularfire2, this issue came out of nowhere.