Skip to content

Conversation

@ezaquarii
Copy link
Collaborator

Crash was caused by async task callback firing when
Fragment is not attached to activity.

Check if fragment is attached before invoking
callback logic.

Fixes: #5020

Signed-off-by: Chris Narkiewicz hello@ezaquarii.com

Crash was caused by async task callback firing when
Fragment is not attached to activity.

Check if fragment is attached before invoking
callback logic.

Fixes: #5020

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
@nextcloud-android-bot
Copy link
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/12099.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@nextcloud-android-bot
Copy link
Collaborator

Codacy

327

Lint

TypemasterPR
Warnings7474
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings71
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings106
Security Warnings44
Dodgy code Warnings139
Total413

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings71
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings106
Security Warnings44
Dodgy code Warnings139
Total413

@codecov
Copy link

codecov bot commented Dec 25, 2019

Codecov Report

Merging #5065 into master will increase coverage by 0.04%.
The diff coverage is 0%.

@@             Coverage Diff              @@
##             master    #5065      +/-   ##
============================================
+ Coverage     17.67%   17.72%   +0.04%     
  Complexity        3        3              
============================================
  Files           389      389              
  Lines         32893    32893              
  Branches       4627     4627              
============================================
+ Hits           5815     5830      +15     
+ Misses        26128    26111      -17     
- Partials        950      952       +2
Impacted Files Coverage Δ Complexity Δ
...ndroid/ui/dialog/ChooseTemplateDialogFragment.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...m/owncloud/android/ui/activity/DrawerActivity.java 45.46% <0%> (+2.3%) 0% <0%> (ø) ⬇️

@tobiasKaminsky tobiasKaminsky merged commit 9b79b85 into master Jan 6, 2020
@delete-merged-branch delete-merged-branch bot deleted the ezaquarii/fix-crash-when-making-new-ods-file branch January 6, 2020 13:57
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.10.0 milestone Jan 6, 2020
tobiasKaminsky added a commit that referenced this pull request Jan 7, 2020
f690417 Merge pull request #5102 from nextcloud/removeNC12
051423c remove support for NC12
d7d1c47 Merge pull request #5031 from nextcloud/ezaquarii/fix-npe-crash-when-storage-manager-is-not-set
9b79b85 Merge pull request #5065 from nextcloud/ezaquarii/fix-crash-when-making-new-ods-file
32ebe69 Merge pull request #5066 from nextcloud/ezaquarii/fix-shared-by-null-glitch
6e07d18 Merge pull request #5035 from nextcloud/enh/clickableMarkdownLinks
5fce6ca Removed unneeded try/catch
a680697 Removed unneeded try/catch
154b9af adjusted to master
a15f724 Make hyperlinks clickable in markdown previews
5f70ea6 Make hyperlinks clickable in markdown previews
cd0f834 [tx-robot] updated from transifex
22ab16e [tx-robot] updated from transifex
80d7d26 [tx-robot] updated from transifex
6d76582 [tx-robot] updated from transifex
167b250 Merge pull request #5085 from nextcloud/dependabot/gradle/junit-junit-4.13
7b6e1b7 [tx-robot] updated from transifex
1c12ca0 Bump junit from 4.12 to 4.13
71f919f [tx-robot] updated from transifex
fc00d7d Merge pull request #5077 from nextcloud/dependabot/gradle/daggerVersion-2.25.4
9a3bf3a Bump daggerVersion from 2.25.3 to 2.25.4
0c3b8fc [tx-robot] updated from transifex
ef84976 Fix "Shared by null" glitch in file details view
3cf3e3b Fix crash when adding new ODS file
2047079 Merge pull request #5060 from nextcloud/dependabot/gradle/io.gitlab.arturbosch.detekt-detekt-gradle-plugin-1.3.0
2882236 Bump detekt-gradle-plugin from 1.2.2 to 1.3.0
3687301 [tx-robot] updated from transifex
f53d637 [tx-robot] updated from transifex
24921f6 [tx-robot] updated from transifex
c30c6c7 daily dev 20191221
@dysonsphere-startmail
Copy link

Still having this problem.
Happens about 50% of the time I try to create .ods.
Android App 3.12.0 RC3

************ CAUSE OF ERROR ************

java.lang.IllegalStateException: calling this from your main thread can lead to deadlock
at android.accounts.AccountManager.ensureNotOnMainThread (AccountManager.java:2200)
at android.accounts.AccountManager.access $ 500 (AccountManager.java:162)
at android.accounts.AccountManager $ AmsTask.internalGetResult (AccountManager.java:2306)
at android.accounts.AccountManager $ AmsTask.getResult (AccountManager.java:2344)
at android.accounts.AccountManager $ AmsTask.getResult (AccountManager.java:2259)
at android.accounts.AccountManager.blockingGetAuthToken (AccountManager.java:1535)
at com.owncloud.android.lib.common.OwnCloudClientFactory.createOwnCloudClient (OwnCloudClientFactory.java:90)
at com.nextcloud.client.network.ClientFactoryImpl.create (ClientFactoryImpl.java:49)
at com.owncloud.android.ui.dialog.ChooseRichDocumentsTemplateDialogFragment.onCreateDialog (ChooseRichDocumentsTemplateDialogFragment.java:161)
at androidx.fragment.app.DialogFragment.onGetLayoutInflater (DialogFragment.java:380)
at androidx.fragment.app.Fragment.performGetLayoutInflater (Fragment.java:1412)
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.execPendingActions (FragmentManagerImpl.java:1727)
at androidx.fragment.app.FragmentManagerImpl $ 2.run (FragmentManagerImpl.java:150)
at android.os.Handler.handleCallback (Handler.java:883)
at android.os.Handler.dispatchMessage (Handler.java:100)
at android.os.Looper.loop (Looper.java:214)
at android.app.ActivityThread.main (ActivityThread.java:7356)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run (RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:930)

************ APP INFORMATION ************
ID: com.nextcloud.client
Version: 30120053
Build flavor: gplay

************ DEVICE INFORMATION ************
Brand: google
Device: bonito
Model: Pixel 3a XL
Id: QQ2A.200501.001.B2
Product: bonito

************ FIRMWARE ************
SDK: 29
Release: 10
Incremental: 6352890

@AndyScherzinger
Copy link
Member

@dysonsphere-startmail I created a new issue #6212 since the error you report leads to the same result (crash) but is a different issue.

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

Successfully merging this pull request may close these issues.

Crash while attempting to make a new ods file

6 participants