Skip to content
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

Edit Note confirmation crash #4200

Closed
marcardar opened this issue Apr 8, 2016 · 18 comments
Closed

Edit Note confirmation crash #4200

marcardar opened this issue Apr 8, 2016 · 18 comments
Labels
Bug Good First Issue! Priority-High Reproduced This bug has been reproduced by a maintainer Stale

Comments

@marcardar
Copy link

AnkiDroid 2.5.4 (Android 6.0.1).

Try this:

  1. Check "Don't keep activities" in the system's Developer options
  2. Click on any deck / Edit Note / make any change / click Tick to accept
  3. Observe: an error has occurred

This happens for any note in any deck. There is no error when editing a note selected via the Card Browser.

@marcardar
Copy link
Author

I/AnkiDroid: NoteEditor:: Save note button pressed
I/art: Background partial concurrent mark sweep GC freed 39384(2MB) AllocSpace objects, 3(60KB) LOS objects, 37% free, 27MB/43MB, paused 5.860ms total 44.405ms
I/AnkiDroid: AbstractFlashcardViewer:: Saving card...
E/ACRA: ACRA caught a RuntimeException for com.ichi2.anki
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:309)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    at java.lang.Thread.run(Thread.java:818)
 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.ichi2.libanki.Note com.ichi2.libanki.Card.note()' on a null object reference
    at com.ichi2.async.DeckTask.doInBackgroundUpdateNote(DeckTask.java:400)
    at com.ichi2.async.DeckTask.doInBackground(DeckTask.java:247)
    at com.ichi2.async.DeckTask.doInBackground(DeckTask.java:66)
    at android.os.AsyncTask$2.call(AsyncTask.java:295)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
    at java.lang.Thread.run(Thread.java:818) 
D/ACRA: Building report
D/ACRA: Using custom Report Fields
I/ACRA: READ_LOGS granted! ACRA can include LogCat and DropBox data.
D/ACRA: Retrieving logcat output...
E/ACRA: Error while reading application log file 
java.io.FileNotFoundException: /data/user/0/com.ichi2.anki/files: open failed: EISDIR (Is a directory)
    at libcore.io.IoBridge.open(IoBridge.java:452)
    at java.io.FileInputStream.<init>(FileInputStream.java:76)
    at android.app.ContextImpl.openFileInput(ContextImpl.java:384)
    at android.content.ContextWrapper.openFileInput(ContextWrapper.java:177)
    at org.acra.collector.LogFileCollector.collectLogFile(LogFileCollector.java:61)
    at org.acra.collector.CrashReportDataFactory.createCrashData(CrashReportDataFactory.java:334)
    at org.acra.ErrorReporter.report(ErrorReporter.java:746)
    at org.acra.ErrorReporter.access$1400(ErrorReporter.java:81)
    at org.acra.ErrorReporter$ReportBuilder.send(ErrorReporter.java:1142)
    at org.acra.ErrorReporter.uncaughtException(ErrorReporter.java:428)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
 Caused by: android.system.ErrnoException: open failed: EISDIR (Is a directory)
    at libcore.io.IoBridge.open(IoBridge.java:442)
    at java.io.FileInputStream.<init>(FileInputStream.java:76) 
    at android.app.ContextImpl.openFileInput(ContextImpl.java:384) 
    at android.content.ContextWrapper.openFileInput(ContextWrapper.java:177) 
    at org.acra.collector.LogFileCollector.collectLogFile(LogFileCollector.java:61) 
    at org.acra.collector.CrashReportDataFactory.createCrashData(CrashReportDataFactory.java:334) 
    at org.acra.ErrorReporter.report(ErrorReporter.java:746) 
    at org.acra.ErrorReporter.access$1400(ErrorReporter.java:81) 
    at org.acra.ErrorReporter$ReportBuilder.send(ErrorReporter.java:1142) 
    at org.acra.ErrorReporter.uncaughtException(ErrorReporter.java:428) 
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693) 
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690) 
E/AnkiDroid: DeckTask/ previously running task failed with exception: 7
     java.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to invoke virtual method 'com.ichi2.libanki.Note com.ichi2.libanki.Card.note()' on a null object reference
         at java.util.concurrent.FutureTask.report(FutureTask.java:94)
         at java.util.concurrent.FutureTask.get(FutureTask.java:164)
         at android.os.AsyncTask.get(AsyncTask.java:498)
         at com.ichi2.async.DeckTask.doInBackground(DeckTask.java:209)
         at com.ichi2.async.DeckTask.doInBackground(DeckTask.java:66)
         at android.os.AsyncTask$2.call(AsyncTask.java:295)
         at java.util.concurrent.FutureTask.run(FutureTask.java:237)
         at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
         at java.lang.Thread.run(Thread.java:818)
      Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.ichi2.libanki.Note com.ichi2.libanki.Card.note()' on a null object reference
         at com.ichi2.async.DeckTask.doInBackgroundUpdateNote(DeckTask.java:400)
         at com.ichi2.async.DeckTask.doInBackground(DeckTask.java:247)
         at com.ichi2.async.DeckTask.doInBackground(DeckTask.java:66) 
         at android.os.AsyncTask$2.call(AsyncTask.java:295) 
         at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
         at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
         at java.lang.Thread.run(Thread.java:818) 
V/RenderScript: 0x7f8bd0f000 Launching thread(s), CPUs 8
W/VideoCapabilities: Unrecognized profile 2130706433 for video/avc
D/cr_Ime: [InputMethodManagerWrapper.java:27] Constructor
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime: [InputMethodManagerWrapper.java:56] isActive: false
I/AnkiDroid: AbstractFlashcardViewer:: Question successfully shown for card id 1460100606890
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
W/VideoCapabilities: Unrecognized profile 2130706433 for video/avc
E/ACRA: Error while retrieving crash data
java.lang.NullPointerException: Attempt to invoke virtual method 'int org.acra.collector.MediaCodecListCollector$CodecType.ordinal()' on a null object reference
    at org.acra.collector.MediaCodecListCollector.collectCapabilitiesForType(MediaCodecListCollector.java:216)
    at org.acra.collector.MediaCodecListCollector.collecMediaCodecList(MediaCodecListCollector.java:155)
    at org.acra.collector.CrashReportDataFactory.createCrashData(CrashReportDataFactory.java:345)
    at org.acra.ErrorReporter.report(ErrorReporter.java:746)
    at org.acra.ErrorReporter.access$1400(ErrorReporter.java:81)
    at org.acra.ErrorReporter$ReportBuilder.send(ErrorReporter.java:1142)
    at org.acra.ErrorReporter.uncaughtException(ErrorReporter.java:428)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
D/ACRA: Writing crash report file 1460103481000.stacktrace.
D/ACRA: Waiting for 2000 millis from 1460103481103 currentMillis=1460103481277
D/ACRA: Waiting for Toast
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 32012
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 32012
D/ACRA: Finished waiting for Toast
D/ACRA: Creating CrashReportDialog for 1460103481000.stacktrace
D/ACRA: Creating DialogIntent for 1460103481000.stacktrace exception=java.lang.RuntimeException: An error occurred while executing doInBackground()
D/ACRA: Wait for Toast + worker ended. Kill Application ? true
E/ACRA: com.ichi2.anki fatal error : An error occurred while executing doInBackground()
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:309)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    at java.lang.Thread.run(Thread.java:818)
 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.ichi2.libanki.Note com.ichi2.libanki.Card.note()' on a null object reference
    at com.ichi2.async.DeckTask.doInBackgroundUpdateNote(DeckTask.java:400)
    at com.ichi2.async.DeckTask.doInBackground(DeckTask.java:247)
    at com.ichi2.async.DeckTask.doInBackground(DeckTask.java:66)
    at android.os.AsyncTask$2.call(AsyncTask.java:295)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
    at java.lang.Thread.run(Thread.java:818) 
I/ACRA: Finishing the last Activity prior to killing the Process
I/ACRA: Finished class com.ichi2.anki.Reviewer
I/Process: Sending signal. PID: 32012 SIG: 9

@flerda
Copy link
Member

flerda commented Apr 8, 2016

FYI

If the error occurs only with "Don't keep activities" (or better, if it is
100% reproducible with that setting turned on), it means that one of the
activities involved (usually the one below the top one) does not correctly
save and restore its state and probably assumes that its fields are
preserved when the activity is stopped and restarted, which is not the case.

Flavio

On Fri, 8 Apr 2016 at 10:51 Mark Carter [email protected] wrote:

I've narrowed it down to this developer setting: "Don't keep activities" -
the error occurs if that is checked.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#4200 (comment)

@marcardar
Copy link
Author

BTW, I noticed that ACRA is throwing some odd errors and these are mentioned in this issue here. Any plans to update ACRA plugin to the latest (4.8.5)? It requires some code changes (I just saw that it introduces compiler errors when dropped in).

@timrae timrae added Priority-High Bug Accepted Maintainers welcome a PR implementing this feature labels Apr 9, 2016
@zenmonkey760
Copy link

I am experiencing crashes upon clicking the check mark to confirm edit of a card. But it only happens on my tablet and not on my phone. It has been happening on all versions, both released and beta.

AnkiDroid Version = 2.6beta6

Android Version = 5.1.1

ACRA UUID = 26e71aac-7146-4f05-a37d-c75f00115e40

@hssm
Copy link
Member

hssm commented Jun 12, 2016

The crash signature from your device appears to be the same as above. Do you happen to have the Don't keep activities option enabled in the developer menu of your device?

@zenmonkey760
Copy link

Indeed I did have it set. Turning it off resolved the crash.

On 6/12/2016 4:37 AM, Houssam Salem wrote:

The crash signature from your device appears to be the same as above.
Do you happen to have the |Don't keep activities| option enabled in
the developer menu of your device?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#4200 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AF12LCHVD9wiEzN5ZXzHL6gP4MoY0AmYks5qK-9ygaJpZM4ICxqH.

@javenschuetz
Copy link

I'm not certain if this is the right place to report it, but I can't edit notes in the android version. Tapping the checkmark causes a 'AnkiDroid has encountered a Problem. A report is being sent to the developers.' error and the edit is not saved.

Hardware/OS
Samsung galaxy s8 plus, newest updates (Nov 2017)

To reporoduce:
click a deck to begin reviews
find a card you wish you wrote better
click ... -> edit
modify any text on the card (default card type)
click checkmark
mini-crash + error popup

frequency: 100% of the time, I can only edit using the desktop client

AnkiDroid version: ankidroid just updated for me today (nov 12/2017) but the problem persists.

Note: I'm a software engineering intern looking for side projects. It might be fun to chip in on fixing this. I've never contributed to OSS however (Java, correct?). Please let me know if anybody has an interest in this who could also point me at how to get started.

@timrae
Copy link
Member

timrae commented Dec 14, 2017

@javenschuetz

Did you read the previous comments? Do you have that setting enabled?
Also, the fix for the problem was hinted at by @flerda above, it just requires someone to go and implement it. See the development guide for some basic hints to get you started.

@javenschuetz
Copy link

My situation has changed and I won't be able to work on any side projects for a while. Pardon my not being able to follow through.

@mikehardy
Copy link
Member

mikehardy commented Jun 29, 2018

Looking at this - @timrae you interested in a PR for an upgrade to ACRA 4.x-current?
ACRA 5.x requires minSDK of 26 (!!) so that's a no-go but 4.11 exists and it did need soem code changes, but I have it working except for automated tests. Not the most important part of this issue, but it's something...and the change to 4.x-current is actually most of the way to 5 for whenever that's ready, FWIW

@timrae
Copy link
Member

timrae commented Jun 30, 2018

There was an issue last time I updated Acra and had to revert:

1263f84

@timrae
Copy link
Member

timrae commented Jun 30, 2018

Theoretically it should be fixed by ACRA/acra#344, so I think ok to give 4.11 a try, but we'll need to tread lightly. Please put it into its own PR if you do submit one.

@mikehardy
Copy link
Member

Agreed on treading lightly - introducing an error in the error-reporting function is serious problem. I already have it working but its the testing I'm struggling with and that's where I want to suss out things like the issue you linked above. I'll give it a shot, definitely in a separate PR. I still need to get better at Activities etc so ideally I can take a look at the real core issue here and have a go at it later (separately) as well

@mikehardy
Copy link
Member

mikehardy commented Oct 6, 2018

@javenschuetz if you're still around I'm more interested in fixing this now - previously I was using this as my 100%-reproducible test case to trigger crashes so I selfishly didn't want it to go away ;-), but I have a test crash button now. I'm 99% sure this is a simple issue of not saving / restoring bundle state correctly, and if you ever wanted to learn android and fix a bug at the same time, our code has examples of bundle save/restore all over to look at while the change itself should be pretty self-contained. Great first issue...

@javenschuetz
Copy link

javenschuetz commented Oct 7, 2018

I'm actually free to work on things for the next 6 months or so, thanks for the mention

I haven't personally seen the issue in months however and thought it was fixed. Is this still happening, or are you talking about a related issue?

edit: I'm probably going to be AWOL for 2 days while I work on an openGL assignment, I'll check back after its done :)

@mikehardy
Copy link
Member

Hmm - maybe in one of the library updates as I was forward-porting it "self fixed" but I don't think so - last I checked it was still a crash bug even if only because of rare settings. If not this one (and you're still interested in poking around) I made a "Good First Issue!" label and there are a few that might be fun (?) to chew on.

@javenschuetz
Copy link

I'm going to check back with you in late December/early January after this semester ends and I end up with way more time. I might lurk a bit until then asking questions if I find time though

@timrae timrae added Reproduced This bug has been reproduced by a maintainer Accepted Maintainers welcome a PR implementing this feature and removed Accepted Maintainers welcome a PR implementing this feature labels Jan 3, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2020

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

Apochens added a commit to Apochens/Anki-Android that referenced this issue Sep 18, 2021
Apochens added a commit to Apochens/Anki-Android that referenced this issue Oct 6, 2021
…ki-Android into buggy-ankidroid#4200

# Conflicts:
#	AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java
#	AnkiDroid/src/main/java/com/ichi2/anki/NoteEditor.java
#	AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.java
#	AnkiDroid/testconfig.gradle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Good First Issue! Priority-High Reproduced This bug has been reproduced by a maintainer Stale
Projects
None yet
Development

No branches or pull requests

7 participants