这是我的 actions.xml 操作,关于 GET_EXERCISE_OBSERVATION
<action intentName="actions.intent.GET_EXERCISE_OBSERVATION">
<fulfillment urlTemplate="https://www.xelion.com/stats{?exerciseType}">
<parameter-mapping
entityMatchRequired="true"
intentParameter="exerciseObservation.aboutExercise.name"
required="true"
urlParameter="exerciseType" />
</fulfillment>
<parameter name="exerciseObservation.aboutExercise.name">
<entity-set-reference entitySetId="ExerciseEntitySet" />
</parameter>
</action>
这是我的练习实体集:
<entity-set entitySetId="ExerciseEntitySet">
<!-- For each entity you can specify the name, alternate names and the identifier -->
<!-- The identifier is the value that will be added to the action uri. -->
<!-- For our sample we map the supported entities with the class FitActivity.Type -->
<entity
name="running"
identifier="RUNNING" />
<entity
name="walking"
identifier="WALKING" />
<entity
name="cycling"
identifier="CYCLING" />
</entity-set>
如您所见,参数映射严格说 REQUIRED 和 entityMatchRequired="true" 但是当我运行 App Actions 测试工具和“更新预览”时,它说:
13:09 App Actions Test Tool v3.0.0
Preview Creation Error
Status Code: 400
Message: Precondition check failed.
- There is no URL template for action 'actions.intent.GET_EXERCISE_OBSERVATION' with zero required parameters.
我从他们的示例中复制了这个: https ://github.com/actions-on-google/appactions-fitness-kotlin/tree/master/app/src/main/java/com/devrel/android/fitactions
为什么不编译。为什么它不能识别我的参数?