Apps-android-commons: App crashes when tapping on an image during multiple share

Created on 21 Jun 2018  路  14Comments  路  Source: commons-app/apps-android-commons

I tried to see if there are duplicates but couldn't find any. Sorry, if I've missed them.

Summary:
The app crashes when tapping on any of the images during a multiple upload before providing a title.

Steps to reproduce:

  1. Open your favourite photo viewer or file manager.
  2. Select multiple images
  3. Click on 'Share'
  4. Choose the 'Commons' app from the share menu that appears
  5. In the Multiple Upload screen tap on one of the images before giving a title to the set of images

Add System logs:

Add logcat files here (if possible).

Expected behavior:
App shouldn't crash but should provide a enlarged view of the image.

Observed behavior:
App crashes.

Device and Android version:
OS: Android 5.1.1
Device: Samsung Galaxy j1 ace

Commons app version:
2.7.2 (beta line)

Would you like to work on the issue?
Nope.

bug good first issue

Most helpful comment

Gallery > select multiple images > Share > Commons . Yeah, it's a bit odd to only be able to do multiple uploads through that method, but we plan to streamline the multiple uploads over the next month or so.

All 14 comments

I can pick this up.

Please feel free @albendz . :)

I am having trouble with this repro. I don't see an option to upload multiple images, just one at a time. Can you send me a link to the documentation for the feature you are using or be more explicit with your repro? @sivaraam

Gallery > select multiple images > Share > Commons . Yeah, it's a bit odd to only be able to do multiple uploads through that method, but we plan to streamline the multiple uploads over the next month or so.

Thanks @misaochan for the details.

@albendz I've updated the description to be a little more descriptive.

Got it! Thanks for adding the new info.

@misaochan The app crashes when I select a single image from gallery (this happens when the use has not given storage permissions) and then share it through "Commons" app. But when I select multiple images and try to share it then the app opens and doesnt crashes.

Exception I see when it crashes:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: fr.free.nrw.commons.debug, PID: 22139
java.lang.NullPointerException: key == null
at android.support.v4.util.LruCache.get(LruCache.java:80)
at fr.free.nrw.commons.MediaWikiImageView.setMedia(MediaWikiImageView.java:54)
at fr.free.nrw.commons.media.MediaDetailFragment.displayMediaDetails(MediaDetailFragment.java:232)
at fr.free.nrw.commons.media.MediaDetailFragment.onResume(MediaDetailFragment.java:226)
at android.support.v4.app.Fragment.performResume(Fragment.java:2390)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1474)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1759)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1827)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2596)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2383)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338)
at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:2215)
at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:649)
at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:167)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1238)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1086)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1616)
at android.view.View.measure(View.java:21051)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6459)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
at android.view.View.measure(View.java:21051)
[...]

@VaishSiddharth That seems to be a separate issue. Could you create a new one?

@sivaraam i have created a new one #1694

Sorry @albendz , we are rushing for an (already late) release. :( We should be able to get to your PR this week after that is done.

I understand, just wanted to make sure it didn't get lost. Good luck with the release! (also, let me know if I can help)

Fixed in #1696

Was this page helpful?
0 / 5 - 0 ratings