appactions-fitness-kotlin icon indicating copy to clipboard operation
appactions-fitness-kotlin copied to clipboard

Action not work via Assistant

Open nimish17 opened this issue 6 years ago • 53 comments

action is running in the device via App Actions Test Tool but not working via voice or written commands in the Assistant.

below all steps are perfect in my case The plugin loaded the actions preview at least one time. The account in the device is the same as the one in Android Studio. The device has access to an internet connection. You are using the latest version of the Assistant or Google app.

nimish17 avatar Jul 01 '19 12:07 nimish17

I have a similar issue when I click run on App Actions Test Tool, I get Sorry, I couldn't find that from the assistant

donkii avatar Jul 02 '19 12:07 donkii

@nimish17 same here.

NoluckJustSkills avatar Jul 03 '19 07:07 NoluckJustSkills

Could you share which action are you trying and your actions xml file?

marcelpinto avatar Jul 04 '19 10:07 marcelpinto

<!-- This file describes the supported actions by this app -->

<action intentName="actions.intent.START_EXERCISE">

    <!-- Each action requires at least one fulfillment that defines how the app will handle this action -->
    <!-- Define the urlTemplate in the format you define your deeplinks in AndroidManifest.xml -->

    <fulfillment urlTemplate="https://fit-actions.firebaseapp.com/start{?exerciseType}">

        <!-- Define how the actions parameters (intentParameter) is mapped in the urlTemplate above -->

        <parameter-mapping
            intentParameter="exercise.name"
            urlParameter="exerciseType" />

    </fulfillment>

    <!-- We can define our custom inline inventory, mapping a parameter to an entity set reference -->

    <parameter name="exercise.name">
        <entity-set-reference entitySetId="ExerciseEntitySet" />
    </parameter>

</action>

<action intentName="actions.intent.STOP_EXERCISE">
    <fulfillment urlTemplate="https://fit-actions.firebaseapp.com/stop" />
</action>

<action intentName="actions.intent.GET_EXERCISE_OBSERVATION">

    <!-- You can define the fulfillment mode, it can be SLICE or DEEPLINK -->
    <!-- When slice is used, make sure you are supporting slices in your app -->
    <!-- Also, not that the urlTemplate must be of the style content://{slice_provider_authority}/... -->

    <fulfillment
        fulfillmentMode="actions.fulfillment.SLICE"
        urlTemplate="content://com.devrel.android.fitactions.FitSliceProvider/stats{?exerciseType}">

        <!-- If a parameter is set as required, the action will only be fulfilled if the parameter is found -->
        <!-- That's why a fallback urlTemplate needs to be provided for such case. -->

        <parameter-mapping
            entityMatchRequired="true"
            intentParameter="exerciseObservation.aboutExercise.name"
            required="true"
            urlParameter="exerciseType" />

        <!-- Note, that for the parameter above we are setting entityMatchRequired="true" -->
        <!-- This tells the Assistant to only use the entity set values to map this parameter -->
        <!-- Meaning that even if the assistant know how to identify the exercise (i.e "Climbing") -->
        <!-- if it's not defined in our entity set, the parameter won't be use. -->

    </fulfillment>

    <!-- In case the exercise name is not found we fallback to the stats deep-link inside the app -->

    <fulfillment
        fulfillmentMode="actions.fulfillment.DEEPLINK"
        urlTemplate="https://fit-actions.firebaseapp.com/stats" />

    <!-- Same as the first action, we map the parameter name with out supported entity set. -->

    <parameter name="exerciseObservation.aboutExercise.name">
        <entity-set-reference entitySetId="ExerciseEntitySet" />
    </parameter>

</action>

<!-- Defines an entity set with our supported entities -->

<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="@string/activity_running"
        alternateName="@array/runningSynonyms"
        identifier="RUNNING" />
    <entity
        name="@string/activity_walking"
        alternateName="@array/walkingSynonyms"
        identifier="WALKING" />
    <entity
        name="@string/activity_cycling"
        alternateName="@array/cyclingSynonyms"
        identifier="CYCLING" />
</entity-set>

nimish17 avatar Jul 04 '19 10:07 nimish17

I too have faced same issue in nexus 5 mobile but it is working in oneplus mobile. anyways issue in some mobiles.

AnilKolla avatar Jul 26 '19 13:07 AnilKolla

Sorry for the delayed answer. Did you manage to make it run?

If not make sure:

  • All the above you mentioned is correct and you can run the aciton via plugin
  • When uploading the preview check the name you are using to upload, this is the one that you have to say
  • Try this sentence "Start running in Fit Actions"
  • Try modifying the acitons.xml and remove the in-line inventory (aka entity-set)

marcelpinto avatar Aug 29 '19 04:08 marcelpinto

@skimarxall Same issue I am also facing if anyone has fixed please reply to the same thread. Steps:

Uploaded the APK to play store internal test track in draft mode Logged in with same account to (Device, PlayConsole and Android Studio) Changed the packageId to the app which I have uploaded to playstore Running App Actions Test Tool -> Preview uploaded successfully Run -> Opens Assistant in device with message 'Sorry, Couldn't find that' Let me know if I have missed any step. Thank you

harshfast avatar Sep 14 '19 09:09 harshfast

@harshfast are you using the account that you use to publish the apk in the device? Open google search, and make sure the account selected there is the same.

Also, can you tell us which Google app version are you using?

marcelpinto avatar Sep 16 '19 02:09 marcelpinto

@skimarxall Thanks for quick response Now I am able to see the Android Slices and App Actions via google assistant. It started working I just checked all me configuration and everything looks good.

Steps I performed: Checked all my logins (Test Device, Play Console and Android Studio) Freshly installed the application with the package name which was uploaded to playstore. Deleted actions preview and uploaded again from AATT.(App Actions Test Tool) Run the command it started launching the app via google assistant and showing the slice from app inside google assistant window.

Just a quick query how can i trigger the voice commands for the same instead of adb command generated by AATT?

Thank you again for your help.

harshfast avatar Sep 16 '19 07:09 harshfast

Just a quick query how can i trigger the voice commands for the same instead of adb command generated by AATT?

Go here: https://developers.google.com/actions/reference/built-in-intents/

Find your the Assistant Intent you want to test, and look under "example queries" that you can use to try (you should be able to trigger via voice or by manually typing into Google Assistant using the keyboard).

Note that actions.intent.OPEN_APP_FEATURE doesn't currently have any samples right now and is broken outside of the Test Tool (https://issuetracker.google.com/issues/135714718).

adamkoch avatar Sep 16 '19 07:09 adamkoch

@adamkoch I am using actions.intent.GET_TAXI_RESERVATION

Voice Command: "Call my driver with "

Google assistant shows generic search results rather showing my app slice. Also it has mentioned here "The App Actions feature is currently in developer preview. You can build and test App Actions (en-US locale only), but user triggering from the Assistant is not available yet. "

is it possible to trigger voice command or for now adb command will work?

harshfast avatar Sep 16 '19 07:09 harshfast

As per the Built-in intents page, GET_TAXI_RESERVATION should trigger with a test voice query of "Call my driver with [app name]". If it's not working, make sure (once again) that you are logged in with the right Google account that has the preview published via the Test Tool and that you have the right APK installed.

And yes, you should switch to en-US locale on your device and in Assistant settings for now to test as it won't trigger in other locales.

If it's still not working, you can file an issue here.

You may also want to try the fitness actions via voice query first (using the sample app) because those definitely work fine.

adamkoch avatar Sep 16 '19 22:09 adamkoch

@adamkoch I have few queries before proceeding with the actual implementation, your help will be appreciated

  • Can we create our own built-in-intent as I am not able to find the matching BII in current list. If yes, please let me know the procedure and the time it will take to be available for POC.
  • Will this newly created intent will be exclusive to my application?
  • Will google assistant display multiple slices if more than one app is able to fulfill the user query or multiple apps has the same intents?

Thank you.

harshfast avatar Sep 17 '19 11:09 harshfast

Can we create our own built-in-intent as I am not able to find the matching BII in current list. If yes, please let me know the procedure and the time it will take to be available for POC.

No, you can't. You can request additional intents here: https://issuetracker.google.com/issues/new?component=617864&template=1261453

Will google assistant display multiple slices if more than one app is able to fulfill the user query or multiple apps has the same intents?

Right now, the user specifies the app name in their query, so only one app will ever be able to respond to the query (Slices or otherwise).

adamkoch avatar Sep 17 '19 22:09 adamkoch

Thank you @adamkoch for your quick response. It gives us direction to build the app experience accordingly.

harshfast avatar Sep 18 '19 09:09 harshfast

As per the Built-in intents page, GET_TAXI_RESERVATION should trigger with a test voice query of "Call my driver with [app name]". If it's not working, make sure (once again) that you are logged in with the right Google account that has the preview published via the Test Tool and that you have the right APK installed.

And yes, you should switch to en-US locale on your device and in Assistant settings for now to test as it won't trigger in other locales.

If it's still not working, you can file an issue here.

You may also want to try the fitness actions via voice query first (using the sample app) because those definitely work fine.

I tried triggering voice queries for FitActions sample as suggested in above answer but it didn't work. I have raised below issue with screenshots for your reference. https://issuetracker.google.com/issues/141225979

harshfast avatar Sep 18 '19 15:09 harshfast

Is there any specific region that you need to choose in Google Assistant? Like only en-US is supported, or en-IN is also supported?

vpulpatil avatar Sep 25 '19 07:09 vpulpatil

Right now, App Actions is targeting only en-US.

adamkoch avatar Sep 29 '19 08:09 adamkoch

Is there any specific region that you need to choose in Google Assistant? Like only en-US is supported, or en-IN is also supported?

@vpulpatil The App Actions feature is currently in developer preview. You can build and test App Actions (en-US locale only), but user triggering from the Assistant is not available yet. Refer Here

harshfast avatar Oct 02 '19 09:10 harshfast

action is running in the device via App Actions Test Tool but not working via voice or written commands in the Assistant.

below all steps are perfect in my case The plugin loaded the actions preview at least one time. The account in the device is the same as the one in Android Studio. The device has access to an internet connection. You are using the latest version of the Assistant or Google app.

Even I'm having the same issue. The action is getting triggered from the App Actions Test Tool but when I say "Start Running in Fit Actions" it just sends me some responses from Google. If you were able to make it work, kindly post the steps

Grandolf49 avatar Oct 31 '19 14:10 Grandolf49

Also make sure you have fully set up Google Assistant. Open Google Assistant and ensure you don't see anything indicating you need to finish setting it up. Usually this looks like a blue bar at the bottom of the screen but it may look different in some cases.

Screen Shot 2019-11-01 at 10 22 16 AM

adamkoch avatar Oct 31 '19 23:10 adamkoch

Also make sure you have fully set up Google Assistant. Open Google Assistant and ensure you don't see anything indicating you need to finish setting it up. Usually this looks like a blue bar at the bottom of the screen but it may look different in some cases.

Screen Shot 2019-11-01 at 10 22 16 AM

Yes I checked this as well. I think Google Assistant is not being able to match the query "Start running in Fit Actions" with the START_EXERCISE intent.

Grandolf49 avatar Nov 01 '19 09:11 Grandolf49

Also make sure the invocation name (that is shown in the Studio Plugin) matches the query you are using ("Fit Actions" in your query). You can update the invocation name if needed by deleting the preview and then before creating it again there will be a field to set it.

adamkoch avatar Nov 01 '19 11:11 adamkoch

Also make sure the invocation name (that is shown in the Studio Plugin) matches the query you are using ("Fit Actions" in your query). You can update the invocation name if needed by deleting the preview and then before creating it again there will be a field to set it.

I tried deleting the preview and create it. Gave the name "Fit Actions". It works like a charm from the tool but it doesn't work for the same voice command.

Is there any other way to trigger the built-in intent actions.intent.START_EXERCISE?

Grandolf49 avatar Nov 01 '19 16:11 Grandolf49

Also make sure the invocation name (that is shown in the Studio Plugin) matches the query you are using ("Fit Actions" in your query). You can update the invocation name if needed by deleting the preview and then before creating it again there will be a field to set it.

It's working now!

  1. I deleted the preview and named it "Fit Actions"
  2. Tested with App Actions Tool - working perfectly
  3. Gave this voice command - "Start running in Fit Actions" Working perfectly now! Thanks @adamkoch for the help. Very much appreciated!

Grandolf49 avatar Nov 01 '19 16:11 Grandolf49

No luck for me as of yet! Followed all steps here. I deleted the preview and named it "Fit Actions", logged into to everything with the relevant account. checked to see if I could execute Deeplink with adb (I can). just can't get it running with the actions tool nor with assistant invocation

NNirosan02 avatar Nov 04 '19 12:11 NNirosan02

No luck for me as of yet! Followed all steps here. I deleted the preview and named it "Fit Actions", logged into to everything with the relevant account. checked to see if I could execute Deeplink with adb (I can). just can't get it running with the actions tool nor with assistant invocation

Are you getting any errors while testing on App Actions Test Tool? Because all the steps that you mentioned should enable you to test it successfully with at least App Actions Test Tool.

Grandolf49 avatar Nov 04 '19 15:11 Grandolf49

Nope. Just says "Sorry couldn't find that"

On Mon, 4 Nov 2019, 15:25 Chinmay Kulkarni, [email protected] wrote:

No luck for me as of yet! Followed all steps here. I deleted the preview and named it "Fit Actions", logged into to everything with the relevant account. checked to see if I could execute Deeplink with adb (I can). just can't get it running with the actions tool nor with assistant invocation

Are you getting any errors while testing on App Actions Test Tool? Because all the steps that you mentioned should enable you to test it successfully with at least App Actions Test Tool.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/actions-on-google/appactions-fitness-kotlin/issues/8?email_source=notifications&email_token=ACNBF2KT776Q6GS5BCWDVT3QSA5EZA5CNFSM4H4RXGGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC7UBMA#issuecomment-549404848, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNBF2ILU5V6UMO2DC4KLYLQSA5EZANCNFSM4H4RXGGA .

NNirosan02 avatar Nov 04 '19 23:11 NNirosan02

@SoftwareMate02 Please try to verify below steps:

  • Change the device and Google Assistant language as en-US.
  • Check your login to all the three places: Android Studio, Playstore and Test Device.
  • Check the package name and version code of the application at playstore and test application.
  • Review your AndroidManifest and actions.xml.
  • Remove and install fresh application to device.
  • Delete the preview from AATT and create the fresh preview again.
  • Sometimes Assistant always triggers "Sorry couldn't find that". It worked for me after multiple tries.
  • If possible grab the stock android device(Pixel) and try with that.(This is optional it should work in every device)
  • Check the logcat without and filter and capture the logs if it shows any failure regarding actions fulfillment.

@Grandolf49 Still I haven't verified with voice command but it is working with AATT for both Actions and Slices. Also have you verified with voice command using inline inventory words?

harshfast avatar Nov 05 '19 04:11 harshfast

@Grandolf49 glad you got it working!

@SoftwareMate02 good advice from @harshfast, also make sure it all triggers fine using the Studio Test Tool plugin first, once that is working (but it's not triggering directly from Assistant) double check your Google accounts are matching up, that Assistant is fully setup (as per my comment above) and that you are using the right invocation name.

adamkoch avatar Nov 06 '19 03:11 adamkoch