2016-11-09 8 views
0

私は自分のアプリをエクスポートしようとしています。私はionic run androidを実行していますが失敗しました。エラーIonic run android failed

C:\Users\adirz\myapps\sceSchedule>ionic run android 

Running 'run:before' npm script before run 
> [email protected] build C:\Users\adirz\myapps\sceSchedule 
> ionic-app-scripts build 
[02:17:30] ionic-app-scripts 0.0.41 
[02:17:30] build prod started ... 
[02:17:30] clean started ... 
[02:17:30] clean finished in 5 ms 
[02:17:30] copy started ... 
[02:17:30] ngc started ... 
[02:17:31] copy finished in 196 ms 
[02:17:31] lint started ... 
[02:17:32] tslint: C:/Users/adirz/myapps/sceSchedule/src/pages/courses-page/courses-page.ts, line: 5 

      Unused import: 'course' 
     L4: import {CoursesData} from "../../providers/courses-data"; 
     L5: import {course} from "../../models/Course"; 
[02:17:32] tslint: C:/Users/adirz/myapps/sceSchedule/src/pages/tabs/tabs.ts, line: 3 

      Unused import: 'HomePage' 
     L3: import { HomePage } from '../home/home'; 
     L4: import { AboutPage } from '../about/about'; 
[02:17:32] lint finished in 1.50 s 
[02:17:43] Error: Error at C:/Users/adirz/myapps/sceSchedule/.tmp/pages/courses-page/courses-page.ngfactory.ts:736:29 

[02:17:43] Supplied parameters do not match any signature of call target. 
[02:17:43] Error at C:/Users/adirz/myapps/sceSchedule/.tmp/pages/courses-page/courses-page.ngfactory.ts:761:29 
[02:17:43] Supplied parameters do not match any signature of call target. 

[02:17:43] ngc failed 

[02:17:43] ionic-app-script task: "build" 

[02:17:43] Error: Error 

が、これは

import { Component } from '@angular/core'; 
import {NavController, LoadingController,AlertController} from 'ionic-angular'; 

import {CoursesData} from "../../providers/courses-data"; 
import {course} from "../../models/Course"; 

/* 
    Generated class for the CoursesPage page. 

    See http://ionicframework.com/docs/v2/components/#navigation for more info on 
    Ionic pages and navigation. 
*/ 
@Component({ 
    selector: 'page-courses-page', 
    templateUrl: 'courses-page.html' 
}) 
export class CoursesPage { 
    public semester: string = 'SemA'; 
// public coursesA: Array<any> = []; 
    public coursesB: Array<any> = []; 
    public coursesC:Array<any>=[]; 
    public department:any; 
    public courseSelect: string = ''; 
    public lectureSelect:string= ''; 
    public coursesNames:Array<any>=[]; 
    public LecturesNames:Array<any>=[]; 
    public LectureCourses:Array<any>=[]; 
    public loader = this.loadingCtrl.create({ 
    content: "Please wait...", 
    spinner: 'crescent' 

    }); 
    public data=null; 
    public coursesA:Array<any>=[]; 
    public coursesAD:Array<any>=[]; 
    public coursesChose:Array<any>=[]; 

    constructor(public navCtrl: NavController,private loadingCtrl: LoadingController,public coursesData:CoursesData,public alertCtrl: AlertController) { 

    } 


    ionViewWillEnter() { 
    this.loader.present(); 
     this.onSemChange(); 
    } 
    public getCourses(semester:any){ 
     this.courseSelect=''; 
     this.coursesNames=[]; 
     this.LecturesNames=[]; 
     this.coursesA=[]; 
     console.log(semester); 
    this.coursesData.LoadData(semester) 
     .subscribe(courseList=> { 
      courseList.forEach(course=>{ 
      var newCourse={ 
       id_course:course.id_course , 
       key_course:course.key_course, 
       course_name:course.course_name , 
       course_type:course.course_type , 
       start:course.start , 
       end:course.end , 
       point_course:course.point_course , 
       day:course.Day, 
       class:course.class, 
       lecture_name:course.lecture_name 
      } 
      this.coursesA.push(newCourse); 
      this.coursesNames.push(course.course_name); 
      this.LecturesNames.push(course.lecture_name); 
      }); 
      //this.courseSelect=this.coursesNames[0]; 
      this.coursesAD=this.coursesA; 
      this.coursesNames = this.coursesNames.filter(function(elem, index, self) { 
        return index == self.indexOf(elem); 
       }) 
       console.log(this.coursesA); 


       this.loader.dismiss(); 
       console.log(this.coursesNames); 
     // return this.coursesA; 

     },err=>{ 
      console.log(err); 
     }); 
    } 



    public onCourseChange(){ 
    console.log(this.courseSelect); 
    this.coursesA=this.coursesAD; 
    //getCourses(); 
    this.coursesChose=[]; 
    this.LecturesNames=[]; 
    for (let course of this.coursesA) { 
     if (course.course_name==this.courseSelect){ 
     this.coursesChose.push(course); 
     this.LecturesNames.push(course.lecture_name); 
     console.log(this.LecturesNames); 
     }  
    } 
    this.coursesA = this.coursesChose; 
    this.LecturesNames = this.LecturesNames.filter(function(elem, index, self) { 
        return index == self.indexOf(elem); 
       }) 
    console.log(this.LecturesNames); 
    console.log(this.coursesChose); 
    } 

    public onLectureChange(){ 
     this.coursesA=this.coursesAD; 
    //getCourses(); 
    this.LectureCourses=[]; 
    for (let course of this.coursesA) { 
     if (course.lecture_name==this.lectureSelect){ 
     this.LectureCourses.push(course); 
     } 
     this.coursesA = this.LectureCourses; 
    } 
    } 
    public addDep(){} 
    public onSemChange(){ 
    let semester=JSON.stringify({'semester':this.semester}); 
    console.log(semester); 
    this.getCourses(semester); 

    } 
} 

私のコース-page.tsあります

私はそれは私が問題を持っているが、まだ言うtmpフォルダを削除。 iは、プログラムを閉じて、もう一度再起動しようとしましたが、まだ私は同じ問題を持っている

TMPフォルダ

import { Component } from '@angular/core'; 
import {NavController, LoadingController,AlertController} from 'ionic-angular'; 

import {CoursesData} from "../../providers/courses-data"; 
import {course} from "../../models/Course"; 

/* 
    Generated class for the CoursesPage page. 

    See http://ionicframework.com/docs/v2/components/#navigation for more info on 
    Ionic pages and navigation. 
*/ 
@Component({ 
    selector: 'page-courses-page', 
    templateUrl: 'courses-page.html' 
}) 
export class CoursesPage { 
    public semester: string = 'SemA'; 
// public coursesA: Array<any> = []; 
    public coursesB: Array<any> = []; 
    public coursesC:Array<any>=[]; 
    public department:any; 
    public courseSelect: string = ''; 
    public lectureSelect:string= ''; 
    public coursesNames:Array<any>=[]; 
    public LecturesNames:Array<any>=[]; 
    public LectureCourses:Array<any>=[]; 
    public loader = this.loadingCtrl.create({ 
    content: "Please wait...", 
    spinner: 'crescent' 

    }); 
    public coursesA:Array<any>=[]; 
    public coursesAD:Array<any>=[]; 
    public coursesChose:Array<any>=[]; 

    constructor(public navCtrl: NavController,private loadingCtrl: LoadingController,public coursesData:CoursesData,public alertCtrl: AlertController) { 

    } 


    ionViewWillEnter() { 
    this.loader.present(); 
     this.onSemChange(); 
    } 
    public getCourses(semester:any){ 
     this.courseSelect=''; 
     this.coursesNames=[]; 
     this.LecturesNames=[]; 
     this.coursesA=[]; 
     console.log(semester); 
    this.coursesData.LoadData(semester) 
     .subscribe(courseList=> { 
      courseList.forEach(course=>{ 
      var newCourse={ 
       id_course:course.id_course , 
       key_course:course.key_course, 
       course_name:course.course_name , 
       course_type:course.course_type , 
       start:course.start , 
       end:course.end , 
       point_course:course.point_course , 
       day:course.Day, 
       class:course.class, 
       lecture_name:course.lecture_name 
      } 
      this.coursesA.push(newCourse); 
      this.coursesNames.push(course.course_name); 
      this.LecturesNames.push(course.lecture_name); 
      }); 
      //this.courseSelect=this.coursesNames[0]; 
      this.coursesAD=this.coursesA; 
      this.coursesNames = this.coursesNames.filter(function(elem, index, self) { 
        return index == self.indexOf(elem); 
       }) 
       console.log(this.coursesA); 


       this.loader.dismiss(); 
       console.log(this.coursesNames); 
     // return this.coursesA; 

     },err=>{ 
      console.log(err); 
     }); 
    } 



    public onCourseChange(){ 
    console.log(this.courseSelect); 
    this.coursesA=this.coursesAD; 
    //getCourses(); 
    this.coursesChose=[]; 
    this.LecturesNames=[]; 
    for (let course of this.coursesA) { 
     if (course.course_name==this.courseSelect){ 
     this.coursesChose.push(course); 
     this.LecturesNames.push(course.lecture_name); 
     console.log(this.LecturesNames); 
     }  
    } 
    this.coursesA = this.coursesChose; 
    this.LecturesNames = this.LecturesNames.filter(function(elem, index, self) { 
        return index == self.indexOf(elem); 
       }) 
    console.log(this.LecturesNames); 
    console.log(this.coursesChose); 
    } 

    public onLectureChange(){ 
     this.coursesA=this.coursesAD; 
    //getCourses(); 
    this.LectureCourses=[]; 
    for (let course of this.coursesA) { 
     if (course.lecture_name==this.lectureSelect){ 
     this.LectureCourses.push(course); 
     } 
     this.coursesA = this.LectureCourses; 
    } 
    } 
    public addDep(){} 
    public onSemChange(){ 
    let semester=JSON.stringify({'semester':this.semester}); 
    console.log(semester); 
    this.getCourses(semester); 

    } 
} 

ライン761:私は持っている私は本当に持っていない29が、ライン29

line public loader = this.loadingCtrl.create({ 
    content: "Please wait...", 
    spinner: 'crescent' 

    }); 
+0

"build": "ionic-app-scripts build"

を交換してくださいあなたは '/.tmp/pages/courses-page/courses-page.ngfactory.ts:736から関連する行を投稿することができます:29'? –

+0

私は736を持っていないが、私は自分の投稿を追加し、あなたは何を入れているのかを見ることができる。 –

+0

736:29は、エラーが行736、文字29にあることを意味する。 courses-page.ngfactory.ts。このファイルは、角度2コンパイラによって作成され、エラーがあるようです。そのファイルから関連する行を表示することができれば助けになります。 –

答えて

2

一時的な解決策として、あなたはあなたのpackage.jsonファイルを編集することができますし、ビルドステップへ--devフラグを追加します。これにより、AoTコンパイラが無効になり、アプリケーションの作業を続行できます。

"build": "ionic-app-scripts build --dev"

+0

ありがとう!できます!!!!!しかしそれは最善の方法ですか?あなたはそれが一時的な解決だと言った。 –

+0

はい、これは一時的な解決策に過ぎません。あなたのアプリケーションを構築するとき、角度2コンパイラはあなたのコードを最適化し、より速く実行します。コンパイラは、例えば 'ionic serve 'を使用しているときに表示されない追加のエラーを見つけることがあります。したがって、そのエラーの原因を見つけるまで、--devフラグを使用するだけです。 –

+0

ありがとう、あなたは私の問題を解決!!!!! –

1

addDepが見つからないため、コースページaddDepを追加してみてください。

[20:33:25] Property 'addDep' does not exist on type 'CoursesPage'. 
    [20:33:25] Error at C:/Users/adirz/myapps/sceSchedule/.tmp/pages/courses-page/courses-page.ngfactory.ts:889:42 
    [20:33:25] Property 'addDep' does not exist on type 'CoursesPage'. 
+0

ありがとう、それは私のせいです。 –

+0

私の投稿をもう一度チェックできますか?それはまた失敗しました –

関連する問題