我已经更新了离子项目和所有依赖项,现在当我尝试构建--prod android apk时,出现以下错误:
Uncaught Error: Cannot find module "."
at vendor.js:1
at vendor.js:1
at Object.<anonymous> (vendor.js:1)
at e (vendor.js:1)
at Object.<anonymous> (main.js:1)
at e (vendor.js:1)
at window.webpackJsonp (vendor.js:1)
at main.js:1
vendor.js:1 Ionic Native: deviceready event fired after 57 ms
assets/icon/favicon.ico:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
我已经搜索和搜索了很多东西,问题似乎出在打字稿版本(> 3) 但是所有帖子都非常老(2018),唯一的解决方案是将Typescript降级到2.6版 但这对我来说不是解决方案,因为我必须为Firebase使用angular> = 7。
是否有适当的解决方案,如何使它正常工作?
离子信息:
Ionic:
Ionic CLI : 5.4.9 (C:\Users\Kumaro\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.5
@ionic/app-scripts : 3.2.2
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 1.1.1, (and 15 other plugins)
Utility:
cordova-res : not installed
native-run : 0.3.0
System:
Android SDK Tools : 26.1.1 (C:\Program Files\AndroidSDK)
NodeJS : v12.13.0 (C:\Program Files\nodejs\node.exe)
npm : 6.12.0
OS : Windows 7
Package.js:
{
"name": "Name",
"version": "1.0.0",
"author": "Name",
"homepage": "www.blabla.de",
"private": true,
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint"
},
"dependencies": {
"@angular/animations": "^7.2.15",
"@angular/common": "^7.2.15",
"@angular/compiler": "^7.2.15",
"@angular/compiler-cli": "^7.2.15",
"@angular/core": "^7.2.15",
"@angular/forms": "^7.2.15",
"@angular/http": "^7.2.15",
"@angular/platform-browser": "^7.2.15",
"@angular/platform-browser-dynamic": "^7.2.15",
"@ionic-native/app-rate": "^5.17.1",
"@ionic-native/app-version": "^5.17.1",
"@ionic-native/background-mode": "^5.17.1",
"@ionic-native/core": "^5.1.0",
"@ionic-native/device": "^5.17.1",
"@ionic-native/dialogs": "^5.17.1",
"@ionic-native/in-app-browser": "^5.17.1",
"@ionic-native/ionic-webview": "^5.17.1",
"@ionic-native/keyboard": "^5.17.1",
"@ionic-native/market": "^5.17.1",
"@ionic-native/native-storage": "^5.17.1",
"@ionic-native/screen-orientation": "^5.17.1",
"@ionic-native/social-sharing": "^5.17.1",
"@ionic-native/splash-screen": "^5.17.1",
"@ionic-native/sqlite": "^5.17.1",
"@ionic-native/status-bar": "^5.17.1",
"@ionic/storage": "2.2.0",
"chart.js": "^2.9.3",
"chartjs-plugin-datalabels": "^0.7.0",
"cordova": "^9.0.0",
"cordova-android": "^7.1.4",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-apprate": "^1.5.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-inappbrowser": "^3.1.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-market": "^1.2.0",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-screen-orientation": "^3.0.2",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-x-socialsharing": "^5.6.2",
"cordova-sqlite-storage": "^4.0.0",
"ionic-angular": "3.9.5",
"ionicons": "3.0.0",
"rxjs": "^6.5.3",
"rxjs-compat": "^6.5.3",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.29"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.2",
"@ionic/lab": "^2.0.16",
"cordova-plugin-background-mode": "^0.7.3",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-firebase": "^2.0.5",
"typescript": "^3.1.1"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-inappbrowser": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-nativestorage": {},
"cordova-sqlite-storage": {},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-apprate": {},
"cordova-plugin-market": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-app-version": {},
"cordova-plugin-background-mode": {},
"cordova-plugin-dialogs": {},
"cordova-plugin-firebase": {},
"cordova-plugin-whitelist": {}
},
"platforms": [
"android"
]
}
我希望任何人都可以帮助:(
答案 0 :(得分:0)
首先,您需要在问题上设置正确的标签。现在我做到了。即Ionic 3
您的更新有误。 Ionic 3不支持Angular 7
和RxJS 6 +
您需要按照此官方应用程序将其更新为正确的版本。
官方Ionic 3应用:https://github.com/ionic-team/ionic-conference-app/blob/v3/package.json#L16
OR 从Ionic 3.0迁移到Ionic 4.0: https://ionicframework.com/docs/building/migration