我使用 Android 导航组件创建了一个全局操作,编译代码时出现以下错误
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
app:startDestination="@id/homeEnumerationFragment">
<fragment
android:id="@+id/homeEnumerationFragment"
android:name="org.southasia.ghru.ui.homeenumeration.HomeEnumerationFragment"
android:label="HomeEnumerationFragment"
tools:layout="@layout/home_enumeration_fragment"></fragment>
<fragment
android:id="@+id/stationFragments"
android:name="org.southasia.ghru.ui.station.StationFragment"
android:label="StationFragment"
tools:layout="@layout/station_fragment"/>
<fragment
android:id="@+id/devicesFragment"
android:name="org.southasia.ghru.ui.devices.DevicesFragment"
android:label="DevicesFragment"
tools:layout="@layout/devices_fragment"/>
<action android:id="@+id/action_global_stationFragments3" app:destination="@+id/stationFragments"/>
错误:
Error: Destination with arguments or actions must have 'name' or 'id' attributes.