Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6616] Android: Ti.Media.openPhotoGallery Crash while using allowMultiple option

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2020-10-16T08:45:23.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterMuhammad Ahmed Fahad
AssigneeAbir Mukherjee
Created2020-10-16T03:05:01.000+0000
Updated2020-10-16T08:45:23.000+0000

Description

* Ti.Media.openPhotoGallery* on Android crashes while using the *allowMultiple* option. Used to work properly before. Environment: Ti SDK: *9.2.1.GA* Phone: Samsung Galaxy Note9 (SM-N9600) Android Version: 10
    Ti.Media.openPhotoGallery({
      allowMultiple: true,
      mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
      success: function(e) {},
      cancel: function () {},
      error: function () {}
    });
Getting the following error after selecting multiple images. Selecting a single image seems to work fine.
[ERROR] TiExceptionHandler: (main) [33125,39842] Failure delivering result ResultInfo{who=null, request=2, result=-1, data=Intent { flg=0x1 clip={image/* U:content://com.android.providers.media.documents/document/image%3A21912 ...} }} to activity {xxx.xxxx/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference
[ERROR] TiExceptionHandler:
[ERROR] TiExceptionHandler:     ti.modules.titanium.media.MediaModule$1.onResult(MediaModule.java:973)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.util.TiActivitySupportHelper$1.onResult(TiActivitySupportHelper.java:60)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.util.TiActivitySupportHelper.onActivityResult(TiActivitySupportHelper.java:117)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.TiBaseActivity.onActivityResult(TiBaseActivity.java:900)
[ERROR] TiExceptionHandler:     android.app.Activity.dispatchActivityResult(Activity.java:8294)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.deliverResults(ActivityThread.java:5335)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.handleSendResult(ActivityThread.java:5383)
[ERROR] TiExceptionHandler:     android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
[ERROR] TiExceptionHandler:     android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
[ERROR] TiExceptionHandler:     android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
[ERROR] TiExceptionHandler:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:2270)
[ERROR] TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:107)
[ERROR] TiExceptionHandler:     android.os.Looper.loop(Looper.java:237)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:8125)
[ERROR] TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiExceptionHandler:     com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
[ERROR] TiExceptionHandler:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

Comments

  1. Muhammad Ahmed Fahad 2020-10-16

    Please fix as soon as possible with 9.2.2 Thanks and Regards
  2. Ewan Harris 2020-10-16

    Closing as a duplicate of TIMOB-28178 which is scheduled for 9.3.0

JSON Source