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

Crash in new Markdown editor #2939

Closed
laurent22 opened this issue Mar 30, 2020 · 10 comments
Closed

Crash in new Markdown editor #2939

laurent22 opened this issue Mar 30, 2020 · 10 comments
Labels
android bug It's a bug stale An issue that hasn't been active for a while...

Comments

@laurent22
Copy link
Owner

When adding some text at the beginning of an empty note:

03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: FATAL EXCEPTION: main
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: Process: net.cozic.joplin, PID: 12963
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: java.lang.IndexOutOfBoundsException: setSpan (4 ... 4) ends beyond length 3
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1325)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:684)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:676)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.text.Selection.setSelection(Selection.java:94)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.text.Selection.setSelection(Selection.java:78)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.widget.TextView.semSetSelection(TextView.java:17146)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.widget.EditText.setSelection(EditText.java:148)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.views.textinput.ReactEditText.setSelection(ReactEditText.java:285)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.views.textinput.ReactTextInputManager.updateExtraData(ReactTextInputManager.java:215)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.views.textinput.ReactTextInputManager.updateExtraData(ReactTextInputManager.java:59)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.uimanager.NativeViewHierarchyManager.updateViewExtraData(NativeViewHierarchyManager.java:157)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.uimanager.UIViewOperationQueue$UpdateViewExtraData.execute(UIViewOperationQueue.java:236)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:779)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:888)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.uimanager.UIViewOperationQueue.access$2200(UIViewOperationQueue.java:42)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:948)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:28)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:174)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:84)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:994)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.view.Choreographer.doCallbacks(Choreographer.java:794)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.view.Choreographer.doFrame(Choreographer.java:725)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:981)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:883)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:100)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:237)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7811)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
03-30 00:59:41.508 10311 12963 12963 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
@laurent22 laurent22 added bug It's a bug mobile All mobile platforms high High priority issues labels Mar 30, 2020
@laurent22 laurent22 added android and removed mobile All mobile platforms labels Apr 8, 2020
@roman-r-m
Copy link
Collaborator

For me it does not happen when simply adding a text but it does happen when I type a word and then delete it (I'm using SwiftKey and can delete the last word by swiping right).

Seems related: facebook/react-native#25265
Apparently it's fixed in RN 0.62

@kowalskidev
Copy link
Contributor

To discuss this issue I've created a topic on discourse: https://discourse.joplinapp.org/t/android-joplin-keeps-stopping-while-using-editor-mode/7905

@laurent22
Copy link
Owner Author

laurent22 commented Apr 14, 2020

@devonzuegel, just to let you know this is why I haven't made an announcement for the new text editor yet, but it's available on Android and iOS. I'll wait till this bug is fixed, hopefully it's just a matter of upgrading React Native (which I'll do soon, as it might also fix another text editor related bug).

@bedwardly-down
Copy link
Contributor

bedwardly-down commented Apr 17, 2020

EED14E68-834D-4A02-8188-CDA75E867270

Here’s my log from it crashing on my Android phone but it happens while editing a note with multiple images and for some reason, a third of the screen is just a black bar that can be typed into.

Android 10
One Plus 7 Pro 256 gb

It also doesn’t seem to happen at all on my iPhone 11. So, is this just an Android only bug?

@kowalskidev
Copy link
Contributor

It also doesn’t seem to happen at all on my iPhone 11. So, is this just an Android only bug?

We are not sure yet! But now as you are saying it's not happening in your iPhone looks like it's working fine in iOS. As Laurent said this issue is related react-native hopefully upgrading react-native version would solve this issue.

@roman-r-m
Copy link
Collaborator

roman-r-m commented Jun 27, 2020

I've just tried building with RN 0.62.2 where this bug is supposed to be fixed.
I can confirm that Joplin does not crash any more, however when I'm typing the cursor jumps all over the place so the editor is still unusable at least for me.

@laurent22
Copy link
Owner Author

I can confirm that Joplin does not crash any more, however when I'm typing the cursor jumps all over the place so the editor is still unusable at least for me.

Hmm, looks like they still haven't fixed the cursor issues then. It's also the reason why the undo/redo feature on mobile doesn't restore the cursor because I found it was completely unreliable (the component would say the position is X when in fact it's Y).

@roman-r-m
Copy link
Collaborator

Not sure if the undo cursor issue is related - I've seen it with the old editor.

@stale
Copy link

stale bot commented Jul 30, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

@stale stale bot added the stale An issue that hasn't been active for a while... label Jul 30, 2020
@stale
Copy link

stale bot commented Aug 6, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug It's a bug stale An issue that hasn't been active for a while...
Projects
None yet
Development

No branches or pull requests

4 participants