M working on an Ionic Capacitor project, and I'm facing an issue after the build

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!

1 Like

Can you share your build log?

2024-10-16 07:24:10,989 - #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15)
2024-10-16 07:24:11,463 - app.framework: cordova
2024-10-16 07:24:11,464 - ===========================================================
2024-10-16 07:24:11,464 - Warning! Project repaired. No config.xml file was included.
2024-10-16 07:24:11,464 - You need to add a config.xml file to your project.
2024-10-16 07:24:11,464 - See https://volt.build/docs/set_up/
2024-10-16 07:24:11,464 - ===========================================================
2024-10-16 07:24:11,465 - ============================================================
2024-10-16 07:24:11,465 - Warning! Project repaired. index.html does not add cordova.js
2024-10-16 07:24:11,465 - You need to add cordova.js to your index.html file.
2024-10-16 07:24:11,465 - See https://volt.build/docs/set_up/
2024-10-16 07:24:11,465 - ============================================================
2024-10-16 07:24:11,465 - Verbose logging is off. Change this in voltbuilder.json
2024-10-16 07:24:11,465 - VoltBuilder run started at 2024-10-16 07:24:11.465986
2024-10-16 07:24:11,466 - Plan: Pro
2024-10-16 07:24:11,466 - Preflight Check
2024-10-16 07:24:11,466 - Warning: 'android' found in project, will not be used.
2024-10-16 07:24:11,490 - adding android to xmlns
2024-10-16 07:24:11,491 - id is com.voltbuilder.sample
2024-10-16 07:24:11,491 - ======================================================
2024-10-16 07:24:11,491 - Warning! No Android engine specified. Defaulting to latest engine.
2024-10-16 07:24:11,491 - This may cause problems if your project has not been updated.
2024-10-16 07:24:11,492 - See https://volt.build/docs/android_12/
2024-10-16 07:24:11,492 - ======================================================
2024-10-16 07:24:12,099 - Output: Creating a new cordova project.

2024-10-16 07:24:18,838 - Output: Using cordova-fetch for cordova-android
Adding android project...
Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: com.voltbuilder.sample
	Name: My Project
	Activity: MainActivity
	Android Target SDK: android-34
	Android Compile SDK: 34
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@13.0.0

2024-10-16 07:24:20,274 - Output: 
Cordova Packages:

    cli: 12.0.0
        common: 5.0.0
        create: 5.0.0
        lib: 12.0.1
            common: 5.0.0
            fetch: 4.0.0
            serve: 4.0.1

Project Installed Platforms:

    android: 13.0.0

Project Installed Plugins:


Environment:

    OS: Ubuntu 22.04.4 LTS (linux 6.1.0-23-cloud-amd64) x64
    Node: v20.13.1
    npm: 10.8.0

android Environment:

    android:
Loading local repository...                                                     
[=========                              ] 25% Loading local repository...       
[=========                              ] 25% Fetch remote repository...        
[=======================================] 100% Fetch remote repository...       
Available Android targets:
----------
id: 1 or "android-29"
     Name: Android API 29
     Type: Platform
     API level: 29
     Revision: 5
----------
id: 2 or "android-30"
     Name: Android API 30
     Type: Platform
     API level: 30
     Revision: 3
----------
id: 3 or "android-32"
     Name: Android API 32
     Type: Platform
     API level: 32
     Revision: 1
----------
id: 4 or "android-33"
     Name: Android API 33, extension level 3
     Type: Platform
     API level: 33
     Revision: 3
----------
id: 5 or "android-34"
     Name: Android API 34, extension level 7
     Type: Platform
     API level: 34
     Revision: 3


Project Setting Files:

    config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.voltbuilder.sample" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" version="1.0.0">
  <name>My Project</name>
  <description>
      My Project is an app.
  </description>
  <content src="index.html" />
  <access origin="*" />
</widget>

    package.json:
--- Start of Cordova JSON Snippet ---
{
  "platforms": [
    "android"
  ]
}
--- End of Cordova JSON Snippet ---


2024-10-16 07:24:21,501 - Output: 2024-10-16T07:24:20.371Z cordova-res Paths: (config: '/config.xml') (resources dir: 'resources')
2024-10-16T07:24:20.374Z cordova-res:platform Running android platform with options: {
  'adaptive-icon': {
    icon: { sources: [Array] },
    foreground: { sources: [Array] },
    background: { sources: [Array] }
  },
  icon: {
    sources: [
      '/resources/iconTemplate.png'
    ]
  },
  splash: {
    sources: [
      '/resources/splashTemplate.png'
    ]
  }
}
2024-10-16T07:24:20.374Z cordova-res:platform Building adaptive-icon resources
2024-10-16T07:24:20.374Z cordova-res:platform Building icon resources for android platform
2024-10-16T07:24:20.376Z cordova-res:image Source image for icon: {
  format: 'png',
  size: 29070,
  width: 1024,
  height: 1024,
  space: 'srgb',
  channels: 4,
  depth: 'uchar',
  density: 96,
  isProgressive: false,
  hasProfile: false,
  hasAlpha: true
}
2024-10-16T07:24:20.376Z cordova-res:platform Using '/resources/iconTemplate.png' for icon source image for android
2024-10-16T07:24:20.377Z cordova-res:image Generating 'resources/android/icon/drawable-ldpi-icon.png' (36x36) fit='cover' position='center'
2024-10-16T07:24:20.378Z cordova-res:image Generating 'resources/android/icon/drawable-hdpi-icon.png' (72x72) fit='cover' position='center'
2024-10-16T07:24:20.379Z cordova-res:image Generating 'resources/android/icon/drawable-xhdpi-icon.png' (96x96) fit='cover' position='center'
2024-10-16T07:24:20.379Z cordova-res:image Generating 'resources/android/icon/drawable-mdpi-icon.png' (48x48) fit='cover' position='center'
2024-10-16T07:24:20.379Z cordova-res:image Generating 'resources/android/icon/drawable-xxhdpi-icon.png' (144x144) fit='cover' position='center'
2024-10-16T07:24:20.380Z cordova-res:image Generating 'resources/android/icon/drawable-xxxhdpi-icon.png' (192x192) fit='cover' position='center'
2024-10-16T07:24:20.452Z cordova-res:image Source file missing: resources/android/icon-foreground.png
2024-10-16T07:24:20.452Z cordova-res:image Source file missing: resources/android/icon-foreground.jpg
2024-10-16T07:24:20.452Z cordova-res:image Source file missing: resources/android/icon-foreground.jpeg
2024-10-16T07:24:20.453Z cordova-res:platform Error with adaptive icons: Error
    at new BaseError (/usr/lib/node_modules/cordova-res/dist/error.js:8:22)
    at new ResolveSourceImageError (/usr/lib/node_modules/cordova-res/dist/error.js:45:9)
    at Object.resolveSourceImage (/usr/lib/node_modules/cordova-res/dist/image.js:31:11)
    at async generateAdaptiveIconResourcesPortion (/usr/lib/node_modules/cordova-res/dist/platform.js:190:20)
    at async generateAdaptiveIconResources (/usr/lib/node_modules/cordova-res/dist/platform.js:148:74)
    at async safelyGenerateAdaptiveIconResources (/usr/lib/node_modules/cordova-res/dist/platform.js:128:16)
    at async Object.run (/usr/lib/node_modules/cordova-res/dist/platform.js:24:28)
    at async AsyncFunction.CordovaRes [as run] (/usr/lib/node_modules/cordova-res/dist/index.js:35:36)
    at async AsyncFunction.runCommandLine (/usr/lib/node_modules/cordova-res/dist/index.js:93:28) {
  errors: [],
  code: 'BAD_SOURCES'
}
2024-10-16T07:24:20.453Z cordova-res:platform Building icon resources for android platform
2024-10-16T07:24:20.454Z cordova-res:image Source image for icon: {
  format: 'png',
  size: 29070,
  width: 1024,
  height: 1024,
  space: 'srgb',
  channels: 4,
  depth: 'uchar',
  density: 96,
  isProgressive: false,
  hasProfile: false,
  hasAlpha: true
}
2024-10-16T07:24:20.454Z cordova-res:platform Using '/resources/iconTemplate.png' for icon source image for android
2024-10-16T07:24:20.455Z cordova-res:image Generating 'resources/android/icon/drawable-ldpi-icon.png' (36x36) fit='cover' position='center'
2024-10-16T07:24:20.455Z cordova-res:image Generating 'resources/android/icon/drawable-hdpi-icon.png' (72x72) fit='cover' position='center'
2024-10-16T07:24:20.455Z cordova-res:image Generating 'resources/android/icon/drawable-xhdpi-icon.png' (96x96) fit='cover' position='center'
2024-10-16T07:24:20.455Z cordova-res:image Generating 'resources/android/icon/drawable-mdpi-icon.png' (48x48) fit='cover' position='center'
2024-10-16T07:24:20.456Z cordova-res:image Generating 'resources/android/icon/drawable-xxhdpi-icon.png' (144x144) fit='cover' position='center'
2024-10-16T07:24:20.456Z cordova-res:image Generating 'resources/android/icon/drawable-xxxhdpi-icon.png' (192x192) fit='cover' position='center'
2024-10-16T07:24:20.520Z cordova-res:platform Building splash resources for android platform
2024-10-16T07:24:20.521Z cordova-res:image Source image for splash: {
  format: 'png',
  size: 61972,
  width: 2732,
  height: 2732,
  space: 'srgb',
  channels: 4,
  depth: 'uchar',
  density: 72,
  isProgressive: false,
  hasProfile: false,
  hasAlpha: true
}
2024-10-16T07:24:20.521Z cordova-res:platform Using '/resources/splashTemplate.png' for splash source image for android
2024-10-16T07:24:20.522Z cordova-res:image Generating 'resources/android/splash/drawable-land-ldpi-screen.png' (320x240) fit='cover' position='center'
2024-10-16T07:24:20.522Z cordova-res:image Generating 'resources/android/splash/drawable-land-mdpi-screen.png' (480x320) fit='cover' position='center'
2024-10-16T07:24:20.523Z cordova-res:image Generating 'resources/android/splash/drawable-land-xhdpi-screen.png' (1280x720) fit='cover' position='center'
2024-10-16T07:24:20.523Z cordova-res:image Generating 'resources/android/splash/drawable-land-hdpi-screen.png' (800x480) fit='cover' position='center'
2024-10-16T07:24:20.524Z cordova-res:image Generating 'resources/android/splash/drawable-land-xxhdpi-screen.png' (1600x960) fit='cover' position='center'
2024-10-16T07:24:20.525Z cordova-res:image Generating 'resources/android/splash/drawable-land-xxxhdpi-screen.png' (1920x1280) fit='cover' position='center'
2024-10-16T07:24:20.526Z cordova-res:image Generating 'resources/android/splash/drawable-port-mdpi-screen.png' (320x480) fit='cover' position='center'
2024-10-16T07:24:20.526Z cordova-res:image Generating 'resources/android/splash/drawable-port-hdpi-screen.png' (480x800) fit='cover' position='center'
2024-10-16T07:24:20.527Z cordova-res:image Generating 'resources/android/splash/drawable-port-xhdpi-screen.png' (720x1280) fit='cover' position='center'
2024-10-16T07:24:20.527Z cordova-res:image Generating 'resources/android/splash/drawable-port-xxhdpi-screen.png' (960x1600) fit='cover' position='center'
2024-10-16T07:24:20.527Z cordova-res:image Generating 'resources/android/splash/drawable-port-ldpi-screen.png' (240x320) fit='cover' position='center'
2024-10-16T07:24:20.528Z cordova-res:image Generating 'resources/android/splash/drawable-port-xxxhdpi-screen.png' (1280x1920) fit='cover' position='center'
Generated 18 resources for Android
2024-10-16T07:24:21.482Z cordova-res:cordova:config Orientation preference: undefined
2024-10-16T07:24:21.482Z cordova-res:cordova:config Creating 'platform' node (not found by xpaths: [ "platform[@name='android']" ])
2024-10-16T07:24:21.483Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='ldpi']" ])
2024-10-16T07:24:21.483Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='mdpi']" ])
2024-10-16T07:24:21.483Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='hdpi']" ])
2024-10-16T07:24:21.483Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xhdpi']" ])
2024-10-16T07:24:21.483Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xxhdpi']" ])
2024-10-16T07:24:21.484Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xxxhdpi']" ])
2024-10-16T07:24:21.484Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-ldpi']" ])
2024-10-16T07:24:21.484Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-mdpi']" ])
2024-10-16T07:24:21.484Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-hdpi']" ])
2024-10-16T07:24:21.484Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xhdpi']" ])
2024-10-16T07:24:21.484Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xxhdpi']" ])
2024-10-16T07:24:21.484Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xxxhdpi']" ])
2024-10-16T07:24:21.484Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-ldpi']" ])
2024-10-16T07:24:21.484Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-mdpi']" ])
2024-10-16T07:24:21.484Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-hdpi']" ])
2024-10-16T07:24:21.485Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xhdpi']" ])
2024-10-16T07:24:21.485Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xxhdpi']" ])
2024-10-16T07:24:21.485Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xxxhdpi']" ])
Wrote to config.xml

2024-10-16 07:24:51,052 - Output: The "<splash>" tags were detected and are no longer supported. Please migrate to the "preference" tag "AndroidWindowSplashScreenAnimatedIcon".
Checking Java JDK and Android SDK versions
ANDROID_HOME=/opt/android-sdk (recommended setting)
ANDROID_SDK_ROOT=/opt/android-sdk (DEPRECATED)
Using Android SDK: /opt/android-sdk
Reading build config file: /build.json
Reading the keystore from: /agent/voltbuilder/platforms/assets/debug.p12
Starting a Gradle Daemon, 4 incompatible Daemons could not be reused, use --status for details
> Task :wrapper

BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:generateDebugBuildConfig
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :app:javaPreCompileDebug
> Task :app:generateDebugResValues
> Task :CordovaLib:generateDebugResValues
> Task :CordovaLib:generateDebugResources
> Task :CordovaLib:writeDebugAarMetadata
> Task :CordovaLib:packageDebugResources
> Task :app:checkDebugAarMetadata
> Task :app:mapDebugSourceSetPaths
> Task :app:generateDebugResources
> Task :app:packageDebugResources
> Task :app:createDebugCompatibleScreenManifests
> Task :app:extractDeepLinksDebug
> Task :CordovaLib:extractDeepLinksDebug
> Task :CordovaLib:compileDebugLibraryResources
> Task :app:parseDebugLocalResources
> Task :CordovaLib:javaPreCompileDebug
> Task :app:mergeDebugResources
> Task :CordovaLib:processDebugManifest
> Task :CordovaLib:parseDebugLocalResources
> Task :app:mergeDebugShaders
> Task :app:processDebugMainManifest
> Task :app:processDebugManifest
> Task :app:processDebugManifestForPackage
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:mergeDebugShaders
> Task :CordovaLib:compileDebugShaders NO-SOURCE
> Task :CordovaLib:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:packageDebugAssets
> Task :CordovaLib:generateDebugRFile
> Task :app:mergeDebugAssets
> Task :app:processDebugResources

> Task :CordovaLib:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :CordovaLib:bundleLibCompileToJarDebug
> Task :app:compressDebugAssets
> Task :app:compileDebugJavaWithJavac
> Task :app:processDebugJavaRes NO-SOURCE
> Task :CordovaLib:processDebugJavaRes
> Task :app:desugarDebugFileDependencies
> Task :CordovaLib:bundleLibRuntimeToDirDebug
> Task :app:checkDebugDuplicateClasses
> Task :app:mergeDebugJavaResource
> Task :app:dexBuilderDebug
> Task :app:mergeDebugJniLibFolders
> Task :CordovaLib:mergeDebugJniLibFolders
> Task :CordovaLib:mergeDebugNativeLibs NO-SOURCE
> Task :CordovaLib:copyDebugJniLibsProjectOnly
> Task :app:mergeDebugNativeLibs NO-SOURCE
> Task :app:stripDebugDebugSymbols NO-SOURCE
> Task :app:validateSigningDebug
> Task :app:writeDebugAppMetadata
> Task :app:mergeProjectDexDebug
> Task :app:writeDebugSigningConfigVersions
> Task :app:mergeLibDexDebug
> Task :app:mergeExtDexDebug
> Task :app:packageDebug
> Task :app:createDebugApkListingFileRedirect
> Task :app:assembleDebug
> Task :app:cdvBuildDebug

BUILD SUCCESSFUL in 22s
50 actionable tasks: 50 executed
Built the following apk(s): 
	/platforms/android/app/build/outputs/apk/debug/app-debug.apk

2024-10-16 07:24:51,089 - PERFORMANCE: Elapsed: 39.63
2024-10-16 07:24:51,089 - NAME: My Project
2024-10-16 07:24:51,092 - Uploading android.debug.apk...
2024-10-16 07:24:51,565 - Uploading build.json...
2024-10-16 07:24:51,623 - Uploading voltbuilder.json...
2024-10-16 07:24:51,656 - Uploading voltbuilder.log...

I’ve already removed everything related to Cordova from the project, including package.json and index.HTML files, and ensured that we are using Capacitor throughout. However, when building or running the app, it still detects references to Cordova.

I suspect you are missing one of the following files in your project:

  • capacitor.config.json"
  • capacitor.config.ts
  • capacitor.config.js

Can you verify that file is in your project root?

After trying multiple fixes, I now have this issue. What should I do next?

I’ve been working through several errors and made some progress, but now I’m encountering this specific issue:

android
ionic.config.json
tsconfig.app.json
angular.json
keys
tsconfig.json
capacitor.config.ts
package.json
tsconfig.spec.json
extra-webpack.config.js
resources
voltbuilder.json
GoogleService-Info.plist
src
www
ServerError: Capacitor config compile failed
node_modules/@types/css-font-loading-module/index.d.ts(22,9): error TS2717: Subsequent property declarations must have the same type.  Property 'display' must be of type 'FontDisplay', but here has type 'string'.
node_modules/@types/css-font-loading-module/index.d.ts(42,9): error TS2717: Subsequent property declarations must have the same type.  Property 'display' must be of type 'FontDisplay', but here has type 'string'.

There is a problem in your capacitor.config.ts. The error indicates you should be using a type of FontDisplay but instead you are using a string. I could probably tell you more if you posted it here.

import type { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  appId: 'io.ionic.starter',
  appName: 'stacks-app',
  webDir: 'www'
};

export default config;

Unfortunately the problem isn’t obvious. TypeScript is complaining about the css-font-loading-module. This isn’t a problem with our build service, or even with Capacitor. If you share your project we’re happy to take a look, but I would ask about this in TypeScript forums as well.