首页 > 解决方案 > 找不到“模块”的 NgModule 元数据中的错误

问题描述

使用“ionic cordova build android”从 Ionic4 构建 Android 应用程序时

包.json

{
  "name": "campusrides_v2.0",
  "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": {
    "@angular/common": "^7.2.15",
    "@angular/core": "^7.2.15",
    "@angular/fire": "^5.2.1",
    "@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/core": "^5.8.0",
    "@ionic-native/device": "^5.8.0",
    "@ionic-native/fcm": "^5.8.0",
    "@ionic-native/geolocation": "^5.8.0",
    "@ionic-native/launch-navigator": "^5.15.1",
    "@ionic-native/splash-screen": "^5.8.0",
    "@ionic-native/status-bar": "^5.8.0",
    "@ionic/angular": "^4.5.0",
    "@ionic/storage": "^2.2.0",
    "angularfire2": "^5.2.1",
    "cordova-android": "^8.1.0",
    "cordova-plugin-actionsheet": "^2.3.3",
    "cordova-plugin-dialogs": "^2.0.2",
    "cordova-plugin-fcm-with-dependecy-updated": "^2.4.0",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-sqlite-storage": "^3.2.0",
    "core-js": "^2.5.4",
    "firebase": "^6.2.0",
    "firebase-tools": "^7.0.0",
    "firebaseui": "^4.0.0",
    "firebaseui-angular": "^3.4.2",
    "rxjs": "~6.5.1",
    "sharp": "^0.22.1",
    "tslib": "^1.10.0",
    "uk.co.workingedge.phonegap.plugin.launchnavigator": "^5.0.4",
    "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.8",
    "@angular/compiler": "~7.2.2",
    "@angular/compiler-cli": "~7.2.2",
    "@angular/language-service": "~7.2.2",
    "@ionic/angular-toolkit": "~1.5.1",
    "@ionic/lab": "2.0.4",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.0.8",
    "codelyzer": "~4.5.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^4.1.0",
    "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.1.0",
    "tslint": "~5.17.0",
    "typescript": "~3.1.6",
    "xcode": "^2.0.0"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-geolocation": {},
      "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-plugin-fcm-with-dependecy-updated": {},
      "cordova-sqlite-storage": {},
      "uk.co.workingedge.phonegap.plugin.launchnavigator": {
        "GOOGLE_API_KEY_FOR_ANDROID": "[-------------------------]",
        "OKHTTP_VERSION": "3.12.0",
        "LOCATION_USAGE_DESCRIPTION": "This app requires access to your location for navigation purposes"
      }
    },
    "platforms": []
  }
}

执行“离子服务”时,它在浏览器控制台中出现以下错误

拒绝加载图像“ http://localhost:8100/favicon.ico ”,因为它违反了以下内容安全策略指令:“default-src 'none'”。请注意,'img-src' 没有显式设置,因此 'default-src' 用作后备。

谢谢你的时间!

标签: androidcordovaionic-frameworkionic4

解决方案


推荐阅读