Reputation: 348
I have added the shortcuts.xml in res/xml and also added the
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
in the AndroidManifest.xml and also uploaded the signed bundle file in the play console internal testing.
But I'm getting the below error while creating the preview using the google assistant app actions test tool in android studio
Google Assistant plugin v2.3.0
Preview Creation Error
Status Code: 400
Message: Precondition check failed.
- Please sign in to Play Console (https://play.google.com/apps/publish) and check if you have accepted the latest Terms of Service (ToS), and the Gmail/G-Suite account has the authorization to modify the app with package name 'uninitialized.application.id'.
Upvotes: 2
Views: 1050
Reputation: 511
I found that I had to add the meta-data
tag in multiple places, if your using the standard shortcuts.xml
like this:
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
I had to add this to the first block even though it was also included it in the block that was receiving the intents.
Fuller example:
<application ...>
<activity android:name=".MainActivityOfApp" exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
</intent-filter>
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<activity android:name=".ActivityForReceivingActions" exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
Upvotes: 0
Reputation: 50701
The part of the error message that reads
modify the app with package name 'uninitialized.application.id'
seems particularly strange. There are a few things I would make sure about:
app/build.gradle
has the correct applicationId in the defaultConfig section and that you use this Id elsewhere.app/build.gradle
Upvotes: 1