Ionic build generates error: An unhandled exception occurred: Project “app” does not exist

Solution for Ionic build generates error: An unhandled exception occurred: Project “app” does not exist
is Given Below:

I have an angular project, and I am trying to add ionic and capacitor. I can ng serve and ng build with no problems. When I run ionic build or ionic serve, I get the error:An unhandled exception occurred: Project "app" does not exist. It looks like ionic thinks my project’s name is ‘app’ but I don’t know why.

ionic.config.json

{
  "name": "EntityBible",
  "integrations": {},
  "type": "angular"
}

angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "EntityBible": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:application": {
          "strict": true
        }
      },
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "www",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/favicon.png",
              "src/favicon.svg",
              {
                "glob": "**/*.svg",
                "input": "node_modules/ionicons/dist/ionicons/svg",
                "output": "./svg"
              }
            ],
            "styles": [
              "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
              "src/styles.css",
              {
                "input": "node_modules/@ionic/angular/css/core.css"
              },
              {
                "input": "node_modules/@ionic/angular/css/normalize.css"
              },
              {
                "input": "node_modules/@ionic/angular/css/structure.css"
              },
              {
                "input": "node_modules/@ionic/angular/css/typography.css"
              },
              {
                "input": "node_modules/@ionic/angular/css/display.css"
              },
              {
                "input": "node_modules/@ionic/angular/css/padding.css"
              },
              {
                "input": "node_modules/@ionic/angular/css/float-elements.css"
              },
              {
                "input": "node_modules/@ionic/angular/css/text-alignment.css"
              },
              {
                "input": "node_modules/@ionic/angular/css/text-transformation.css"
              },
              {
                "input": "node_modules/@ionic/angular/css/flex-utils.css"
              },
              {
                "input": "src/theme/variables.css"
              }
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "45mb",
                  "maximumError": "50mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "2kb",
                  "maximumError": "4kb"
                }
              ],
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "outputHashing": "all"
            },
            "development": {
              "buildOptimizer": false,
              "optimization": false,
              "vendorChunk": true,
              "extractLicenses": false,
              "sourceMap": true,
              "namedChunks": true
            }
          },
          "defaultConfiguration": "production"
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "configurations": {
            "production": {
              "browserTarget": "EntityBible:build:production"
            },
            "development": {
              "browserTarget": "EntityBible:build:development"
            }
          },
          "defaultConfiguration": "development"
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "EntityBible:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/favicon.ipngco",
              "src/favicon.svg",
              {
                "glob": "**/*.svg",
                "input": "node_modules/ionicons/dist/ionicons/svg",
                "output": "./svg"
              }
            ],
            "styles": [
              "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
              "src/styles.css"
            ],
            "scripts": []
          }
        },
        "deploy": {
          "builder": "@angular/fire:deploy",
          "options": {}
        },
        "ionic-cordova-serve": {
          "builder": "@ionic/angular-toolkit:cordova-serve",
          "options": {
            "cordovaBuildTarget": "EntityBible:ionic-cordova-build",
            "devServerTarget": "EntityBible:serve"
          },
          "configurations": {
            "production": {
              "cordovaBuildTarget": "EntityBible:ionic-cordova-build:production",
              "devServerTarget": "EntityBible:serve:production"
            }
          }
        },
        "ionic-cordova-build": {
          "builder": "@ionic/angular-toolkit:cordova-build",
          "options": {
            "browserTarget": "EntityBible:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "EntityBible:build:production"
            }
          }
        }
      }
    }
  },
  "defaultProject": "EntityBible"
}
  ionic:lib CLI global options: { _: [ 'build' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +4ms
  ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
  ionic:lib:project Project details: { context: 'app', type: 'angular', errors: [], configPath: 'C:\Users\ethan\Desktop\Entity-Bible\ionic.config.json' } +1ms
  ionic Context: { binPath: 'C:\Users\ethan\AppData\Roaming\npm\node_modules\@ionic\cli\bin\ionic', libPath: 'C:\Users\ethan\AppData\Roaming\npm\node_modules\@ionic\cli', execPath: 'C:\Users\ethan\Desktop\Entity-Bible', version: '6.16.3' } +0ms
  ionic:lib:build build options: {
  ionic:lib:build   '--': [],
  ionic:lib:build   engine: 'browser',
  ionic:lib:build   platform: undefined,
  ionic:lib:build   project: 'app',
  ionic:lib:build   verbose: true,
  ionic:lib:build   configuration: undefined,
  ionic:lib:build   sourcemaps: undefined,
  ionic:lib:build   cordovaAssets: true,
  ionic:lib:build   watch: undefined,
  ionic:lib:build   type: 'angular'
  ionic:lib:build } +0ms
  ionic:lib:telemetry Sending telemetry for command: 'ionic build' [ '--verbose', '--interactive', '--color' ] +0ms
  ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
  ionic:lib:build Looking for ionic:build npm script. +14ms
> ng.cmd run app:build --verbose
  ng:analytics getGlobalAnalytics +0ms
  ng:analytics Client Analytics config found: false +4ms
  ng:analytics Analytics disabled. Ignoring all analytics. +1ms
  ng:analytics getSharedAnalytics +1ms
An unhandled exception occurred: Project "app" does not exist.
See "C:UsersethanAppDataLocalTempng-PUGa7Iangular-errors.log" for further details.
[ERROR] An error occurred while running subprocess ng.

        ng.cmd run app:build --verbose exited with exit code 127.

        Re-running this command with the --verbose flag may provide more information.
  ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
  ionic:utils-process onBeforeExit handler: running 1 functions +2ms
  ionic:utils-process error while killing process tree for 8412: Error: Command failed: taskkill /pid 8412 /T /F
  ionic:utils-process ERROR: The process "8412" not found.
  ionic:utils-process 
  ionic:utils-process     at ChildProcess.exithandler (child_process.js:390:12)
  ionic:utils-process     at ChildProcess.emit (events.js:400:28)
  ionic:utils-process     at maybeClose (internal/child_process.js:1055:16)
  ionic:utils-process     at Socket.<anonymous> (internal/child_process.js:441:11)
  ionic:utils-process     at Socket.emit (events.js:400:28)
  ionic:utils-process     at Pipe.<anonymous> (net.js:675:12) {
  ionic:utils-process   killed: false,
  ionic:utils-process   code: 128,
  ionic:utils-process   signal: null,
  ionic:utils-process   cmd: 'taskkill /pid 8412 /T /F'
  ionic:utils-process } +119ms
  ionic:utils-process onBeforeExit handler: error from function: Error: Command failed: taskkill /pid 8412 /T /F
  ionic:utils-process ERROR: The process "8412" not found.
  ionic:utils-process 
  ionic:utils-process     at ChildProcess.exithandler (child_process.js:390:12)
  ionic:utils-process     at ChildProcess.emit (events.js:400:28)
  ionic:utils-process     at maybeClose (internal/child_process.js:1055:16)
  ionic:utils-process     at Socket.<anonymous> (internal/child_process.js:441:11)
  ionic:utils-process     at Socket.emit (events.js:400:28)
  ionic:utils-process     at Pipe.<anonymous> (net.js:675:12) {
  ionic:utils-process   killed: false,
  ionic:utils-process   code: 128,
  ionic:utils-process   signal: null,
  ionic:utils-process   cmd: 'taskkill /pid 8412 /T /F'
  ionic:utils-process } +3ms
  ionic:utils-process processExit: exiting (exit code: 127) +2ms