Search code examples
androidvoicegoogle-voice-actions

Voice Actions Activity code not found


I'm working with adding Voice Actions to my app. Documentation tells me to use the method isVoiceInteraction() in an activity however every time I run a build (command line or IDE) I get errors saying the method can't be found. My question is, why?

I decompiled the source of an Activity and saw the method is there when I target API 21.

Here's my default build config:

compileSdkVersion 21
buildToolsVersion '22.0.1'

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 21
    // version name and code set here
}

The method can be found if I change the compile, min, and target SDK version to android-MNC however that isn't what I need.

Why is my build not recognizing the any of the voice methods defined in an Activity (as of Android 5.0+)?

My confusion is that I'm working with a custom voice action. It was approved however I was told (from the Google Voice Actions Team) that I need to have my new APK submitted to the play store by August 7th, 2015. That seems odd because I don't think I can submit an APK targeting the preview SDK.


Solution

  • Voice Interactions is one of the features added in Android M - you'll need to ensure you follow the Preview SDK instructions and compile and target "android-MNC"