Skip to content

Crash on Waydroid: architecture build issue? #40

Open

Description

@XanderLeaDaren

Describe the bug
NaturalHour is not running under WayDroid (GNU/Linux contrainer-based approach to launch Android apps), while Suntimes is. Sometimes, the app launches (icon visible on screen) then is immediately killed.

Version Info:

  • NaturalHour 0.3.2
  • Suntimes 0.16.11
  • Android 13 via LineageOS 20 via Waydroid 1.5.4

Additional context

  • Suntimes has been installed via F-Droid 1.23.1
  • NaturalHour has been installed via apk from this repo.
  • Waydroid doc states “The apk files you will sometimes find on the internet tend to only have arm support, and will therefore not work on x86_64. You may want to install F-Droid to get applications graphically.”

Activity

  1. forrestguice commented on Nov 9, 2025

    @forrestguice
    Owner

    hrm, I'm not sure what the issue might be.
    There isn't any 'native code' in NaturalHour and afaik the binary produced by Android Studio is a "fat apk" so it should support both x86 and arm.

    It is interesting that Suntimes itself works. Unlike the addons it is built by F-Droid (but it also has a lower targetSdkVersion, so there are other differences). It might be useful to try the other addons and see if they run or not. The IntervalMidpoints and SuntimesNFC apps have similar dependencies and are built the same way as NaturalHour.

    There might also be something useful in the logcat. I haven't used Waydroid (yet), but I found https://docs.waydro.id/debugging/getting-essential-information which should help with that.

  2. XanderLeaDaren commented on Nov 9, 2025

    @XanderLeaDaren
    Author

    Thanks for your answer.

    • .apk for IntervalMidponts on github installs, but the app crashes at launch, as NaturalHour.
    • .apk for SuntimesNFC on github installs and is functional!
    • Suntimes Calendar installs from F-Droid on Wayland and is fully functional.

    I noticed you recently updated an F-Droid repo, which is fully functional under F-Droid/Waydroid.

    • NaturalHour fails to launch even from this, so it seems it’s not related to the installation part.
    • out of curiosity, I tried to install the other apps from this repo: Solunar periods, Interval Midpoints fail to launch.
    • Suntimes NFC is listed as incompatible by F-Droid?!
    • Suntimes Calendar IS functional through F-Droid via your repo.

    WayDroid logcat outputs 21000+ lines of info, with 84 references to NaturalHour when launching it. It seems tedious to look it through, what do you think?

  3. forrestguice commented on Nov 13, 2025

    @forrestguice
    Owner

    This is very useful information, thank you.
    I'm feeling cautiously optimistic we can figure this out.

    Suntimes NFC is listed as incompatible by F-Droid?!

    There is a line in that app's manifest that restricts it to devices with actual nfc hardware. It is only a suggestion for app stores though (the package installer doesn't check). I have an older device with nfc, but none of my newer devices are fancy enough to support it.

    Suntimes Calendar IS functional through F-Droid via your repo.

    SuntimesCalendars is actually built and signed by F-Droid, and then I mirror it to the other repo. It is the same for the main Suntimes app. I build all of the other addons myself and sign those with my own key. I suspect the differences lies elsewhere though, especially given that SuntimesNFC seems to run fine.

    It seems tedious to look it through, what do you think?

    That's understandable. There is a lot of noise in the log. If its possible to monitor the output in real time, that should be easier.

    I've added some basic crash reporting which should hopefully capture the crash (but who knows, that mechanism may also crash). There is now a "nightly" version of NaturalHour at https://forrestguice.github.io/NaturalHour-nightly/fdroid/repo/ that gets built from the latest commit. Hopefully make debugging this a little easier.

  4. XanderLeaDaren commented on Nov 15, 2025

    @XanderLeaDaren
    Author

    Hi, there, thanks for the investigation!

    I installed the nightly version and got the following. Hope it’ll help!

    NaturalHour 0.3.2-nightly (2025111320) [com.forrestguice.suntimes.naturalhour.nightly] [debug] [7425f14]
    Android 13 (33) [Waydroid]

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.forrestguice.suntimes.naturalhour.nightly/com.forrestguice.suntimes.naturalhour.MainActivity}: android.view.InflateException: Binary XML file line #12 in com.forrestguice.suntimes.naturalhour.nightly:layout/activity_main: Binary XML file line #8 in com.forrestguice.suntimes.naturalhour.nightly:layout/content_main: Error inflating class fragment
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3645)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7924)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:937)
    Caused by: android.view.InflateException: Binary XML file line #12 in com.forrestguice.suntimes.naturalhour.nightly:layout/activity_main: Binary XML file line #8 in com.forrestguice.suntimes.naturalhour.nightly:layout/content_main: Error inflating class fragment
    Caused by: android.view.InflateException: Binary XML file line #8 in com.forrestguice.suntimes.naturalhour.nightly:layout/content_main: Error inflating class fragment
    Caused by: java.lang.NumberFormatException: empty String
    at jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1842)
    at jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    at java.lang.Double.parseDouble(Double.java:543)
    at com.forrestguice.suntimes.naturalhour.data.NaturalHourData.(NaturalHourData.java:75)
    at com.forrestguice.suntimes.naturalhour.ui.NaturalHourFragment$NaturalHourCardAdapter.createData(NaturalHourFragment.java:671)
    at com.forrestguice.suntimes.naturalhour.ui.NaturalHourFragment$NaturalHourCardAdapter.initData(NaturalHourFragment.java:657)
    at com.forrestguice.suntimes.naturalhour.ui.NaturalHourFragment$NaturalHourCardAdapter.initData(NaturalHourFragment.java:645)
    at com.forrestguice.suntimes.naturalhour.ui.NaturalHourFragment.initData(NaturalHourFragment.java:226)
    at com.forrestguice.suntimes.naturalhour.ui.NaturalHourFragment.onCreateView(NaturalHourFragment.java:153)
    at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
    at androidx.fragment.app.FragmentStateManager.ensureInflatedView(FragmentStateManager.java:386)
    at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:281)
    at androidx.fragment.app.FragmentLayoutInflaterFactory.onCreateView(FragmentLayoutInflaterFactory.java:140)
    at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:135)
    at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:319)
    at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:298)
    at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1073)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1001)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1267)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:686)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:485)
    at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:775)
    at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:197)
    at com.forrestguice.suntimes.naturalhour.MainActivity.onCreate(MainActivity.java:145)
    at android.app.Activity.performCreate(Activity.java:8365)
    at android.app.Activity.performCreate(Activity.java:8344)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7924)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:937)

  5. added a commit that references this issue on Nov 15, 2025
  6. forrestguice commented on Nov 15, 2025

    @forrestguice
    Owner

    I think this is some kind of fragment lifecycle bug, maybe because of the static <fragment> declared in the layout (vs adding fragments later dynamically). I think the crash itself occurs because the fragment tries to initialize its data before the activity itself has interacted with Suntimes (so certain required values are empty/null). For whatever reason the initialization is different and that code is running out of expected order. 😕 SuntimesNFC is super simple (doesn't declare any fragments), and SuntimesCalendars declares them dynamically.

    There should be an update to the nightly version - maybe this allows it to run.
    I have left the lines that were crashing alone though (so that it may continue to crash until the underlying issue is resolved).

  7. added a commit that references this issue on Nov 21, 2025
  8. forrestguice commented on Nov 21, 2025

    @forrestguice
    Owner

    I now have Waydroid up and running, but I'm unfortunately unable to reproduce the problem. All of the addon apps are running correctly for me. There must be something more to it. :\

    I think this is some kind of fragment lifecycle bug,

    ... or maybe not. I think I was mistaken about that. SolunarPeriods is also very simple (no fragments). I've prepared a nightly version of that app with crash reporting at https://forrestguice.github.io/SolunarPeriods-nightly/fdroid/repo/. The report it creates might be helpful.

    There should also be an update available for the nightly version of NaturalHour. I've fixed the lines that were crashing, but since I don't fully understand why it was happening I'm not sure what to expect when it runs..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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