【发布时间】:2019-02-20 07:10:23
【问题描述】:
我正在对我的 ionic 应用程序进行一些更改,它突然决定挂在启动屏幕上并且根本不加载应用程序。我在我使用的模拟器上附加了一个调试器,这是生成的错误消息:
Unhandled Promise rejection: Cannot read property 'getServerBasePath' of undefined ; Zone: <root> ; Task: Promise.then ; Value:
polyfills.js:3
TypeError: Cannot read property 'getServerBasePath' of undefined
polyfills.js:3
TypeError: Cannot read property 'getServerBasePath' of undefined
at IonicDeployImpl.<anonymous> (file:///android_asset/www/plugins/cordova-plugin-ionic/dist/common.js:575:46)
at step (file:///android_asset/www/plugins/cordova-plugin-ionic/dist/common.js:37:23)
at Object.next (file:///android_asset/www/plugins/cordova-plugin-ionic/dist/common.js:18:53)
at file:///android_asset/www/plugins/cordova-plugin-ionic/dist/common.js:12:71
at new t (file:///android_asset/www/build/polyfills.js:3:21506)
at __awaiter (file:///android_asset/www/plugins/cordova-plugin-ionic/dist/common.js:8:12)
at file:///android_asset/www/plugins/cordova-plugin-ionic/dist/common.js:572:87
at new t (file:///android_asset/www/build/polyfills.js:3:21506)
at IonicDeployImpl.<anonymous> (file:///android_asset/www/plugins/cordova-plugin-ionic/dist/common.js:572:39)
at step (file:///android_asset/www/plugins/cordova-plugin-ionic/dist/common.js:37:23)
好像 ionic live deploy 不知何故失败了,但我不知道为什么 - 我的 package.json 列在下面。
我在官方 ionic 问题跟踪论坛上发现了一些看起来相似的问题,但在大多数情况下,我使用的 cordova-plugin-ionic 版本比发生这些问题的版本大:
这个问题 (Issue 116) 看起来是最接近我遇到的问题,但我认为还是不一样。
任何帮助将不胜感激,因为我觉得我已经用尽了我能想到的一切来解决这个问题。
Package.json
{
"name": "ionic-hello-world",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"config": {
"ionic_bundler": "webpack",
"ionic_source_map": "source-map",
"ionic_copy": "./config/copy.config.js"
},
"dependencies": {
"@angular/animations": "5.0.3",
"@angular/common": "5.0.3",
"@angular/compiler": "5.0.3",
"@angular/compiler-cli": "5.0.3",
"@angular/core": "5.0.3",
"@angular/forms": "5.0.3",
"@angular/http": "5.0.3",
"@angular/platform-browser": "5.0.3",
"@angular/platform-browser-dynamic": "5.0.3",
"@auth0/angular-jwt": "^1.2.0",
"@ionic-native/admob-free": "^4.8.0",
"@ionic-native/base64": "^4.8.0",
"@ionic-native/camera": "^4.8.0",
"@ionic-native/core": "^4.8.0",
"@ionic-native/crop": "^4.8.0",
"@ionic-native/diagnostic": "^4.8.0",
"@ionic-native/splash-screen": "^4.8.0",
"@ionic-native/status-bar": "^4.8.0",
"@ionic/storage": "2.1.3",
"angular-calendar": "0.24.1",
"angular-jwt": "0.1.9",
"com-badrit-base64": "^0.2.0",
"cordova-admob-sdk": "^0.17.0",
"cordova-android": "~6.3.0",
"cordova-ios": "^4.3.1",
"cordova-plugin-admob-free": "^0.17.2",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-crop": "^0.4.0",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-ionic": "^5.2.4",
"cordova-plugin-ionic-webview": "^2.1.4",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-promise-polyfill": "0.0.2",
"cordova.plugins.diagnostic": "^4.0.8",
"cropperjs": "^1.4.0",
"exif-js": "^2.3.0",
"font-awesome": "^4.7.0",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"jimp": "^0.2.27",
"moment": "^2.18.1",
"rxjs": "^5.5.2",
"sw-toolbox": "3.6.0",
"ts-exif-parser": "^0.1.23",
"web-photo-filter": "^1.1.1",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "^3.1.7",
"@ionic/pro": "^2.0.3",
"@types/node": "^10.3.6",
"typescript": "~2.4.2"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-statusbar",
"cordova-plugin-console",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "SafteyTicketApp: An Ionic project",
"cordova": {
"platforms": [
"ios",
"android"
],
"plugins": {
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-crop": {},
"ionic-plugin-keyboard": {},
"cordova.plugins.diagnostic": {},
"cordova-plugin-admob-free": {},
"com-badrit-base64": {},
"cordova-plugin-camera": {
"CAMERA_USAGE_DESCRIPTION": "To track and record safety tickets.",
"PHOTOLIBRARY_USAGE_DESCRIPTION": "To track and record safety tickets."
},
"cordova-plugin-ionic": {
"APP_ID": "APPID",
"CHANNEL_NAME": "Production",
"UPDATE_METHOD": "auto",
"UPDATE_API": "https://api.ionicjs.com",
"MAX_STORE": "2",
"MIN_BACKGROUND_DURATION": "30"
}
}
}
}
【问题讨论】:
标签: cordova ionic-framework ionic3