Telerik-Verified-Plugins / ImagePicker

Cordova Plugin For Multiple Image Selection
MIT License
182 stars 331 forks source link

App crashed on IOS 12.3.1 #160

Closed JerryBels closed 5 years ago

JerryBels commented 5 years ago

Hi,

submitting my app to the appstore, I had the surprise to get a rejection from Apple because of the app crashing when they (quoting them):

So that would be linked to my code :

    if(this.platform.is("cordova")) {
      this.imagePicker.hasReadPermission().then(
        (result) => {
          if (!result) {
            this.imagePicker.requestReadPermission().then(canRead => {
              if(canRead) {
                this.GetPicture();
              }
            });
          } else {
            this.GetPicture();
          }
        }, (err) => {
          this.imagePicker.requestReadPermission().then(canRead => {
            if(canRead) {
              this.GetPicture();
            }
          });
          console.log(err);
        });
    }
  }

  GetPicture() {
    this.imagePicker.getPictures({
      maximumImagesCount: 1
    }).then(
      (results) => {
        for (let i = 0; i < results.length; i++) {
          // upload image to image service
        }
      }, (err) => console.log(err)
    );
  }

pretty vanilla stuff overall. So it would seem that when calling imagePicker.getPicture on latest IOS the app crashes.

Running Ionic 4.1.1, ImagePicker plugin version 2.3.3.

They also gave a few crash reports, attaching one of them if it can help.

attachment-6092491254159192914crashlog-E31E8DCE-AC53-4475-AD8D-476CA7E80FA3.txt

JerryBels commented 5 years ago

Symbolicated the crash log by doing

xcrun atos -o MyApp.app/Myapp -arch arm64 -l 0x104457fff -f attachment-6092491254159192914crashlog-E31E8DCE-AC53-4475-AD8D-476CA7E80FA3.crash 

Not sure how the symbolicated report is said to help me...

symbolicated.txt

JerryBels commented 5 years ago

A symbolicatecrash tool helped me getting this :

Crash found at: -[CDVInAppBrowser openInInAppBrowser:withOptions:] (in myApp) (CDVInAppBrowser.m:163)

Can it help? It looks like a inAppBrowser thing, but what's between this imagePicker plugin and the inAppBrowser and how to change the behavior?

JerryBels commented 5 years ago

Found out what it was - an issue with inAppBrowser plugin when calling getPictures. Updating inAppBrowser to the latest version fixed the issue :)