在ionic2中cordova run ios
,但是当ionic cordova run ios
投掷低于错误时,打字稿无法识别。
相同的代码适用于Android。
cordova run ios -> showing only splash screen and white page, not launching home page.
我的config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.hp.tisa" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name> ProjectName </name>
<description> ProjectName App </description>
<author email="rkjhaw@hotmail.com" href="http://ionicframework.com/">
Mobility Development Team </author>
<content src="index.html" />
<icon density="mdpi" height="57" platform="android" src="resources/android/icon/logo.png" width="57" />
<splash density="land-ldpi" src="resources\android\splash\splash.png" />
<access origin="*" />
<access origin="*" />
<access origin="https://maps.google.com" />
<access origin="http://*.googleapis.com" />
<access origin="https://*.googleapis.com" />
<access origin="http://google.com" />
<access origin="https://google.com" />
<access origin="http://maps.google.com" />
<access origin="http://*.google.com" />
<access origin="content:///*" />
<allow-navigation href="http://ionic.local/*" />
<allow-navigation href="http://10.77.34.183:8100" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-intent href="*" />
<platform name="android">
<allow-intent href="market:*" />
<preference name="loadUrlTimeoutValue" value="5000" />
<splash density="land-ldpi" src="resources\android\splash\splash.png" />
<splash density="land-ldpi" src="resources\android\splash\drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="resources\android\splash\drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="resources\android\splash\drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="resources\android\splash\drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="resources\android\splash\drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="resources\android\splash\drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="resources\android\splash\drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources\android\splash\drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources\android\splash\drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources\android\splash\drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources\android\splash\drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources\android\splash\drawable-port-xxxhdpi-screen.png" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<hook src="hooks/iosrtc-swift-support.js" type="after_platform_add" />
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
<icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
<icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
<icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
<icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
<icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
<splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
</platform>
<preference name="loadUrlTimeoutValue" value="700000" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="StatusBarStyle" value="default" />
<preference name="SplashScreen" value="screen" />
<preference name="orientation" value="default" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreen" value="false" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="UseLegacySwiftLanguageVersion" value="true" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<engine name="browser" spec="^4.1.0" />
<plugin name="cordova-plugin-console" spec="1.0.5" />
<plugin name="cordova-plugin-device" spec="1.1.4" />
<plugin name="cordova-plugin-email-composer" spec="0.8.3" />
<plugin name="cordova-plugin-geolocation" spec="^2.4.3">
<variable name="GEOLOCATION_USAGE_DESCRIPTION" value=" " />
</plugin>
<plugin name="cordova-plugin-screen-orientation" spec="~2.0.0" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="2.2.1" />
<plugin name="cordova-plugin-whitelist" spec="1.3.1" />
<plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
离子信息 -
<rakeshjha$ ionic info
全球套餐:
@ionic/cli-utils : 1.3.0
Cordova CLI : 7.0.1
Ionic CLI : 3.3.0
本地包裹:
@ionic/app-scripts : https://registry.npmjs.org/@ionic/app-scripts/-/app-scripts-1.2.3.tgz
@ionic/cli-plugin-cordova : 1.3.0
@ionic/cli-plugin-ionic-angular : 1.3.0
Cordova Platforms : android 6.2.1 browser 4.1.0 ios 4.4.0
Ionic Framework : ionic-angular https://registry.npmjs.org/ionic-angular/-/ionic-angular-2.0.0-beta.7.tgz
系统:
Node : v6.10.3
OS : macOS Sierra
Xcode : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.1
ios-sim : 5.0.13
错误
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8446
',' expected.
L8446: partition(
L8447: callback: ListIterator<T, boolean>): LoDashImplicitArrayWrapper<T[]>;
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8449
']' expected.
L8449: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8449
';' expected.
L8449: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8452
',' expected.
L8451: partition<W>(
L8452: whereValue: W): LoDashImplicitArrayWrapper<T[]>;
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8452
'(' expected.
L8451: partition<W>(
L8452: whereValue: W): LoDashImplicitArrayWrapper<T[]>;
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8452
',' expected.
L8451: partition<W>(
L8452: whereValue: W): LoDashImplicitArrayWrapper<T[]>;
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8452
')' expected.
L8451: partition<W>(
L8452: whereValue: W): LoDashImplicitArrayWrapper<T[]>;
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8454
';' expected.
L8454: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8454
Declaration or statement expected.
L8454: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8455
')' expected.
L8454: * @see _.partition
L8456: partition(
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8455
Expression expected.
L8454: * @see _.partition
L8456: partition(
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8456
Expression expected.
L8456: partition(
L8457: path: string,
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8457
'(' expected.
L8456: partition(
L8457: path: string,
L8458: srcValue: any): LoDashImplicitArrayWrapper<T[]>;
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8457
';' expected.
L8456: partition(
L8457: path: string,
L8458: srcValue: any): LoDashImplicitArrayWrapper<T[]>;
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8460
';' expected.
L8460: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8460
';' expected.
L8460: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8460
')' expected.
L8460: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8460
Expression expected.
L8460: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8460
';' expected.
L8460: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8460
';' expected.
L8460: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8460
Declaration or statement expected.
L8460: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8466
',' expected.
L8466: interface LoDashImplicitObjectWrapper<T> {
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8466
'(' expected.
L8466: interface LoDashImplicitObjectWrapper<T> {
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8466
'(' expected.
L8466: interface LoDashImplicitObjectWrapper<T> {
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8466
Expression expected.
L8466: interface LoDashImplicitObjectWrapper<T> {
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8467
Expression expected.
L8466: interface LoDashImplicitObjectWrapper<T> {
L8468: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8468
',' expected.
L8468: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8468
')' expected.
L8468: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8473
';' expected.
L8474: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8473
Expression expected.
L8474: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8474
')' expected.
L8474: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8474
'(' expected.
L8474: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8474
'(' expected.
L8474: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8474
Expression expected.
L8474: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8475
Expression expected.
L8474: * @see _.partition
L8476: partition<TResult>(
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8476
',' expected.
L8476: partition<TResult>(
L8477: callback: DictionaryIterator<TResult, boolean>): LoDashImplicitArrayWrapper<TResult[]>;
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8476
')' expected.
L8476: partition<TResult>(
L8477: callback: DictionaryIterator<TResult, boolean>): LoDashImplicitArrayWrapper<TResult[]>;
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8493
',' expected.
L8493: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8493
']' expected.
L8493: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8493
';' expected.
L8493: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8493
Expression expected.
L8493: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8493
Expression expected.
L8493: * @see _.partition
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8499
',' expected.
L8499: //_.reduce
L8500: interface LoDashStatic {
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8500
';' expected.
L8499: //_.reduce
L8500: interface LoDashStatic {
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8500
'(' expected.
L8499: //_.reduce
L8500: interface LoDashStatic {
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8505
';' expected.
L8504: * consumes the return value of the previous execution. If accumulator is not provided the
L8505: * first element of the collection will be used as the initial accumulator value. The callback
L8506: * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8505
Expression expected.
L8504: * consumes the return value of the previous execution. If accumulator is not provided the
L8505: * first element of the collection will be used as the initial accumulator value. The callback
L8506: * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8506
')' expected.
L8505: * first element of the collection will be used as the initial accumulator value. The callback
L8506: * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
L8507: * @param collection The collection to iterate over.
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8507
Declaration or statement expected.
L8506: * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
L8507: * @param collection The collection to iterate over.
L8508: * @param callback The function called per iteration.
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8507
Declaration or statement expected.
L8506: * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
L8507: * @param collection The collection to iterate over.
L8508: * @param callback The function called per iteration.
[15:14:08] typescript: node_modules/@types/lodash/index.d.ts, line: 8507
'(' expected.
L8506: * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
L8507: * @param collection The collection to iterate over.
L8508: * @param callback The function called per iteration.
=============================================================================
tsconfig.json文件
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"dom",
"es2015"
],
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"target": "es5"
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
package.json
{
"name": "ProjectName",
"author": "rkjhaw@hotmail.com",
"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"
},
"dependencies": {
"@angular/common": "4.0.2",
"@angular/compiler": "4.0.2",
"@angular/compiler-cli": "4.0.2",
"@angular/core": "4.0.2",
"@angular/forms": "4.0.2",
"@angular/http": "4.0.2",
"@angular/platform-browser": "4.0.2",
"@angular/platform-browser-dynamic": "4.0.2",
"@ionic-native/in-app-browser": "3.6.1",
"@ionic-native/status-bar": "3.6.1",
"@angular/platform-server": "2.2.1",
"@angular/router": "^4.1.3",
"@ionic-native/camera": "3.4.4",
"@ionic-native/core": "3.6.1",
"@ionic-native/email-composer": "3.4.4",
"@ionic-native/flashlight": "3.4.4",
"@ionic-native/geolocation": "3.4.4",
"@ionic-native/location-accuracy": "3.4.4",
"@ionic-native/native-geocoder": "3.4.4",
"@ionic-native/splash-screen": "3.11.0",
"@ionic/storage": "2.0.1",
"cordova-browser": "^4.1.0",
"cordova-ios": "^4.4.0",
"cordova-plugin-add-swift-support": "1.6.0",
"cordova-plugin-console": "1.0.5",
"cordova-plugin-device": "1.1.4",
"cordova-plugin-email-composer": "0.8.3",
"cordova-plugin-geolocation": "^2.4.3",
"cordova-plugin-screen-orientation": "~2.0.0",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "2.2.1",
"cordova-plugin-whitelist": "1.3.1",
"cordova-plugin-wkwebview-engine": "git+https://github.com/apache/cordova-plugin-wkwebview-engine.git#1.0.0",
"ionic-angular": "3.1.1",
"ionic-native": "2.4.1",
"ionic-plugin-keyboard": "~2.2.1",
"ionicons": "3.0.0",
"lodash": "4.17.4",
"node-sass": "4.5.1",
"reflect-metadata": "^0.1.10",
"rxjs": "5.1.1",
"sw-toolbox": "3.4.0",
"underscore": "^1.8.3",
"zone.js": "0.8.9"
},
"devDependencies": {
"@ionic/app-scripts": "^1.3.7",
"@ionic/cli-plugin-cordova": "1.3.0",
"@ionic/cli-plugin-ionic-angular": "1.3.0",
"@types/lodash": "4.14.64",
"ionic-gulp-scripts-copy": "^2.0.0",
"node-sass": "4.5.2",
"typescript": "2.3.2"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"cordova-plugin-geolocation",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "TISA:Toner & Ink Scanning App",
"cordova": {
"plugins": {
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-email-composer": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": " "
},
"cordova-plugin-splashscreen": {}
},
"platforms": [
"browser"
]
}
}
我更新的npm是
npm outdated
Package Current Wanted Latest Location
@angular/common 2.2.1 4.0.2 4.1.3 TISA
@angular/compiler 2.2.1 4.0.2 4.1.3 TISA
@angular/compiler-cli 2.2.1 4.0.2 4.1.3 TISA
@angular/core MISSING 4.0.2 4.1.3 TISA
@angular/forms 2.2.1 4.0.2 4.1.3 TISA
@angular/http 2.2.1 4.0.2 4.1.3 TISA
@angular/platform-browser 2.2.1 4.0.2 4.1.3 TISA
@angular/platform-browser-dynamic 2.2.1 4.0.2 4.1.3 TISA
@ionic-native/core 3.4.4 3.6.1 3.11.0 TISA
@ionic-native/in-app-browser MISSING 3.6.1 3.11.0 TISA
@ionic-native/status-bar MISSING 3.6.1 3.11.0 TISA
@ionic/storage 1.1.7 2.0.1 2.0.1 TISA
cordova-plugin-wkwebview-engine 1.0.0 git git TISA
ionic-angular 2.0.0-beta.7 3.1.1 3.3.0 TISA
rxjs 5.0.0-beta.6 5.1.1 5.4.0 TISA
zone.js 0.6.12 0.8.9 0.8.11 TISA
@angular/platform-server 2.2.1 2.2.1 4.1.3 TISA
@ionic-native/camera 3.4.4 3.4.4 3.11.0 TISA
@ionic-native/email-composer 3.4.4 3.4.4 3.11.0 TISA
@ionic-native/flashlight 3.4.4 3.4.4 3.11.0 TISA
@ionic-native/geolocation 3.4.4 3.4.4 3.11.0 TISA
@ionic-native/location-accuracy 3.4.4 3.4.4 3.11.0 TISA
@ionic-native/native-geocoder 3.4.4 3.4.4 3.11.0 TISA
@types/lodash 4.14.64 4.14.64 4.14.65 TISA
cordova-plugin-add-swift-support 1.6.0 1.6.0 1.6.2 TISA
cordova-plugin-console 1.0.5 1.0.5 1.0.7 TISA
cordova-plugin-device 1.1.4 1.1.4 1.1.6 TISA
cordova-plugin-statusbar 2.2.1 2.2.1 2.2.3 TISA
cordova-plugin-whitelist 1.3.1 1.3.1 1.3.2 TISA
ionic-gulp-scripts-copy 2.0.0 2.0.0 2.0.1 TISA
ionic-native 2.4.1 2.4.1 2.9.0 TISA
node-sass 4.5.1 4.5.1 4.5.3 TISA
sw-toolbox 3.4.0 3.4.0 3.6.0 TISA
ionic cordova run ios
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date.
TypeError: Cannot read property 'Private' of undefined