DmcSDK / cordova-plugin-mediaPicker

cordova android ios mediaPicker support selection of multiple image and video gif ✨ cordova android 和 ios 图片视频选择cordova插件,支持多图 视频 gif,ui类似微信
MIT License
138 stars 92 forks source link

App Crashes in iOS - UIViewController issue #104

Closed Mr-Anonymous closed 2 years ago

Mr-Anonymous commented 4 years ago

I have been getting a few crash reports for the past few weeks, all from iOS, and I have been searching and searching and I don't know which plugin might be the cause for this error. Can you tell if it is possible for MediaPicker Plugin to cause this issue? Or could the issue be related to some other plugin and not this one?

A lot of the users who have reported this issue says that the App abruptly crashes and closes soon after the launch screen when the page loads. No Android users or my web app users have this issue. For some it works fine in iPhone but crashes in iPads.

The Xcode did not give anything useful other than the following errors:

NO_CRASH_STACK + 0

and

UIKitCore: -[UIViewController _presentViewController:withAnimationController:completion:] + 4864

I symbolicated the crash and from App Centre I view these: Screenshot 2020-01-28 at 11 13 54 AM Screenshot 2020-01-28 at 11 14 08 AM

Screenshot 2020-01-28 at 10 56 09 AM

Screenshot 2020-01-28 at 11 13 16 AM

Could MediaPicker Plugin cause these crashes? Any ideas on where I may need to look?

These are the plugins and the environment I have:

code-push 3.0.1 "CodePushAcquisition"
cordova-plugin-android-permissions 1.0.2 "Permissions"
cordova-plugin-appcenter-analytics 0.5.1 "App Center Analytics for Cordova"
cordova-plugin-appcenter-crashes 0.5.1 "App Center Crashes for Cordova"
cordova-plugin-appcenter-shared 0.5.1 "App Center shared code for Cordova"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-code-push 1.12.0 "CodePush"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-file-opener2 2.2.1 "File Opener2"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-headercolor 1.0 "HeaderColor"
cordova-plugin-ignore-lint-translation 0.0.1 "cordova-plugin-ignore-lint-translation"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 2.5.3 "cordova-plugin-ionic-webview"
cordova-plugin-ios-camera-permissions 1.2.0 "iOS Permissions"
cordova-plugin-mediapicker-dmcsdk 2.4.7 "MediaPicker"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.4-dev "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
ionic-plugin-deeplinks 1.0.15 "Ionic Deeplink Plugin"
onesignal-cordova-plugin 2.7.0 "OneSignal Push Notifications"

Ionic Info:

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

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    Cordova Platforms : android 7.0.0 ios 5.0.1
    Ionic Framework   : ionic1 1.3.3

System:

    ios-deploy : 1.9.2 
    ios-sim    : 8.0.2 
    Node       : v11.12.0
    npm        : 5.7.1 
    OS         : macOS
    Xcode      : Xcode 11.3.1 Build version 11C504 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro
Mr-Anonymous commented 4 years ago

Sorry to bump this. Any update on this please? I need to release my next mobile app update and hoping if someone can shed some light on this issue. Thanking you.

Mr-Anonymous commented 4 years ago

I got another 7 more crash reports today and users are complaining the app keeps crashing. The crash log says:

SIGABRT: Application tried to present modally an active controller <UIViewController: 0x104c1e010>.

I understand the author of his plugin is from China, I really do hope he is safe and well.

Does anyone else have any idea on what may cause this please? My users are getting a bit annoyed and I don't know how to fix this crashing.

Mr-Anonymous commented 4 years ago

could it be due to this:

[self presentViewController:alert animated:YES completion:nil];

in line #171 in:

node_modules/cordova-plugin-mediapicker-dmcsdk/src/ios/DMCMediaPicker/DmcPickerViewController.m

I've spent hours and days on this. no idea what is causing these crashes.

Mr-Anonymous commented 4 years ago

@DmcSDK Can you shed some light on this please? I have received numerous complains from our users using iPads complaining of the issue where the app crashes as soon as it is launched. I started having these issues only after:

  1. Updating Mediapicker plugin from 2.4.6 to 2.4.7.

  2. After building app using Xcode 11.2.1 onwards.

DmcSDK commented 4 years ago

@Mr-Anonymous sorry,I've been very busy lately and can't improve

Mr-Anonymous commented 4 years ago

Thank you for replying @DmcSDK Can you just tell me 1 thing if you can please? could this error be related to this plugin or should I be looking elsewhere such as the webview plugin? It appears perhaps a conflict with the plugins is causing this error but not sure which one is it:

SIGABRT: Application tried to present modally an active controller <UIViewController: 0x10550a9b0>.

Screenshot 2020-02-21 at 9 54 08 PM Screenshot 2020-02-21 at 9 53 53 PM

Mr-Anonymous commented 4 years ago

Can this addition in version 2.4.7 cause this crash issue?

if (@available(iOS 13.0, *)) {
        dmc.modalInPresentation = true;
    }

https://github.com/DmcSDK/cordova-plugin-mediaPicker/commit/ae542426dd8ffeb1c633a3d9d2abdfe5c253d5bd#diff-b6864d7a2fd6a1ac61b1148f96850f58

Screenshot 2020-02-23 at 1 16 01 AM

Mr-Anonymous commented 4 years ago

@DmcSDK An update on this issue. Since I was unable to find out the cause for these crashes in some devices, I did the following changes and it seems to work for the users whose app was crashing before:

  1. Instead of using the current version of this plugin, I downloaded the 2.4.6 version up until this commit https://github.com/DmcSDK/cordova-plugin-mediaPicker/commit/9bf7809c404b0b22e1c6001fa64a4cacec9c41e8 and rebuilt my iOS App.

  2. I also manually added the ios13 text color fix to this plugin since the above commit did not include this: https://github.com/DmcSDK/cordova-plugin-mediaPicker/commit/98d10a139a92c6c9c98d4fa5d1e3fa4fcaba3c1f

  3. I released my App with 2.4.6 version of this plugin and requested my users to see if they are able to launch the App. Couple of them emailed back today confirming that now they are able to open the app properly without crashing.

So this confirms that the reason for so many crashes was perhaps due to one of the edits that was done after this commit https://github.com/DmcSDK/cordova-plugin-mediaPicker/commit/9bf7809c404b0b22e1c6001fa64a4cacec9c41e8

I suspect if one of these commits were causing the crashes:

  1. https://github.com/DmcSDK/cordova-plugin-mediaPicker/commit/e89a6215128e3c5479b990a79880c097c77bbc2e

  2. https://github.com/DmcSDK/cordova-plugin-mediaPicker/commit/ae542426dd8ffeb1c633a3d9d2abdfe5c253d5bd

I hope this helps you in finding that was causing these errors and crashes for my users when my app is launched and it has 2.4.7 version of this plugin:

SIGABRT: Application tried to present modally an active controller <UIViewController: 0x10550a9b0>

Hope you will get time to look into fixing these issues since an app crashing during launch is quite big.

Mr-Anonymous commented 4 years ago

Looks like this issue is still there even after installing 2.4.6 version of this plugin. Some iOS apps are still crashing.

Screenshot 2020-03-16 at 8 26 54 PM Screenshot 2020-03-16 at 8 27 08 PM Screenshot 2020-03-16 at 8 28 24 PM Screenshot 2020-03-16 at 8 28 32 PM