Last Updated
Viewed 04 Times
  

Unable to create iOS build. Facing below mentioned error while creating iOS build.

Script file does't exist and will be skipped: 
..../scripts/hooks/fix_hockeyapp_android_write_external_storage_max_sdk_version_issue.js

Error: Cannot read property 'toLowerCase' of undefined

I'm using the following code in my first Ionic project:

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { PapersProvider } from '../../providers/papers/papers';

/**
 * Generated class for the LoadPaperPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-load-paper',
  templateUrl: 'load-paper.html',
})
export class LoadPaperPage {

  public paper = {};
    public questions = {};

  constructor(public navCtrl: NavController, public navParams: NavParams, public papersData:PapersProvider) {
    // let paperid = navParams.data.paper;
    this.paper      = this.navParams.get('paper');
    this.questions  = this.navParams.get('questions');
    this.questions  = this.questions.questions;
  }

  ionViewDidLoad() {
  }
}

The code works fine when testing my load-paper page. However, when I have to re-serve the project and it's starting from the beginning (splash screen etc), I get the following error:

Typescript Error Property 'questions' does not exist on type '{}' src/pages/load-paper/load-paper.ts

this.questions  = this.navParams.get('questions');
this.questions  = this.questions.questions;

The data I'm assigning to this.questions doesn't exist at the point when the splash screen is loading so I understand that it fails as a result but I've tried testing:

if(this.questions.questions !== 'undefined')

and:

if(this.questions.questions)

unsuccessfully.

I am just stuck.
I wanted to Download MP3 file to my app.
I am able to download the same in browser while working on it,
As we know, there we need to provide WRITE_EXTERNAL_STORAGE permission. To do so what I did is as below-

  1. Opened platforms/android/AndroidManifest.xml
  2. added

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    But its not working for me. Let me share my Machine Setup-

    cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0
    

    global packages:

    cordova (Cordova CLI) : 7.0.1 
    

    local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.6.0
    

    I try for this https://ionicframework.com/docs/native/android-permissions/

Also try https://github.com/dpa99c/cordova-custom-config-example/blob/master/config.xml

There is a way for cordova and another way to provide permissions How do I add "uses-permissions" tags to AndroidManifest.xml for a Cordova project? I am unable to write it.

Help me plz...

I have call the API for get the data and but I got error Property sellerDto does not exist on type Object in ionic3 and I will try to declare the data as declared object but again same error occur how to fix this error?

/*
  @Copyright Notice:
  @(#)
  @Type: TS	
  @For:  create-accont.html.
  @Description : userLoggedInSuccess for create the user account 1st in the GCP 
 */
 public userData       : any = {};
userLoggedInSuccess(userObject) {
    //Enable the loader after call the FB function
    var self = this;
    //Declare the local variable
    self.url                  = "";
    self.API_HOST             = "";
    self.paramData                 = "";
    let userTypeKeyId = userObject.uid;

    let url = self.API_HOST + "/api/login/dto";
    let paramData  = "userTypeKeyId=" + userTypeKeyId;

    let headers =  {
      headers: new  HttpHeaders({ 'Content-Type': 'application/x-www-form-urlencoded'})
    };

    //Pass the data into the API for check email is exist in the API or not
    self.http.post(url, paramData, headers).subscribe(data => {
      this.userData = data;
      if(this.userData.isLoggedIn) {
          //Here we will set the user Detail into the local-storage
          if(this.userData.userType == "seller" && this.userData.sellerDto == undefined){
            self.localStorage.set("defaultLanguage",    data.sellerDto.userTypeDto.defaultLanguage);
          }
        } else {
          console.log("user is no valid");
        }
  });
}

Similar Question 7 (1 solutions) : How can I importing external JS file in Ionic 3

cc