Crash for some images
See original GitHub issueDescribe the bug
After upgrading to PickIt 2.0.3
we implemented the method pickiT.isUnknownProvider(uri, Build.VERSION.SDK_INT)
. For some images, the program crash unexpectedly.
Describe the bug
We have this line where it crash:
if(pickiT.isUnknownProvider(uri, Build.VERSION.SDK_INT) || !pickiT.wasLocalFileSelected(uri)) {
result.error("IS_REMOTE_FILE", "The selected file is remote and is not implemented yet", null);
}
And for this file content://com.android.providers.media.documents/document/image%3A66
the program crash.
But NOT for this content://com.android.providers.media.documents/document/image%3A65
Both are local (I can see them without internet connection). And if I disable the pickiT.isUnknownProvider(uri, Build.VERSION.SDK_INT)
it still crashing. Neither downgrading to previous pickit version.
We also upgraded sdk from 30 to 31.
Log
E/AndroidRuntime(29424): FATAL EXCEPTION: AsyncTask #1
E/AndroidRuntime(29424): Process: net.altermundi.elrepoio, PID: 29424
E/AndroidRuntime(29424): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime(29424): at android.os.AsyncTask$4.done(AsyncTask.java:399)
E/AndroidRuntime(29424): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime(29424): at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime(29424): at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime(29424): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
E/AndroidRuntime(29424): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(29424): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(29424): at java.lang.Thread.run(Thread.java:919)
E/AndroidRuntime(29424): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Activity.runOnUiThread(java.lang.Runnable)' on a null object reference
E/AndroidRuntime(29424): at com.hbisoft.pickit.DownloadAsyncTask.doInBackground(DownloadAsyncTask.java:71)
E/AndroidRuntime(29424): at com.hbisoft.pickit.DownloadAsyncTask.doInBackground(DownloadAsyncTask.java:19)
E/AndroidRuntime(29424): at android.os.AsyncTask$3.call(AsyncTask.java:378)
E/AndroidRuntime(29424): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(29424): ... 4 more
I/Process (29424): Sending signal. PID: 29424 SIG: 9
PickiT version
2.0.3
Device information
- Make/model
Redmi 9A MIUI 12.0.9
- SDK version
compileSdkVersion 31
minSdkVersion 16
Issue Analytics
- State:
- Created 2 years ago
- Comments:37 (16 by maintainers)
Top Results From Across the Web
An Ultimate Guide to Fix Photos App Crashing Issue on ...
Part 2: Proven Solutions to Fix the Photos App Crashing Issue on Windows 10/11 · Solution 1: Update the Photos app · Solution...
Read more >Top 10 Solutions to Fix Google Photos Keeps Crashing Issue
So, check the network connection when you find Google Photos continues crashing. 2. Clear Cache and Junk File in Browser. There will be...
Read more >5 Fixes to Google Photos Keeps Crashing on Android/iPhone ...
5 Ways to Fix Crashing on Google Photos · Method 1. Restart your phone or PC · Method 2. Update the application ·...
Read more >Windows 10 Photos App Crashing with File System Error FIX ...
Some Windows 10 users are reporting an error when they open an image with the Photos app, the app crashing and they are...
Read more >Explained: Why this photo crashes some Android phones
Never set this picture as wallpaper, especially for Samsung mobile phone users! It will cause your phone to crash! Don't try it! If...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, thanks. As you said, using
ClipData
fixed the problemYes! Thanks for support! (and for the library, I’m surprised of how difficult is to get an Absolute path on Android devices…)