Apps-android-commons: App crashes on trying to upload a media from gallery.

Created on 15 Feb 2021  路  13Comments  路  Source: commons-app/apps-android-commons

Summary:
On selecting an item from the gallery for upload the app crashes unexpectedly.

Steps to reproduce:
Try selecting a media from the gallery for upload from the floating action button.

What did you expect the app to do, and what did you see instead?
The app should not crash.

System logs:

2021-02-16 02:25:03.775 20600-20600/fr.free.nrw.commons.beta E/ACRA: ACRA caught a NullPointerException for fr.free.nrw.commons.beta
    java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
        at fr.free.nrw.commons.filepicker.UploadableFile.getDateTimeFromExif(UploadableFile.java:127)
        at fr.free.nrw.commons.filepicker.UploadableFile.getFileCreatedDate(UploadableFile.java:83)
        at fr.free.nrw.commons.upload.UploadModel.createAndAddUploadItem(UploadModel.java:95)
        at fr.free.nrw.commons.upload.UploadModel.preProcessImage(UploadModel.java:84)
        at fr.free.nrw.commons.repository.UploadRepository.preProcessImage(UploadRepository.java:184)
        at fr.free.nrw.commons.upload.mediaDetails.UploadMediaPresenter.receiveImage(UploadMediaPresenter.java:83)
        at fr.free.nrw.commons.upload.mediaDetails.UploadMediaDetailFragment.init(UploadMediaDetailFragment.java:128)
        at fr.free.nrw.commons.upload.mediaDetails.UploadMediaDetailFragment.onViewCreated(UploadMediaDetailFragment.java:114)

Device and Android version:

Nokia 6.1+ android 10 stock

Commons app version:
betaDebug master

Would you like to work on the issue?
Yes.

bug

Most helpful comment

Hi @jidanni , Thanks for sharing the logs. The app usually does not crashes while performing these basic operations. The issue is related with fetching EXIF information, I will look into this and make sure the fix is rolled out asap.

All 13 comments

Also crashes want attempting to use the app to take a picture. I sent the log, via Gmail.

Also crashes two out of three times, upon simply launching the app.

version 3 0 0 906, 907 which I cannot copy by finger, because the app has crashed.

A simple
https://en.m.wikipedia.org/wiki/Smoke_testing_(software)
would have surely caught this. One hopes such tests are part of the standard operating procedures before an upload to Google Play. Thanks.

Hi @jidanni , Thanks for sharing the logs. The app usually does not crashes while performing these basic operations. The issue is related with fetching EXIF information, I will look into this and make sure the fix is rolled out asap.

Did the problem start happening yesterday? Yesterday I merged this PR which upgrades ExifInterface: https://github.com/commons-app/apps-android-commons/pull/4223/files

@4D17Y4 In your report you wrote Commons app version: betaDebug master. Usually in this field we put the complete version number.

@jidanni Would you mind posting a screenshot of the About screen? I am especially interested in the part after the ~ character.

@jidanni You are using the alpha version if I remember correctly? You did not compile the app's source code by yourself nor installed manually a customized APK, right?

I think I reproduced this. I believe that uploading any image with no EXIF (for instance a screenshot) causes this in latest master.

Did the problem start happening yesterday? Yesterday I merged this PR which upgrades ExifInterface: https://github.com/commons-app/apps-android-commons/pull/4223/files

Yes @nicolas-raoul, this seems to be the issue.
As I revert the files in that commit, uploading works fine.

@nicolas-raoul glad to hear the bug will be fixed soon!

@4D17Y4 Thanks! Then reverting the commit would be the easiest, but if you are up for the challenge, how about checking what has changed in ExifInterface and adapt our source code to the new outputs? :-)

@nicolas-raoul l've tried solving the issue without reverting the files.
Would be glad if u review the pr ;)

Thanks a lot @4D17Y4 ! :)

@jidanni Hope this fixes the issue for you. In the future, in your logs it would be great if you could mention that you are an alpha tester. 99.99% of our Play Store users are running beta or production versions, so just mentioning that it is from the "Play Store" is slightly confusing for our volunteers.

The alpha version is essentially the latest code on master, it is uploaded automatically and NOT tested manually beforehand (in our documentation, we explicitly mention that it may be unstable sometimes), and its main purpose is expediting testing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maskaravivek picture maskaravivek  路  3Comments

madhurgupta10 picture madhurgupta10  路  3Comments

Saral-code picture Saral-code  路  3Comments

nicolas-raoul picture nicolas-raoul  路  4Comments

nicolas-raoul picture nicolas-raoul  路  3Comments