Skip to content

App Crash on Login #3914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fnordson opened this issue Aug 31, 2020 · 6 comments
Closed

App Crash on Login #3914

fnordson opened this issue Aug 31, 2020 · 6 comments

Comments

@fnordson
Copy link

Summary:

Login leads to crash of app

Steps to reproduce:

Start App
Type in login data.
Hit "login" button.

System logs:


STACK_TRACE=java.lang.RuntimeException: Unable to start activity ComponentInfo{fr.free.nrw.commons/fr.free.nrw.commons.contributions.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.accounts.Account.hashCode()' on a null object reference
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2678)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2743)
	at android.app.ActivityThread.-wrap12(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1490)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6165)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.accounts.Account.hashCode()' on a null object reference
	at android.os.Parcel.readException(Parcel.java:1690)
	at android.os.Parcel.readException(Parcel.java:1637)
	at android.content.IContentService$Stub$Proxy.setSyncAutomaticallyAsUser(IContentService.java:1060)
	at android.content.ContentResolver.setSyncAutomaticallyAsUser(ContentResolver.java:2107)
	at android.content.ContentResolver.setSyncAutomatically(ContentResolver.java:2097)
	at fr.free.nrw.commons.contributions.MainActivity.initMain(MainActivity.java:110)
	at fr.free.nrw.commons.contributions.MainActivity.onCreate(MainActivity.java:84)
	at android.app.Activity.performCreate(Activity.java:6687)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2631)
	... 9 more



Device and Android version:

ANDROID_VERSION=7.1.1
PHONE_MODEL=Moto G Play

Commons app version:

APP_VERSION_CODE=561
APP_VERSION_NAME=2.12.3

Would you like to work on the issue?

I don't have the qualification to work on this issue

@misaochan
Copy link
Member

Hi, this bug should have been fixed in v2.13.1. Could you register for beta testing and let us know if it fixes the problem for you? Otherwise, the new version should be available to everyone by the end of the week (if everything goes well).

@fnordson
Copy link
Author

fnordson commented Aug 31, 2020

@misaochan

I installed the Beta but the problem still occurs.
From the crash log I've send:

APP_VERSION_CODE=775
APP_VERSION_NAME=2.13.1
ANDROID_VERSION=7.1.1
PHONE_MODEL=Moto G Play
STACK_TRACE=java.lang.NullPointerException: Attempt to read from field 'java.lang.String android.accounts.Account.name' on a null object reference
at fr.free.nrw.commons.contributions.ContributionsFragment.setUploadCount(ContributionsFragment.java:363)
at fr.free.nrw.commons.contributions.ContributionsFragment.onCreateView(ContributionsFragment.java:166)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)
at androidx.fragment.app.FragmentManagerImpl.execSingleAction(FragmentManagerImpl.java:1696)
at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:299)
at androidx.fragment.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:235)
at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1244)
at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1092)
at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1622)
at android.view.View.measure(View.java:19883)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.view.View.measure(View.java:19883)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:19883)
at androidx.drawerlayout.widget.DrawerLayout.onMeasure(DrawerLayout.java:1119)
at android.view.View.measure(View.java:19883)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
at android.view.View.measure(View.java:19883)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
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:19883)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.view.View.measure(View.java:19883)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
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:19883)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at com.android.internal.policy.DecorView.onMeasure(DecorView.java:689)
at android.view.View.measure(View.java:19883)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2293)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1384)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1637)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1272)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6408)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:621)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)

REPORT_ID=798a844b-fdd8-4ccf-953f-3b181b009244

Edit: damn...sorry I just remembered that you probably got a mail for every deleted msg...sorry :(

@ashishkumar468
Copy link
Collaborator

This seems to be a different one from the one mentioned in the original issue log, @fnordson So just to confirm, you are able to login in successfully but as soon as you get logged in, the app crashes?

ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue Sep 1, 2020
* Verify user login before setting upload count
@fnordson
Copy link
Author

fnordson commented Sep 1, 2020

@ashishkumar0207

Edit:

Just before the app disappears and the crash report pop-up comes up, I can see a "login successful text".
Here is the Video:
comm_crash_1.zip

(Black bars just covering up a few apps on my desktop)

misaochan pushed a commit that referenced this issue Sep 1, 2020
* Verify user login before setting upload count
@fnordson
Copy link
Author

@misaochan Why has this been closed?
Is it supposed to be fixed (it isn't on my phone)?
Fixed in the next version?

@misaochan
Copy link
Member

The associated PR has been merged, so the issue is auto-closed. It will be released in the next hotfix, which should be soon.

ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue Oct 10, 2020
* commons-app#3624 DateTimeFormat wrong - match pattern returned from servers (commons-app#3625)

* Revert "Fixes: commons-app#3179 Make category search non case-sensitive (commons-app#3326)" (commons-app#3636)

Simply lower casing the name of the category sent to the server
doesn't result in the server doing a case insensitive category
search. In fact, it reduces the category search space as only
categories that has a lower case character is searched even
if the search text contains upper case characters.

The test case did not catch this issue as the first character
of the title is case insensitive[1].

So, revert the changes done in commit afdeaae.

See further disucssion in the issue thread of commons-app#3179 starting
from [2].

[1]: https://www.mediawiki.org/wiki/Manual:Page_title
[2]: commons-app#3179 (comment)

* Bugfix/security exception (commons-app#3627)

* Fixes commons-app#3626
* Check is file is actually created before writing to file, file picker android

* Handle Security exception

* Fixes commons-app#3436 and commons-app#2881: Media Detail design Overhaul (commons-app#3505)

* ic_map_dark_24dp: map icon for white background

* ic_info_outline_dark_24dp: info icon for dark background

* MediaDetailFragment: update the spacer as per image aspect ratio

* fragment_media_detail: design overhaul

* fragment_media_detail: remove redundant background color statements

* make requested changes

* add dark mode support

* minor ui tweak

* white map icon in dark mode

* make rquested changes

* make requested changes to layout

* fix misalignment of category list

* subtle amendments

* convert comments to javadocs

* minor amendments

* minor changes

* add styles for media detail

* Media detail fragment refactored

* make suggested changes

* minor name fix

* fix the delete button border

* Fixes commons-app#3639 (Fix Save State implementation of CheckBoxTriState ) (commons-app#3686)

* Add commons-app#3723 and commons-app#3721 to 2.13 release, fix conflicts

Conflicts were caused by merging commons-app#3723 before commons-app#3721 , so I just rolled both into one commit.

* Fix NullPointer when clicking on image in MediaDetailFragment (commons-app#3730)… (commons-app#3739)

* Update changelog.md

* Versioning for v2.13

* Fixes commons-app#3705 (Crash when viewing pic I just uploaded) (commons-app#3782)

* Fixes commons-app#3705
* Let the MediaDetailPager fragment know when the contributions have been updated

* Handle NPE, null check on adapter in MediaDetailPagerFragment

* Fixed BookmarkLocationsDao DB migration (commons-app#3793)

* Fixes commons-app#3725 (commons-app#3795)

* Downgraded okhttp version to support Api 19 devices

* Handled null CompoundDrawable[2] in etTitle-> UploadMediaDetailsFragment (commons-app#3828)

* DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception (commons-app#3830)

* Fixes commons-app#3829
* DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception

* removed unused imports, handled possible exceptions

* Let Fresco handle the downsampling of image

* invalidate in onTransformEnd

* Expose an interface TransformationListener in ZoomableDraweeView to listen to transformation change end

* removed photoView dependency

* removed unused imports in ZoomableActivity

* Bugfix, expand/collapse

* changed functio name

* Bugfix/p18 uploads (commons-app#3869)

* updated gradle plugin version

* BugFix commons-app#3856
* Do not use preference for deciding acceptable lat long for nearby uploads, instead save the corresponding location in the Contribution via UploadItem

* Marshall contribution's hasInvalidLocation

* reset un-related changes

* Fixed test cases

* Minor code formatting and docs

* Fixes commons-app#3882 (commons-app#3883)

* Make hasInvalidLocation non-null integer with default value 0

Co-authored-by: Ashish Kumar <[email protected]>

* Fixes commons-app#3766, Added OPENSTREET attribution (commons-app#3889)

* Fixes commons-app#3766
* Added OPENSTREET attribution in nearby

* Added custom text attribution in Nearby

* Deleted unused class CustomBorderTextView

* review suggested changes

* modified telemetry summary string

* Versioning and changelog for v2.13.1 (commons-app#3908)

* Update changelog.md

* Versioning for v2.13.1

* Fixes commons-app#3914 (commons-app#3915)

* Verify user login before setting upload count

* fixed compile-time error

* fix erros

* delete emptied files

* remove empty file CategoriesModel.java

Co-authored-by: Seán Mac Gillicuddy <[email protected]>
Co-authored-by: Kaartic Sivaraam <[email protected]>
Co-authored-by: Kshitij Bhardwaj <[email protected]>
Co-authored-by: Vitaly V. Pinchuk <[email protected]>
Co-authored-by: Josephine Lim <[email protected]>
Co-authored-by: Ashish Kumar <[email protected]>
ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue Oct 10, 2020
* commons-app#3624 DateTimeFormat wrong - match pattern returned from servers (commons-app#3625)

* Revert "Fixes: commons-app#3179 Make category search non case-sensitive (commons-app#3326)" (commons-app#3636)

Simply lower casing the name of the category sent to the server
doesn't result in the server doing a case insensitive category
search. In fact, it reduces the category search space as only
categories that has a lower case character is searched even
if the search text contains upper case characters.

The test case did not catch this issue as the first character
of the title is case insensitive[1].

So, revert the changes done in commit afdeaae.

See further disucssion in the issue thread of commons-app#3179 starting
from [2].

[1]: https://www.mediawiki.org/wiki/Manual:Page_title
[2]: commons-app#3179 (comment)

* Bugfix/security exception (commons-app#3627)

* Fixes commons-app#3626
* Check is file is actually created before writing to file, file picker android

* Handle Security exception

* Fixes commons-app#3436 and commons-app#2881: Media Detail design Overhaul (commons-app#3505)

* ic_map_dark_24dp: map icon for white background

* ic_info_outline_dark_24dp: info icon for dark background

* MediaDetailFragment: update the spacer as per image aspect ratio

* fragment_media_detail: design overhaul

* fragment_media_detail: remove redundant background color statements

* make requested changes

* add dark mode support

* minor ui tweak

* white map icon in dark mode

* make rquested changes

* make requested changes to layout

* fix misalignment of category list

* subtle amendments

* convert comments to javadocs

* minor amendments

* minor changes

* add styles for media detail

* Media detail fragment refactored

* make suggested changes

* minor name fix

* fix the delete button border

* Fixes commons-app#3639 (Fix Save State implementation of CheckBoxTriState ) (commons-app#3686)

* Add commons-app#3723 and commons-app#3721 to 2.13 release, fix conflicts

Conflicts were caused by merging commons-app#3723 before commons-app#3721 , so I just rolled both into one commit.

* Fix NullPointer when clicking on image in MediaDetailFragment (commons-app#3730)… (commons-app#3739)

* Update changelog.md

* Versioning for v2.13

* Fixes commons-app#3705 (Crash when viewing pic I just uploaded) (commons-app#3782)

* Fixes commons-app#3705
* Let the MediaDetailPager fragment know when the contributions have been updated

* Handle NPE, null check on adapter in MediaDetailPagerFragment

* Fixed BookmarkLocationsDao DB migration (commons-app#3793)

* Fixes commons-app#3725 (commons-app#3795)

* Downgraded okhttp version to support Api 19 devices

* Handled null CompoundDrawable[2] in etTitle-> UploadMediaDetailsFragment (commons-app#3828)

* DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception (commons-app#3830)

* Fixes commons-app#3829
* DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception

* removed unused imports, handled possible exceptions

* Let Fresco handle the downsampling of image

* invalidate in onTransformEnd

* Expose an interface TransformationListener in ZoomableDraweeView to listen to transformation change end

* removed photoView dependency

* removed unused imports in ZoomableActivity

* Bugfix, expand/collapse

* changed functio name

* Bugfix/p18 uploads (commons-app#3869)

* updated gradle plugin version

* BugFix commons-app#3856
* Do not use preference for deciding acceptable lat long for nearby uploads, instead save the corresponding location in the Contribution via UploadItem

* Marshall contribution's hasInvalidLocation

* reset un-related changes

* Fixed test cases

* Minor code formatting and docs

* Fixes commons-app#3882 (commons-app#3883)

* Make hasInvalidLocation non-null integer with default value 0

Co-authored-by: Ashish Kumar <[email protected]>

* Fixes commons-app#3766, Added OPENSTREET attribution (commons-app#3889)

* Fixes commons-app#3766
* Added OPENSTREET attribution in nearby

* Added custom text attribution in Nearby

* Deleted unused class CustomBorderTextView

* review suggested changes

* modified telemetry summary string

* Versioning and changelog for v2.13.1 (commons-app#3908)

* Update changelog.md

* Versioning for v2.13.1

* Fixes commons-app#3914 (commons-app#3915)

* Verify user login before setting upload count

* fixed compile-time error

* fix erros

* delete emptied files

* remove empty file CategoriesModel.java

Co-authored-by: Seán Mac Gillicuddy <[email protected]>
Co-authored-by: Kaartic Sivaraam <[email protected]>
Co-authored-by: Kshitij Bhardwaj <[email protected]>
Co-authored-by: Vitaly V. Pinchuk <[email protected]>
Co-authored-by: Josephine Lim <[email protected]>
Co-authored-by: Ashish Kumar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants