简体   繁体   中英

Cant complete build in Ionic 2, getting error 'property: does not exist'

I am trying to run ionic cordova build android using Ionic 2 but am getting a number on errors which is stopping the build. Not sure why, but all errors are similar.

Eg the result variable data below is coming from an API call so I don't know why it would be preventing the build to run?

BUILD ERROR

[00:45:45]  typescript: C:/xampp/htdocs/apps/test/src/pages/red/red.ts, line: 72
                Property 'game' does not exist on type '{}'.

          L71:  this.gamesProvider.getCurrentGame(user).then((result) => {
          L72:      this.game = result.game;
          L73:      this.hintsAll = result.we;

[00:45:45]  typescript: typescript: C:/xampp/htdocs/apps/test/src/pages/red/red.ts, line: 133
            Property 'status' does not exist on type 'LivegamePage'.

     L132:    // switch icons
     L133:    this.status = false;

Yeah it's a common behavior when you build your application. It first checks the typings. So go to your file typescript: C:/xampp/htdocs/apps/test/src/pages/red/red.ts And change this as following

this.gamesProvider.getCurrentGame(user).then((result:any) => {
       this.game = result.game;
      this.hintsAll = result.we;
}

As for the other error check that you created a variable status

    status:boolean;
        ...
    this.status = false;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM