Ionic 3 google maps link generated in the head - ionic-framework

I'm working on an offline app with ionic version 3 but something strange always happens when i run "ionic cordova run android"
In the index.html in head it generates this :
<!-- cordova.js required for cordova apps (remove if not needed) -->
<script src="https://maps.googleapis.com/maps/api/js?key=xxx"></script>
<script src="cordova.js"></script>
I removed all the plugins and modules for gps and maps
this is my package.json file:
"dependencies": {
"#angular/platform-browser": "5.2.11",
"#angular/platform-browser-dynamic": "5.2.11",
"#ionic-native/aes-256": "^4.20.0",
"#ionic-native/android-permissions": "^4.20.0",
"#ionic-native/app-update": "^4.20.0",
"#ionic-native/app-version": "^4.20.0",
"#ionic-native/barcode-scanner": "^4.20.0",
"#ionic-native/bluetooth-serial": "^4.20.0",
"#ionic-native/core": "~4.18.0",
"#ionic-native/device": "^4.20.0",
"#ionic-native/diagnostic": "^4.19.0",
"#ionic/storage": "^2.2.0",
"cordova-android": "8.1.0",
"cordova-plugin-advanced-http": "^2.1.1",
"cordova-plugin-aes256-encryption": "^1.2.2",
"cordova-plugin-android-permissions": "^1.0.0",
"cordova-plugin-app-update": "^2.0.2",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-appversion": "^1.0.0",
"cordova-plugin-bluetooth-serial": "0.4.7",
"cordova-plugin-dbcopy": "^2.1.2",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-email-composer": "^0.9.2",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^2.5.1",
"cordova-plugin-network-information": "^2.0.2",
"cordova-plugin-permission": "0.1.0",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-uid": "^1.3.0",
"cordova-plugin-uniquedeviceid": "^1.3.2",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-x-toast": "^2.7.2",
"cordova-sqlite-storage": "^3.2.1",
"cordova.plugins.diagnostic": "^4.0.12",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"ts-md5": "^1.2.4",
"zone.js": "0.8.26"
},
I don't need maps anyways so any help would be appreciated !

There is probably still plugins defined in your Cordova config.xml file.
Or alternatively remove the plugins with Cordova command
cordova plugin remove <plugin>
or
cordova plugin rm <plugin>

Related

Ionic build error Execution failed for task ':app:processDebugGoogleServices'

I am using ionic and cordova in my project but am getting the above error, yet when I try to search online, all the solutions include google firebase, yet I am not using anything from firebase. The project has been building successfully but the error just came from now where.
Here is the error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
D:\Projects\Twalako\apps\driver\platforms\android\app\src\nullnull\google-services.json
D:\Projects\Twalako\apps\driver\platforms\android\app\src\debug\google-services.json
D:\Projects\Twalako\apps\driver\platforms\android\app\src\nullnullDebug\google-services.json
D:\Projects\Twalako\apps\driver\platforms\android\app\src\nullnull\debug\google-services.json
D:\Projects\Twalako\apps\driver\platforms\android\app\src\debug\nullnull\google-services.json
D:\Projects\Twalako\apps\driver\platforms\android\app\google-services.json
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Ionic info
Ionic:
Ionic CLI : 6.12.1 (C:\Users\Evans\AppData\Roaming\npm\node_modules\#ionic\cli)
Ionic Framework : #ionic/angular 5.3.2
#angular-devkit/build-angular : 0.1000.8
#angular-devkit/schematics : 10.0.8
#angular/cli : 10.0.8
#ionic/angular-toolkit : 2.3.3
Capacitor:
Capacitor CLI : 2.4.0
#capacitor/core : 2.4.0
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 22 other plugins)
Utility:
cordova-res : 0.15.2
native-run (update available: 1.0.0) : 0.2.8
System:
NodeJS : v14.15.4 (C:\Program Files\nodejs\node.exe)
npm : 6.14.10
OS : Windows 10
package.json
{
"name": "driver",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#agm/core": "^3.0.0-beta.0",
"#angular/common": "~10.0.0",
"#angular/core": "~10.0.0",
"#angular/forms": "~10.0.0",
"#angular/platform-browser": "~10.0.0",
"#angular/platform-browser-dynamic": "~10.0.0",
"#angular/router": "~10.0.0",
"#capacitor/core": "2.4.0",
"#ionic-native/android-permissions": "^5.30.0",
"#ionic-native/app-version": "^5.28.0",
"#ionic-native/badge": "^5.30.0",
"#ionic-native/call-number": "^5.28.0",
"#ionic-native/camera": "^5.28.0",
"#ionic-native/core": "^5.0.0",
"#ionic-native/crop": "^5.28.0",
"#ionic-native/file": "^5.28.0",
"#ionic-native/geolocation": "^5.28.0",
"#ionic-native/google-maps": "^5.5.0",
"#ionic-native/http": "^5.28.0",
"#ionic-native/in-app-browser": "^5.28.0",
"#ionic-native/ionic-webview": "^5.28.0",
"#ionic-native/location-accuracy": "^5.30.0",
"#ionic-native/native-geocoder": "^5.28.0",
"#ionic-native/network": "^5.30.0",
"#ionic-native/sms-retriever": "^5.28.0",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^5.0.0",
"#ionic/storage": "^2.3.1",
"call-number": "^1.0.1",
"cordova-androidx-build": "^1.0.4",
"cordova-plugin-add-swift-support": "^2.0.2",
"cordova-plugin-advanced-http": "^3.0.1",
"cordova-plugin-android-permissions": "^1.1.2",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-crop": "^0.4.0",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-geolocation": "^4.0.2",
"cordova-plugin-googlemaps": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#multiple_maps",
"cordova-plugin-inappbrowser": "^4.0.0",
"cordova-plugin-nativegeocoder": "^3.4.1",
"cordova-plugin-network-information": "^2.0.2",
"cordova-plugin-request-location-accuracy": "^2.3.0",
"cordova-plugin-sms-retriever-manager": "^1.0.2",
"cordova-support-android-plugin": "^1.0.2",
"cordova-support-google-services": "^1.4.1",
"cupertino-pane": "git+https://github.com/roman-rr/cupertino-pane.git",
"ionic-selectable": "^4.7.1",
"ng-otp-input": "^1.7.1",
"ngx-ion-simple-mask": "^0.8.8",
"rxjs": "~6.5.5",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"#angular-devkit/build-angular": "~0.1000.0",
"#angular/cli": "~10.0.5",
"#angular/compiler": "~10.0.0",
"#angular/compiler-cli": "~10.0.0",
"#angular/language-service": "~10.0.0",
"#capacitor/cli": "2.4.0",
"#ionic/angular-toolkit": "^2.3.0",
"#types/googlemaps": "^3.39.13",
"#types/jasmine": "~3.5.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"cordova-android": "^8.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.2.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.9.5"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-sms-retriever-manager": {
"PLAY_SERVICES_VERSION": "15.0.1"
},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-app-version": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-file": {},
"cordova-plugin-crop": {},
"cordova-plugin-geolocation": {},
"cordova-plugin-nativegeocoder": {},
"mx.ferreyra.callnumber": {},
"cordova-plugin-advanced-http": {},
"cordova-plugin-googlemaps": {},
"cordova-plugin-android-permissions": {},
"cordova-plugin-request-location-accuracy": {
"PLAY_SERVICES_LOCATION_VERSION": "16.+"
},
"cordova-plugin-network-information": {},
"cordova-plugin-badge": {}
},
"platforms": [
"android"
]
}
}
As you are using cordova-support-google-services for Google Play services so you need to add google-service.json file into your root folder.
To get this file logged in into google console (https://console.firebase.google.com/)
Create New Project / Open Existing Project.
Go to Project Setting & Add/Open Android platform.
Download google-service.json file from there.
Screenshot from the google console:
Add downloaded file to your app root directory.
Project view & file on Visual studio:
Hope this will help you to rid out of google service error.
Thanks!

Cannot find module 'UNMET/package.json'

I'm trying to install a cordova plugin in my ionic app. But Every time and every plugin I try to install throws an error:
Cannot find module 'UNMET/package.json'
I already have to delete the paths: node_modules, plugins, platforms, www a lot of times.
I run:
npm install
ionic cordova plugin add cordova-plugin-local-notification
ionic cordova platform add android
and I tryied to change the order of this, but the problem don't be solved.
I'm running in a Ubuntu 18, ionic version is 4.8.0, cordova version is 9.0.0, cordova-lib 9.0.1, node version 8.10.0, npm 3.5.2.
I just run this line in terminal:
ionic cordova plugin add cordova-plugin-local-notification
my package json:
{
"name": "project-name",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"android": "ionic cordova run android",
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"buildAndroid": "ionic cordova build android --aot --minifyjs --minifycss"
},
"dependencies": {
"#angular/animations": "5.2.11",
"#angular/common": "5.2.11",
"#angular/compiler": "5.2.11",
"#angular/compiler-cli": "5.2.11",
"#angular/core": "5.2.11",
"#angular/fire": "^5.1.1",
"#angular/forms": "5.2.11",
"#angular/http": "5.2.11",
"#angular/platform-browser": "5.2.11",
"#angular/platform-browser-dynamic": "5.2.11",
"#ionic-native/background-geolocation": "^4.20.0",
"#ionic-native/base64": "^4.20.0",
"#ionic-native/camera": "^4.20.0",
"#ionic-native/core": "~4.18.0",
"#ionic-native/crop": "^4.20.0",
"#ionic-native/facebook": "^4.20.0",
"#ionic-native/geolocation": "^4.20.0",
"#ionic-native/google-plus": "^4.20.0",
"#ionic-native/local-notifications": "^4.20.0",
"#ionic-native/location-accuracy": "^4.20.0",
"#ionic-native/social-sharing": "^4.20.0",
"#ionic-native/splash-screen": "~4.18.0",
"#ionic-native/sqlite": "^4.20.0",
"#ionic-native/status-bar": "~4.18.0",
"#ionic/storage": "2.2.0",
"#mauron85/cordova-plugin-background-geolocation": "3.0.3",
"brmasker-ionic-3": "^1.6.3",
"com-badrit-base64": "^0.2.0",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-crop": "^0.4.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-geolocation": "4.0.2",
"cordova-plugin-googleplus": "7.0.2",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^3.1.2",
"cordova-plugin-local-notification": "0.9.0-beta.2",
"cordova-plugin-request-location-accuracy": "2.3.0",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "5.4.7",
"cordova-sqlite-storage": "^3.2.0",
"es6-promise-plugin": "4.2.2",
"firebase": "^5.8.4",
"ionic-angular": "3.9.3",
"ionicons": "3.0.0",
"ngx-multilingual": "0.0.3",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.29"
},
"devDependencies": {
"#ionic/app-scripts": "3.2.1",
"#ionic/lab": "1.0.20",
"typescript": "~2.6.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": {},
"com-badrit-base64": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-crop": {},
"cordova-plugin-mauron85-background-geolocation": {
"GOOGLE_PLAY_SERVICES_VERSION": "11+",
"ANDROID_SUPPORT_LIBRARY_VERSION": "26+",
"ICON": "#mipmap/icon",
"SMALL_ICON": "#mipmap/icon",
"ACCOUNT_NAME": "#string/app_name",
"ACCOUNT_LABEL": "#string/app_name",
"ACCOUNT_TYPE": "$PACKAGE_NAME.account",
"CONTENT_AUTHORITY": "$PACKAGE_NAME"
},
"cordova-plugin-googleplus": {
"PLAY_SERVICES_VERSION": "11.8.0"
},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": "Para pegar as melhores promoções"
},
"cordova-plugin-request-location-accuracy": {
"PLAY_SERVICES_LOCATION_VERSION": "16.+"
},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
},
"cordova-plugin-local-notification": {}
},
"platforms": [
"android"
]
}
}
But every plugin throw this error.
I just need to install plugins in my app again.
Just update npm and you'll be able to build again :)

firebasex error: constructor Builder in class Builder cannot be applied to given types

I am making an Ionic app and I want to integrate cordova plugin firebase. Unfortunately, this plugin is not maintained anymore so I use a fork: firebasex.
When running "ionic cordova run android", I get the following error:
BUILD FAILED in 43s
C:\[...]\platforms\android\gradlew: Command failed with exit code 1 Error output:
Note: C:\[...]\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\[...]\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:405: error: cannot find symbol
boolean areNotificationsEnabled = notificationManagerCompat.areNotificationsEnabled();
^
symbol: method areNotificationsEnabled()
location: variable notificationManagerCompat of type NotificationManagerCompat
C:\[...]\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginMessagingService.java:204: error: constructor Builder in class Builder cannot be applied to given types;
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
^
required: Context
found: FirebasePluginMessagingService,String
reason: actual and formal argument lists differ in length
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
I have tried everything: removing and adding back android platform, use androidx, reinstalling modules etc etc.
Ionic info:
Ionic:
Ionic CLI : 5.2.3 (C:\Users\test\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : #ionic/angular 4.7.1
#angular-devkit/build-angular : 0.13.9
#angular-devkit/schematics : 7.3.9
#angular/cli : 7.3.9
#ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 16 other plugins)
Utility:
cordova-res : 0.6.0
native-run : 0.2.8
System:
Android SDK Tools : 26.1.1 (C:\[...]\AppData\Local\Android\Sdk)
NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
Cordova version:
9.0.0 (cordova-lib#9.0.1)
Package.json:
{
"name": "myapp",
"version": "1.0.0",
"author": "me",
"homepage": "page.com",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/common": "^7.2.2",
"#angular/core": "^7.2.2",
"#angular/forms": "^7.2.2",
"#angular/http": "^7.2.2",
"#angular/platform-browser": "^7.2.2",
"#angular/platform-browser-dynamic": "^7.2.2",
"#angular/router": "^7.2.2",
"#ionic-native/base64": "^5.9.0",
"#ionic-native/camera": "^5.9.0",
"#ionic-native/core": "^5.0.0",
"#ionic-native/file": "^5.10.0",
"#ionic-native/file-chooser": "^5.10.0",
"#ionic-native/file-picker": "^5.10.0",
"#ionic-native/file-transfer": "^5.9.0",
"#ionic-native/firebase": "^5.11.0",
"#ionic-native/http": "^5.9.0",
"#ionic-native/ionic-webview": "^5.11.0",
"#ionic-native/media-capture": "^5.0.0",
"#ionic-native/social-sharing": "^5.10.0",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic-native/streaming-media": "^5.9.0",
"#ionic/angular": "^4.1.0",
"com-badrit-base64": "0.2.0",
"cordova-android": "^8.0.0",
"cordova-plugin-android-support-v4": "^21.0.1",
"cordova-plugin-androidx": "^1.0.2",
"cordova-plugin-androidx-adapter": "^1.1.0",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-file": "6.0.1",
"cordova-plugin-file-transfer": "1.7.1",
"cordova-plugin-filechooser": "1.2.0",
"cordova-plugin-filepicker": "1.1.6",
"cordova-plugin-ionic-webview": "4.1.1",
"cordova-plugin-media-capture": "^3.0.3",
"cordova-plugin-streaming-media": "2.2.0",
"cordova-plugin-x-socialsharing": "5.4.7",
"cordova-support-android-plugin": "1.0.1",
"core-js": "^2.5.4",
"es6-promise-plugin": "4.2.2",
"rxjs": "~6.5.1",
"tslib": "^1.9.0",
"zone.js": "~0.8.29"
},
"devDependencies": {
"#angular-devkit/architect": "~0.13.8",
"#angular-devkit/build-angular": "~0.13.8",
"#angular-devkit/core": "~7.3.8",
"#angular-devkit/schematics": "~7.3.8",
"#angular/cli": "^7.3.9",
"#angular/compiler": "~7.2.2",
"#angular/compiler-cli": "~7.2.2",
"#angular/language-service": "~7.2.2",
"#ionic/angular-toolkit": "~1.5.1",
"#types/jasmine": "~2.8.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~12.0.0",
"codelyzer": "~4.5.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~8.3.0",
"tslint": "~5.17.0",
"typescript": "~3.1.6"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-file-transfer": {},
"cordova-plugin-camera": {},
"cordova-plugin-streaming-media": {},
"cordova-plugin-media-capture": {},
"com-badrit-base64": {},
"cordova-plugin-filechooser": {},
"cordova-plugin-filepicker": {},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-file": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-android-support-v4": {},
"cordova-plugin-androidx-adapter": {},
"cordova-plugin-androidx": {},
"cordova-plugin-firebasex": {}
},
"platforms": [
"android"
]
}
}
Thanks for helping me.
For clarity and people just like me searching 'firebase-x boolean areNotificationsEnabled = notificationManagerCompat.areNotificationsEnabled();', the answer is #mobiemp 's comment re android v4.
Simply remove it:
# ionic users
ionic cordova plugin remove cordova-plugin-android-support-v4
# cordova users
cordova plugin remove cordova-plugin-android-support-v4
cordova clean android; # flush it out
# then use your run command again, ie
ionic cordova run android -lc --address=0.0.0.0;
you need to remove firebase plugin if it is still there... also you need to update firebasex... it will fix the problem... if it isn't then trying removing some deprecated plugins you will able to find out in which plugin the problem exists...
it is the problem with the plugin the error message indicating that point. the similar problem exists with other plugins and update of the plugin and removing of the plugin fix the error...
here is the reference

Cannot find module '#ionic-native/power-management/ngx'

I installed cordova power management plugin into my ionic application. Following the usage guidance "https://ionicframework.com/docs/native/power-management#installationenter link description here", I import the class as below:
import { PowerManagement } from '#ionic-native/power-management/ngx';
but, when build this ionic app, got the error:
Cannot find module '#ionic-native/power-management/ngx'
Why this error appears? How to fix it?
I try to import the class with removing the ngx module, then error disappears:
import { PowerManagement } from '#ionic-native/power-management';
my package.json file is:
{
"name": "ionicapp",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint"
},
"dependencies": {
"#angular/animations": "5.2.11",
"#angular/common": "5.2.11",
"#angular/compiler": "5.2.11",
"#angular/compiler-cli": "5.2.11",
"#angular/core": "^5.2.11",
"#angular/forms": "5.2.11",
"#angular/http": "5.2.11",
"#angular/platform-browser": "5.2.11",
"#angular/platform-browser-dynamic": "5.2.11",
"#angular/router": "^6.1.9",
"#ionic-native/background-geolocation": "^4.16.0",
"#ionic-native/background-mode": "^4.20.0",
"#ionic-native/ble": "^4.12.0",
"#ionic-native/bluetooth-serial": "^4.12.2",
"#ionic-native/camera": "4.3.3",
"#ionic-native/core": "^4.12.2",
"#ionic-native/geolocation": "^4.12.0",
"#ionic-native/google-maps": "^4.12.0",
"#ionic-native/launch-navigator": "^4.15.0",
"#ionic-native/native-storage": "^4.12.0",
"#ionic-native/network": "^4.12.2",
"#ionic-native/network-interface": "^4.12.2",
"#ionic-native/power-management": "^4.20.0",
"#ionic-native/splash-screen": "~4.11.0",
"#ionic-native/sqlite": "^4.12.2",
"#ionic-native/status-bar": "^4.11.0",
"#ionic/storage": "^2.1.3",
"#ngx-translate/core": "8.0.0",
"#ngx-translate/http-loader": "^2.0.0",
"#types/google-maps": "^3.2.0",
"#types/googlemaps": "^3.30.12",
"an": "0.0.8",
"angularfire2": "^5.0.2",
"chart.js": "^2.7.2",
"cordova-android": "7.1.0",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-background-mode": "git+https://github.com/tushe/cordova-plugin-background-mode.git",
"cordova-plugin-ble-central": "^1.2.2",
"cordova-plugin-bluetooth-serial": "^0.4.7",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-dialogs": "^2.0.1",
"cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-googlemaps": "^2.4.2",
"cordova-plugin-ionic-keyboard": "^2.1.2",
"cordova-plugin-ionic-webview": "^2.1.0",
"cordova-plugin-mauron85-background-geolocation": "^3.0.0-alpha.43",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-network-information": "^2.0.1",
"cordova-plugin-networkinterface": "^2.0.0",
"cordova-plugin-powermanagement-orig": "^1.1.2",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-sqlite-storage": "^2.4.0",
"firebase": "^5.5.3",
"ionic-angular": "3.9.2",
"ionic-native": "4.1.1",
"ionicons": "3.0.0",
"ng2-charts": "^1.6.0",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "^4.2.2",
"zone.js": "0.8.26",
"at.gofg.sportscomputer.powermanagement": "~1.1.2"
},
"devDependencies": {
"#ionic/app-scripts": "^3.2.0",
"#mauron85/cordova-plugin-background-geolocation": "^3.0.0-alpha.4",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-ble-central": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
},
"cordova-plugin-mauron85-background-geolocation": {
"GOOGLE_PLAY_SERVICES_VERSION": "11+",
"ANDROID_SUPPORT_LIBRARY_VERSION": "23+",
"ALWAYS_USAGE_DESCRIPTION": "App requires background tracking enabled",
"MOTION_USAGE_DESCRIPTION": "App requires motion detection"
},
"cordova-plugin-nativestorage": {},
"cordova-sqlite-storage": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-bluetooth-serial": {},
"cordova-plugin-network-information": {},
"cordova-plugin-networkinterface": {},
"uk.co.workingedge.phonegap.plugin.launchnavigator": {
"OKHTTP_VERSION": "3.+"
},
"cordova-plugin-background-mode": {},
"at.gofg.sportscomputer.powermanagement": {}
},
"platforms": [
"android"
]
}
}
Use ngx if your Angular version is >=6
You seem to be using the wrong plugin version. Correct your error by following the steps mentioned below
Check your project type in ionic.config.json file.
If the type is "ionic-angular", then install 4 version.
ionic cordova plugin add cordova-plugin-powermanagement-orig
npm install #ionic-native/power-management#4
If the type is "angular", then install the latest version
ionic cordova plugin add cordova-plugin-powermanagement-orig
npm install #ionic-native/power-management
Note:
Add ngx at the end of import only if you are using Angular 6 or 6+
import { PowerManagement } from '#ionic-native/power-management/ngx';
if not remove ngx from the import both in app.module.ts and app.component.ts
import { PowerManagement } from '#ionic-native/power-management';
Refencence:https://github.com/ionic-team/ionic/issues/15225#issuecomment-414074074

How to stop ionic cordova run android command delete existing ionic apps on the device

I'm new to the forum and need help on running/installing ionic 3 app on a real device.
This command: ionic cordova run android (in my case) will delete the existing ionic app being installed on the device even though the app names are different.
I'd tried using ionic cordova run android --prod --release but the result is the same, i.e. Only ONE ionic app will be installed on the Android device which doesn't sound right.
Is there a way to prevent that from happening? Any options? Below is my package.json file:
"dependencies": {
"#angular/common": "5.0.3",
"#angular/compiler": "5.0.3",
"#angular/compiler-cli": "5.0.3",
"#angular/core": "5.0.3",
"#angular/forms": "5.0.3",
"#angular/http": "5.0.3",
"#angular/platform-browser": "5.0.3",
"#angular/platform-browser-dynamic": "5.0.3",
"#ionic-native/core": "4.4.0",
"#ionic-native/splash-screen": "4.4.0",
"#ionic-native/status-bar": "4.4.0",
"#ionic/pro": "1.0.16",
"#ionic/storage": "2.1.3",
"cordova-android": "6.3.0",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-whitelist": "^1.3.1",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
Have you changed the package name of that App? This issue happened when package name of Apps are same.