I'm not sure if this is an issue with AndroidX Nav...
# android
m
I'm not sure if this is an issue with AndroidX Navigation kotlin safe args pluging ( or something missing on my end), But I get a stackoverflow crash when relying on the generated code 🧵
This is the generated directions class
Copy code
public class WorkOrderParentHeatPumpSurveyFragmentDirections private constructor() {
  private data class WorkOrderParentHeatPumpSurveyFragmentToEditRadiatorsMeasurementsFragmentAction(
    public val roomRadiatorData: Array<RadiatorData>
  ) : NavDirections {
    public override val actionId: Int =
        R.id.WorkOrderParentHeatPumpSurveyFragment_to_editRadiatorsMeasurementsFragmentAction

    public override val arguments: Bundle
      get() {
        val result = Bundle()
        result.putParcelableArray("roomRadiatorData", this.roomRadiatorData)
        return result
      }
  }

  public companion object {
    public fun WorkOrderParentFragmentToCaptureBarcodeFragment(): NavDirections =
        ActionOnlyNavDirections(R.id.WorkOrderParentFragment_to_CaptureBarcodeFragment)

    public fun WorkOrderParentFragmentToCaptureCameraFragment(): NavDirections =
        ActionOnlyNavDirections(R.id.WorkOrderParentFragment_to_CaptureCameraFragment)

    public
        fun WorkOrderParentHeatPumpSurveyFragmentToEditRadiatorsMeasurementsFragmentAction(roomRadiatorData: Array<RadiatorData>):
        NavDirections =
        WorkOrderParentHeatPumpSurveyFragmentToEditRadiatorsMeasurementsFragmentAction(roomRadiatorData)
  }
}
Copy code
WorkOrderParentHeatPumpSurveyFragmentToEditRadiatorsMeasurementsFragmentAction
Its referencing itself thus causing teh StackOverflow
This is not an issue if the java gradle plugin its used
🧵 1
Copy code
<navigation xmlns:android="<http://schemas.android.com/apk/res/android>"
    xmlns:app="<http://schemas.android.com/apk/res-auto>"
    android:id="@+id/navigation_graph_workorder_parent_heat_pump_survey"
    app:startDestination="@id/WorkOrderParentHeatPumpSurveyFragment">

    <fragment
        android:id="@+id/WorkOrderParentHeatPumpSurveyFragment"
        android:name="energy.octopus.fieldservices.feature.workorder.parent.view.WorkOrderParentHeatPumpSurveyFragment">

        <action
            android:id="@+id/WorkOrderParentFragment_to_CaptureBarcodeFragment"
            app:destination="@id/CaptureBarcodeFragment"
            app:enterAnim="@anim/octopus_anim_transition_enter"
            app:exitAnim="@anim/octopus_anim_transition_exit"
            app:popEnterAnim="@anim/octopus_anim_transition_pop_enter"
            app:popExitAnim="@anim/octopus_anim_transition_pop_exit" />

        <action
            android:id="@+id/WorkOrderParentFragment_to_CaptureCameraFragment"
            app:destination="@id/CaptureCameraFragment"
            app:enterAnim="@anim/octopus_anim_transition_enter"
            app:exitAnim="@anim/octopus_anim_transition_exit"
            app:popEnterAnim="@anim/octopus_anim_transition_pop_enter"
            app:popExitAnim="@anim/octopus_anim_transition_pop_exit" />
        <action
            android:id="@+id/WorkOrderParentHeatPumpSurveyFragment_to_editRadiatorsMeasurementsFragmentAction"
            app:destination="@id/EditRadiatorsMeasurementsFragment"
            app:enterAnim="@anim/octopus_anim_transition_enter"
            app:exitAnim="@anim/octopus_anim_transition_exit"
            app:popEnterAnim="@anim/octopus_anim_transition_pop_enter"
            app:popExitAnim="@anim/octopus_anim_transition_pop_exit" />

    </fragment>

    <fragment
        android:id="@+id/CaptureBarcodeFragment"
        android:name="energy.octopus.fieldservices.library.camera.view.CaptureBarcodeFragment" />

    <fragment
        android:id="@+id/CaptureCameraFragment"
        android:name="energy.octopus.fieldservices.library.camera.view.CaptureCameraFragment" />
    <fragment
        android:id="@+id/EditRadiatorsMeasurementsFragment"
        android:name="energy.octopus.fieldservices.workorder.heatpump.survey.radiators.measurements.EditRadiatorsMeasurementsFragment">
        <argument
            android:name="roomRadiatorData"
            app:argType="energy.octopus.fieldservices.base.core.view.model.RadiatorData[]" />
    </fragment>


</navigation>
i
Sounds like you need to stop TitleCasing your actions and IDs
👍 1
m
Hmm yeah probably, the codebase was not using safe args yet so there was not an issue before. Interesting edge case