Hello Hello,
I try for the first time to run my ionic app on android but it crash…
It failed with error:
ngc: Error: Can’t resolve all parameters for HomePage: (?, ?, ?, ?, ?, ?, ?).
With ionic serve everything is working… Do you maybe have an idea?
here is my home.ts:
@Component({
selector: 'page-home',
template: `
<ion-content>
</ion-content>
`
})
export class HomePage {
authService : AuthService;
nav : NavController;
zone : NgZone;
userCredentialService : CredentialService;
usercreds : Object;
myProfileService : MyProfileService;
friendsProfileService : FriendsProfileService;
navParams : NavParams;
retrieveFriendsFromServer : boolean;
static get parameters() {
return [[AuthService],[NavController], [CredentialService], [NgZone], [MyProfileService], [NavParams], [FriendsProfileService]];
}
constructor(authservice, navcontroller, userCredential, zone, myProfileService, navParams, friendsProfileService) {
this.authService = authservice;
this.nav = navcontroller;
this.userCredentialService = userCredential;
this.zone = zone;
this.navParams = navParams;
this.myProfileService = myProfileService;
this.friendsProfileService = friendsProfileService;
this.usercreds = {
email: '',
password: ''
}
}
my tsconfig
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"dom",
"es2015"
],
"module": "es2015",
"moduleResolution": "node",
"target": "es5"
},
"exclude": [
"node_modules"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
my package.json
{
"name": "ionic-hello-world",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"build": "ionic-app-scripts build",
"watch": "ionic-app-scripts watch",
"serve:before": "watch",
"emulate:before": "build",
"deploy:before": "build",
"build:before": "build",
"run:before": "build"
},
"dependencies": {
"@ionic/storage": "^1.0.3",
"es6-shim": "^0.35.1",
"ionic-angular": "^2.0.0-rc.0",
"ionic-native": "^2.0.3",
"ionicons": "^3.0.0",
"pouchdb": "^6.0.6"
},
"devDependencies": {
"@ionic/app-scripts": "latest",
"typescript": "^2.0.3"
},
"description": "handyou: An Ionic project",
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"config": {
"ionic_rollup": "./script/rollup.config.js"
}
}
my config.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.handyou378891" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>handyou</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html"/>
<access origin="*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<allow-intent href="market:*"/>
</platform>
<platform name="ios">
<allow-intent href="itms:*"/>
<allow-intent href="itms-apps:*"/>
</platform>
<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="SplashScreenDelay" value="0"/>
<preference name="FadeSplashScreen" value="false"/>
<preference name="FadeSplashScreenDuration" value="0"/>
<preference name="SplashScreenBackgroundColor" value="0xFFFFFFFF"/>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature>
<plugin name="cordova-plugin-device" spec="~1.1.3"/>
<plugin name="cordova-plugin-console" spec="~1.0.4"/>
<plugin name="cordova-plugin-whitelist" spec="~1.3.0"/>
<plugin name="cordova-plugin-splashscreen" spec="~4.0.0"/>
<plugin name="cordova-plugin-statusbar" spec="~2.2.0"/>
<plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
</widget>
And finally my app.module.ts
@NgModule({
declarations: [
MyApp,
HomePage,
CredentSignup,
ProfileSignup,
Main,
FriendsTab,
MenuTab,
MyTab,
NotificationTab,
Profile,
Connection,
Search
],
imports: [
IonicModule.forRoot(MyApp, {
tabsHideOnSubPages : 'true'
})
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,
CredentSignup,
ProfileSignup,
Main,
FriendsTab,
MenuTab,
MyTab,
NotificationTab,
Profile,
Connection,
Search,
],
providers: [AuthService, MyProfileServiceDB, HeaderBuilder, UserCredentialServiceDB, MyProfileService, CredentialService, FriendsProfileServiceDB, FriendsProfileService]
})
export class AppModule {}
Does anyone has an idea?
What I really don’t understand is that it is working on serve mode.
Thanks a lot!!!