A button not appearing when generation the apk file of an ionic app


I’m working on an ionic application and I want to show a ‘skip button’ in the nav bar of a page when the user comes from the sign up page , here is the portion of code i used for that :

 <ion-navbar >
    <ion-title> <p >Profile</p></ion-title>
    <ion-buttons right>
      <button *ngIf="show()" (click)="gotohome()" ion-button > SKIP

and here is the ‘show()’ function

show() : boolean {

    if(this.navCtrl.getPrevious().name == 'Signup4Page') {
      return true;
    else {

      return false;

When building the app, the button shows normally , but when generating the apk file, it doesn’t work.
I couldn’t figure out where the problem is. Is there something i’m missing ?

Thanks for your help.