Skip to content

[Bug]: App crashes when adding a Location attachment to a note #1003

@runnnnnner200

Description

@runnnnnner200

Bug Description
When adding an attachment of type "Location" to a note, the app crashes after granting location permissions.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new note.
  2. In the note editing screen, add an attachment and select the "Location" option.
  3. Grant location permissions when prompted.
  4. The app crashes.

Expected Behavior
The app should successfully attach the location information to the note without crashing.

Screen Recording
https://github.com/user-attachments/assets/41e38ecd-09c0-4627-8326-249976a07f08

Smartphone:

  • Device: generic_x86_64 (Android Studio x86 emulator)
  • OS: Android 9
  • Version: 6.3.1

Error Logs

--------- beginning of crash
03-20 05:53:57.101 24908 24908 E AndroidRuntime: FATAL EXCEPTION: main
03-20 05:53:57.101 24908 24908 E AndroidRuntime: Process: it.feio.android.omninotes.foss, PID: 24908
03-20 05:53:57.101 24908 24908 E AndroidRuntime: java.lang.UnsupportedOperationException: This is just an usless class to make compiler happy!
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at io.nlopez.smartlocation.location.providers.LocationGooglePlayServicesWithFallbackProvider.<init>(LocationGooglePlayServicesWithFallbackProvider.java:16)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at it.feio.android.omninotes.helpers.GeocodeProviderBaseFactory.getProvider(GeocodeProviderBaseFactory.java:43)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at it.feio.android.omninotes.utils.GeocodeHelper.getLocation(GeocodeHelper.java:90)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at it.feio.android.omninotes.DetailFragment.lambda$getLocation$12(DetailFragment.java:712)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at it.feio.android.omninotes.DetailFragment.$r8$lambda$u9sk19KAJTOxnZxpbSTcyvYLY5E(DetailFragment.java:0)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at it.feio.android.omninotes.DetailFragment$$ExternalSyntheticLambda26.onPermissionGranted(R8$$SyntheticClass:0)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at it.feio.android.omninotes.helpers.PermissionsHelper.requestPermission(PermissionsHelper.java:61)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at it.feio.android.omninotes.DetailFragment.getLocation(DetailFragment.java:710)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at it.feio.android.omninotes.DetailFragment.displayLocationDialog(DetailFragment.java:930)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at it.feio.android.omninotes.DetailFragment.-$$Nest$mdisplayLocationDialog(DetailFragment.java:0)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at it.feio.android.omninotes.DetailFragment$AttachmentOnClickListener.onClick(DetailFragment.java:2319)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at android.view.View.performClick(View.java:6597)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at android.view.View.performClickInternal(View.java:6574)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at android.view.View.access$3100(View.java:778)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at android.view.View$PerformClick.run(View.java:25885)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:873)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:193)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6669)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
03-20 05:53:57.101 24908 24908 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
03-20 05:53:57.142  1910  1979 E InputDispatcher: channel '6dd28fa it.feio.android.omninotes.foss/it.feio.android.omninotes.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
03-20 05:53:57.142  1910  1979 E InputDispatcher: channel '48d6590 it.feio.android.omninotes.foss/it.feio.android.omninotes.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
03-20 05:54:01.530  1767  1832 E storaged: getDiskStats failed with result NOT_SUPPORTED and size 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions