question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Turning off storage permissions while downloading will cause the app to crash

See original GitHub issue

Summary: Turning off storage permissions while downloading will cause the app to crash

Steps to reproduce:

  1. Install and open commons
  2. Skip the tutorial
  3. Click any picture in the “explore”
  4. Click the download icon in the upper right corner
  5. Give commons storage permissions
  6. Turn off the storage permissions of commons in the system settings
  7. Back to commons
  8. Crash

System logs:

08-22 14:06:40.791 10424 10424 E AndroidRuntime: FATAL EXCEPTION: main
08-22 14:06:40.791 10424 10424 E AndroidRuntime: Process: fr.free.nrw.commons, PID: 10424
08-22 14:06:40.791 10424 10424 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity {fr.free.nrw.commons/fr.free.nrw.commons.explore.categories.ExploreActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String fr.free.nrw.commons.Media.getThumbUrl()' on a null object reference
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3863)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3895)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1839)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:201)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6861)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
08-22 14:06:40.791 10424 10424 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String fr.free.nrw.commons.Media.getThumbUrl()' on a null object reference
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at fr.free.nrw.commons.media.MediaDetailFragment.setupImageView(MediaDetailFragment.java:261)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at fr.free.nrw.commons.media.MediaDetailFragment.displayMediaDetails(MediaDetailFragment.java:242)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at fr.free.nrw.commons.media.MediaDetailFragment.onResume(MediaDetailFragment.java:237)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.Fragment.performResume(Fragment.java:2499)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:926)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1229)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1295)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2605)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentManagerImpl.dispatchResume(FragmentManagerImpl.java:2577)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.Fragment.performResume(Fragment.java:2505)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:926)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1229)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1295)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2605)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentManagerImpl.dispatchResume(FragmentManagerImpl.java:2577)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:267)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:463)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:453)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:173)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.app.Activity.performResume(Activity.java:7438)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3855)
08-22 14:06:40.791 10424 10424 E AndroidRuntime:        ... 11 more

Device and Android version:

Device1: [MI CC 9e] OS version1: [MIUI 10.2.10] Device2: [PIXEL XL] OS version2: [Android 10.0]

Commons app version: App version: [2.12.3]

Screen-shots:

ezgif com-video-to-gif (11)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:28 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
marcosliberalcommented, Apr 12, 2021

Hi @Ayan-10 @sivaraam,

I have a change request in my PR and I was planning to take a look at it soon.

I believe it solves this and other similar issues in the app as I described in previous comments, so maybe it would be good to give it a try 😄

2reactions
sivaraamcommented, Mar 1, 2021

@marcosliberal Looks like you’ve done significant work on this issue. Feel free to open a PR, we’ll take a look. And yeah, next time make sure to ask before you start working 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do my apps keep crashing on Android, How to fix it
Simply uninstall the app and download it from the Play Store again. ... Newer versions of Android allow you to deny permissions requested...
Read more >
How to Fix Crashing Apps on a Samsung Galaxy Phone
Just go to Settings > Apps and select the crashing app. On the app info page, tap Permissions and allow all the permissions...
Read more >
Why Do My Apps Keep Crashing on Android? - Avast
Apps close automatically on Android when they don't have enough space to perform their tasks. Low storage space can cause Android phones to ......
Read more >
How to Stop Apps From Crashing on Android - AVG
If your apps keep closing on Android it could be because you don't have enough storage space for everything your apps need to...
Read more >
11 Quick Ways to Fix Apps Keep Crashing on Android - iMobie
Go to Settings > “Apps” or “Application manager” > Choose the app that crashes > Tap the “Uninstall” option to make it. Then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found