Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5454] Android: openPhotoGallery is not working on SDK 6.3.0.GA

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2018-03-29T15:03:00.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterJoshua A. Ceaser
AssigneeShak Hossain
Created2017-12-14T22:24:28.000+0000
Updated2018-06-01T20:29:29.000+0000

Description

I'm getting the following error when attempting to resize an image picked from the gallery. The image is stored in google drive. Some images work fine, while others do not(this image seems to have been on the drive for a while). If I don't resize and assign it to an ImageView it works just fine. 12-08 10:29:52.843 6193-6193/? W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'char[] java.lang.String.toCharArray()' on a null object reference 12-08 10:29:52.844 6193-6193/? W/System.err: at java.io.File.fixSlashes(File.java:183) 12-08 10:29:52.844 6193-6193/? W/System.err: at java.io.File.(File.java:130) 12-08 10:29:52.844 6193-6193/? W/System.err: at org.appcelerator.titanium.io.TitaniumBlob.getNativeFile(TitaniumBlob.java:138) 12-08 10:29:52.844 6193-6193/? W/System.err: at org.appcelerator.titanium.TiBlob.getNativePath(TiBlob.java:534) 12-08 10:29:52.844 6193-6193/? W/System.err: at org.appcelerator.titanium.TiBlob.getImage(TiBlob.java:586) 12-08 10:29:52.844 6193-6193/? W/System.err: at org.appcelerator.titanium.TiBlob.imageAsResized(TiBlob.java:722) 12-08 10:29:52.844 6193-6193/? W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method) 12-08 10:29:52.844 6193-6193/? W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:57) 12-08 10:29:52.844 6193-6193/? W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:43) 12-08 10:29:52.844 6193-6193/? W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function$1.run(V8Function.java:70) 12-08 10:29:52.844 6193-6193/? W/System.err: at android.os.Handler.handleCallback(Handler.java:739) 12-08 10:29:52.845 6193-6193/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95) 12-08 10:29:52.845 6193-6193/? W/System.err: at android.os.Looper.loop(Looper.java:148) 12-08 10:29:52.845 6193-6193/? W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5417) 12-08 10:29:52.845 6193-6193/? W/System.err: at java.lang.reflect.Method.invoke(Native Method) 12-08 10:29:52.845 6193-6193/? W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 12-08 10:29:52.845 6193-6193/? W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Comments

  1. Sharif AbuDarda 2017-12-15

    Hello, It will be helpful to identify the issue if you provide us a sample code that reproduces the issue. Alos, A list of stapes to follow for successful regeneration. I have tested basic photo gallery code and it is working. Thanks.
  2. Hans Knöchel 2017-12-15

    [~jquick] This sounds related to a discussion we had a few weeks back. Maybe Android 7?
  3. Joshua Quick 2017-12-18

    The PR for [TIMOB-24707] will fix this issue. (I saw this same issue and fixed it.) It's currently scheduled for Titanium 7.1.0.
  4. Joshua A. Ceaser 2017-12-20

    TIMOB-24707 pertains to video files, is the fix universal for images?
  5. Joshua Quick 2017-12-20

    [~jceaser], Yes, [TIMOB-24707] fixes this issue for both photos and videos. It required a slight refactoring of the code and this issue ended up getting fixed along the way. :)
  6. Rene Pot 2018-03-29

    Closing this ticket as a duplicate, as another ticket (TIMOB-24707) will fix it. I'd recommend watching that ticket if you want to keep track
  7. Michael Gangolf 2018-05-31

    Testing the 7.3.0.v20180530072516 where TIMOB-24707 is already merged I still have this problem described here: When opening the photo gallery I can't select all images without crashing the app. Especially selecting images from other apps (e.g. images out of the WhatsApp folder) it most of the times ends up in a crash. Normally all my images are local, so I can't really tell why the crashes are happening but selecting "newer" images works most of the time. HTC A9, Android 7, Ti SDK 7.3.0.v20180530072516 Permissions are granted, I can select many images but not all
  8. Joshua Quick 2018-06-01

    [~michael], would you mind posting a stacktrace please? I suspect they're cloud based photos without direct file access. I switched most of the code over to use content providers (ie: to not assume direct file access), but perhaps you've found a hole somewhere. (I've kept some of the old direct file access behavior for things proven to work during testing and to maintain some level of backward compatibility, but if it's flawed then we'll have no choice but to get rid of it.)
  9. Michael Gangolf 2018-06-01

    Still trying to get a proper log, but it looks like its only: {noformat} DocumentsActivity: Failed to restore stack for package: com.miga.testgallery because of error: java.io.FileNotFoundException: Failed to find matching root for null InputEventReceiver: Looper::removeFd(364) is failed, result(0), input channel 'a9e48dc Starting com.miga.testgallery (client)' WindowManager: Failed looking up window WindowManager: java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W@8c8594f does not exist WindowManager: at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9321) WindowManager: at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9312) WindowManager: at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2334) WindowManager: at com.android.server.wm.Session.remove(Session.java:193) WindowManager: at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:3437) WindowManager: at android.view.ViewRootImpl.doDie(ViewRootImpl.java:6117) WindowManager: at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3795) WindowManager: at android.os.Handler.dispatchMessage(Handler.java:102) WindowManager: at android.os.Looper.loop(Looper.java:173) WindowManager: at android.os.HandlerThread.run(HandlerThread.java:61) WindowManager: at com.android.server.ServiceThread.run(ServiceThread.java:46) {noformat}
  10. Michael Gangolf 2018-06-01

    Second try with <application android:debuggable="true"/> This is the whole part before the log from the posting above: {noformat} I/TiApplication(11284): (main) [0,0] checkpoint, app created. I/TiApplication(11284): (main) [108,108] Titanium 7.3.0 (2018/05/30 07:25 undefined) I/MultiDex(11284): VM with version 2.1.0 has multidex support I/MultiDex(11284): Installing application I/MultiDex(11284): VM has multidex support, MultiDex support library is disabled. E/TiApplication(11284): (main) [2424,2532] No valid root or current activity found for application instance E/TiApplication(11284): (main) [6,2538] No valid root or current activity found for application instance E/TiApplication(11284): (main) [66,2604] No valid root or current activity found for application instance E/TiApplication(11284): (main) [24,2628] No valid root or current activity found for application instance E/TiApplication(11284): (main) [8,2636] No valid root or current activity found for application instance E/TiApplication(11284): (main) [2,2638] No valid root or current activity found for application instance E/TiApplication(11284): (main) [6,2644] No valid root or current activity found for application instance W/TiAndroid(11284): (main) [4,2648] Application instance no longer available. Unable to get current activity. E/TiApplication(11284): (main) [1,2649] No valid root or current activity found for application instance W/TiAndroid(11284): (main) [1,2650] Application instance no longer available. Unable to get current activity. W/TiAndroid(11284): (main) [1,2651] Application instance no longer available. Unable to get current activity. E/TiApplication(11284): (main) [3,2654] No valid root or current activity found for application instance E/TiApplication(11284): (main) [9,2663] No valid root or current activity found for application instance E/TiApplication(11284): (main) [3,2666] No valid root or current activity found for application instance E/TiApplication(11284): (main) [3,2669] No valid root or current activity found for application instance I/TiApplication(11284): (main) [7,2676] Titanium Javascript runtime: v8 W/TiBaseActivity(11284): (main) [23,2699] Runtime has been disposed or app has been killed. Finishing. W/art(11284): Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable I/TiRootActivity(11284): (main) [0,0] checkpoint, on root activity create, savedInstanceState: Bundle[{android:viewHierarchyState=Bundle[mParcelledData.dataSize=272], android:fragments=android.app.FragmentManagerState@3a09b45}] I/TiRootActivity(11284): (main) [0,0] checkpoint, on root activity resume. activity = com.miga.testgallery.Test_galleryActivity@9cd47cb D/Window(11284): Checkpoint: postWindowCreated() I/Adreno(11284): QUALCOMM build : 6933d31, I73c5708217 I/Adreno(11284): Build Date : 12/28/16 I/Adreno(11284): OpenGL ES Shader Compiler Version: XE031.09.00.04 I/Adreno(11284): Local Branch : I/Adreno(11284): Remote Branch : quic/LA.BR.1.3.6_rb1.11 I/Adreno(11284): Remote Branch : NONE I/Adreno(11284): Reconstruct Branch : NOTHING {noformat}

JSON Source