PhilKes / NotallyX

Minimalistic Android note taking App | Notally, but eXtended.
GNU General Public License v3.0
70 stars 1 forks source link

The app crashes when creating a link #112

Open CodeNomadHQ opened 2 weeks ago

CodeNomadHQ commented 2 weeks ago

What happened?

The app crashes when attempting to create a link from a note.

App Version

6.1-RC3

Android Version

15

(Optional) Relevant log output

type: crash
osVersion: google/husky/husky:15/AP3A.241005.015/2024103100:user/release-keys
package: com.philkes.notallyx:603, targetSdk 34
process: com.philkes.notallyx
processUptime: 5003 + 296 ms
installer: com.android.packageinstaller

java.lang.NullPointerException
at com.philkes.notallyx.presentation.activity.note.EditNoteActivity$setupEditor$1$onCreateActionMode$1$2.o(SourceFile:37)
at com.philkes.notallyx.presentation.b.onMenuItemClick(SourceFile:30)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:148)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:935)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:925)
at com.android.internal.view.FloatingActionMode.lambda$setFloatingToolbar$0(FloatingActionMode.java:122)
at com.android.internal.view.FloatingActionMode.$r8$lambda$Y9Hq7gobR_VYnOvJY4KEpwtp1Qg(Unknown Source:0)
at com.android.internal.view.FloatingActionMode$$ExternalSyntheticLambda0.onMenuItemClick(D8$$SyntheticClass:0)
at com.android.internal.widget.floatingtoolbar.LocalFloatingToolbarPopup$2.onClick(LocalFloatingToolbarPopup.java:177)
at android.view.View.performClick(View.java:8028)
at android.view.View.performClickInternal(View.java:8005)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:31229)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8744)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ExecInit.main(ExecInit.java:50)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:369)
PhilKes commented 2 weeks ago

This might be due to the migration to targetSdk 34, but not sure since I couldnt reproduce it yet. I found some calls which can be replaced with ..Compat calls to be 100% compatible with all Android versions, I will push these changes. Can you elaborate on what exactly you did? Did you write some text, select it and clicked "Link"? Did you have some text in your clipboard at at that time?

CodeNomadHQ commented 1 week ago

Basically, when you click on the link button, it crashes, as shown in the video

https://github.com/user-attachments/assets/3c657598-edc4-494e-8475-66ba12aae133

PhilKes commented 1 week ago

Basically, when you click on the link button, it crashes, as shown in the video

video.mp4

Could you check if the problem still exists in the v6.1 (see https://github.com/PhilKes/NotallyX/issues/120)? It doesnt crash for my Android 14 Emulator, so I'm guessing the getSystemService returned null for Android 15 before I used the ContextCompat utils class

CodeNomadHQ commented 1 week ago

It still crashes even in version v6.1 PR4

PhilKes commented 1 week ago

I really cant reproduce this bug, I even added a Android 15 to my emulator, but it works without problems:

notallyx_issues_112.webm

It still crashes even in version v6.1 PR4

I dont mean the v6.1-RC4 release on Github, I mean the v6.1 that I currently have only released on Google Play closed test (https://github.com/PhilKes/NotallyX/issues/120). I will soon release v6.1 on F-Droid too, I just want to slow down development a bit since the Google Play Release takes longer than expected

CodeNomadHQ commented 1 week ago

In that case, I’ll wait for the release on the Play Store and test that version.