Below is my package.json file:
{
"name": "stacks-app",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"clean": "ng clean",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular-builders/custom-webpack": "^17.0.1",
"@angular-devkit/build-angular": "^17.3.2",
"@angular-eslint/builder": "~17.3.0",
"@angular-eslint/eslint-plugin": "~17.3.0",
"@angular-eslint/eslint-plugin-template": "~17.3.0",
"@angular-eslint/template-parser": "~17.3.0",
"@angular/animations": "^17.3.2",
"@angular/cdk": "^17.3.2",
"@angular/cli": "^17.3.2",
"@angular/common": "^17.3.2",
"@angular/compiler": "^17.3.2",
"@angular/compiler-cli": "^17.3.2",
"@angular/core": "^17.3.2",
"@angular/fire": "^17.0.1",
"@angular/flex-layout": "^15.0.0-beta.42",
"@angular/forms": "^17.3.2",
"@angular/language-service": "^17.3.2",
"@angular/material": "^17.3.2",
"@angular/platform-browser": "^17.3.2",
"@angular/platform-browser-dynamic": "^17.3.2",
"@angular/router": "^17.3.2",
"@auth0/angular-jwt": "^5.2.0",
"@auth0/auth0-angular": "^2.2.3",
"@capacitor/android": "6.1.2",
"@capacitor/app": "^6.0.1",
"@capacitor/assets": "^3.0.5",
"@capacitor/browser": "^6.0.2",
"@capacitor/core": "^6.1.2",
"@capacitor/device": "^6.0.1",
"@capacitor/filesystem": "^6.0.1",
"@capacitor/haptics": "^6.0.1",
"@capacitor/keyboard": "6.0.2",
"@capacitor/network": "^6.0.2",
"@capacitor/splash-screen": "^6.0.2",
"@capacitor/status-bar": "^6.0.1",
"@ionic/angular": "^8.3.2",
"@ionic/angular-toolkit": "^11.0.1",
"@ionic/core": "^8.3.2",
"@ionic/storage-angular": "^4.0.0",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"firebase": "^10.10.0",
"firebaseui": "^6.1.0",
"firebaseui-angular": "^6.2.1",
"mixpanel-browser": "^2.49.0",
"ng-http-caching": "^17.0.1",
"rxjs": "~7.8.1",
"rxjs-compat": "^6.6.7",
"swiper": "^11.1.1",
"tslib": "^2.6.2",
"zone.js": "^0.14.4"
},
"devDependencies": {
"@angular-eslint/builder": "~17.3.0",
"@angular-eslint/eslint-plugin": "~17.3.0",
"@angular-eslint/eslint-plugin-template": "~17.3.0",
"@angular-eslint/template-parser": "~17.3.0",
"@capacitor/cli": "^6.1.2",
"@types/jasmine": "~5.1.4",
"@types/jasminewd2": "~2.0.13",
"@types/node": "^20.11.30",
"@typescript-eslint/eslint-plugin": "7.4.0",
"@typescript-eslint/parser": "7.4.0",
"autoprefixer": "^10.4.19",
"css-loader": "^6.10.0",
"eslint": "^8.57.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "48.2.2",
"eslint-plugin-prefer-arrow": "1.2.3",
"jasmine-core": "~5.1.2",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.3",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.1",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"postcss": "^8.4.38",
"postcss-loader": "^8.1.1",
"protractor": "~7.0.0",
"sass": "^1.72.0",
"sass-loader": "^14.1.1",
"style-loader": "^3.3.4",
"ts-node": "~10.9.2",
"typescript": "~5.4.3",
"webpack": "^5.91.0"
},
"description": "An Ionic project"
}
After building the app, I use this code:
this.platform.ready().then((res) => {
const platform = Capacitor.getPlatform();
console.log('platform', res);
console.log('platform:', platform);
});
However, I see cordova
and web
being logged instead of capacitor
and android
. I’m using Capacitor and targeting Android. Could you advise what might be going wrong or how I can fix this?
Thank you!