Error While Adding New Provider in ionic - ionic-framework

When i try to add a new provider to my existing ionic project it throws
The generate command is only available for projects t
hat use ionic-angular >= 3.0.0
I tried the following command to upgrade but it doesn't worked out
>npm install --save ionic-angular
My Ionic Version is 3.2.0
My Package.json looks
"dependencies": {
"#angular/common": "2.4.8",
"#angular/compiler": "2.4.8",
"#angular/compiler-cli": "2.4.8",
"#angular/core": "2.4.8",
"#angular/forms": "2.4.8",
"#angular/http": "2.4.8",
"#angular/platform-browser": "2.4.8",
"#angular/platform-browser-dynamic": "2.4.8",
"#angular/platform-server": "2.4.8",
"#angular/tsc-wrapped": "~0.5.2",
"#ionic/storage": "2.0.0",
"ionic-angular": "^2.3.0",
"ionic-native": "2.4.1",
"ionicons": "3.0.0",
"lodash-es": "^4.17.4",
"node-uuid": "^1.4.7",
"rxjs": "5.0.1",
"sw-toolbox": "3.4.0",
"uuid": "^2.0.2",
"zone.js": "0.7.2"
}

Related

Working example of #nativescript/firebase-firestore

I am trying to use the #nativescript/firebase-firestore and #nativescript/firebase-core plugin from Nativescript in my Nativescript angular project.
I ran
npm install #nativescript/firebase-core
npm install #nativescript/firebase-firestore
and put this code to my blank native script angular project.
import { firebase } from '#nativescript/firebase-core'
import '#nativescript/firebase-firestore'
const firestore = firebase().firestore()
I was not able to make this work for IOS due to some compatibility issues.
My questions : Has anybody put this to work and could provide me a working example?
Here is my package.json :
{
"name": "fb3",
"main": "./src/main.ts",
"version": "1.0.0",
"private": true,
"dependencies": {
"#angular/animations": "~15.0.0",
"#angular/common": "~15.0.0",
"#angular/compiler": "~15.0.0",
"#angular/core": "~15.0.0",
"#angular/forms": "~15.0.0",
"#angular/platform-browser": "~15.0.0",
"#angular/platform-browser-dynamic": "~15.0.0",
"#angular/router": "~15.0.0",
"#nativescript/angular": "~15.0.0",
"#nativescript/core": "~8.4.0",
"#nativescript/firebase-core": "^2.5.2",
"#nativescript/firebase-firestore": "^2.5.2",
"#nativescript/theme": "~3.0.2",
"rxjs": "~7.5.0",
"zone.js": "~0.11.5"
},
"devDependencies": {
"#angular-devkit/build-angular": "~15.0.0",
"#angular/compiler-cli": "~15.0.0",
"#nativescript/ios": "8.3.3",
"#nativescript/types": "~8.4.0",
"#nativescript/webpack": "~5.0.12",
"#ngtools/webpack": "~15.0.0",
"typescript": "~4.8.4"
}
}
It seems that there are issues with min required iOS version is 11.0 so I added
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
to my build.xcconfig.

Errors when upgrading to Ionic 3

package.json
"dependencies": {
"#angular/common": "4.0.0",
"#angular/compiler": "4.0.0",
"#angular/compiler-cli": "4.0.0",
"#angular/core": "4.0.0",
"#angular/forms": "4.0.0",
"#angular/http": "4.0.0",
"#angular/platform-browser": "4.0.0",
"#angular/platform-browser-dynamic": "4.0.0",
"#ionic-native/core": "^3.4.2",
"#ionic-native/splash-screen": "3.4.2",
"#ionic-native/status-bar": "3.4.2",
"#ionic/storage": "2.0.1",
"ionic-angular": "3.0.1",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sw-toolbox": "3.4.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"#ionic/app-scripts": "1.3.0",
"typescript": "~2.2.1"
},
When I wanna change my version of Ionic from Ionic2 to Ionic3, I encountered some errors Is it my version of #angular/core outdated or? [Sorry I could not copy and paste the errors here, only can snip a photo of it.]

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.

Cannot read property 'URI' of undefined, Ionic2

"TypeError: Cannot read property 'URI' of undefined"
I got this error whenever I try to use native screenshot method in Ionic2.
My code:
this.screenshot.URI(80).then((result) => {
console.log(result);
}, (err) => {
console.log(err);
});
This is Ionic2 screenshot documentation: https://ionicframework.com/docs/native/screenshot/
"dependencies": {
"#angular/common": "4.0.0",
"#angular/compiler": "4.0.0",
"#angular/compiler-cli": "4.0.0",
"#angular/core": "4.0.0",
"#angular/forms": "4.0.0",
"#angular/http": "4.0.0",
"#angular/platform-browser": "4.0.0",
"#angular/platform-browser-dynamic": "4.0.0",
"#ionic-native/camera": "^3.6.0",
"#ionic-native/core": "3.6.1",
"#ionic-native/file": "^3.6.0",
"#ionic-native/file-path": "^3.6.0",
"#ionic-native/screenshot": "^3.6.1",
"#ionic-native/splash-screen": "3.4.2",
"#ionic-native/status-bar": "3.4.2",
"#ionic-native/transfer": "^3.6.0",
"#ionic/storage": "2.0.1",
"crypto-js": "3.1.9-1",
"fast-sha256": "1.0.0",
"ionic-angular": "3.0.1",
"ionic-native": "^3.5.0",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sha256": "0.2.0",
"sw-toolbox": "3.4.0",
"ts-md5": "1.2.0",
"zone.js": "^0.8.4"

create project in ionic with --v2 and framework are 3

I created a project with
ionic start navigationAppv2 blank --v2
but when I use ionic info say:
Ionic Framework Version: 3.0.0
how can I solve this?
Not sure what you mean but I suspect you want to downgrade your Ionic framework version? If so, you just need to update your package.json to "ionic-angular": "2.3.0" for instance. The below is an extract of my package.json file running on the latest v2 version:
"#angular/common": "2.4.8",
"#angular/compiler": "2.4.8",
"#angular/compiler-cli": "2.4.8",
"#angular/core": "2.4.8",
"#angular/forms": "2.4.8",
"#angular/http": "2.4.8",
"#angular/platform-browser": "2.4.8",
"#angular/platform-browser-dynamic": "2.4.8",
"#angular/platform-server": "2.4.8",
"#ionic-native/core": "3.4.4",
"#ionic-native/device": "3.4.4",
"#ionic-native/in-app-browser": "3.4.4",
"#ionic-native/local-notifications": "3.4.4",
"#ionic-native/splash-screen": "3.4.4",
"#ionic-native/status-bar": "3.4.4",
"#ionic/storage": "2.0.0",
"ionic-angular": "2.3.0"