Aviary SDK update in Android

1.4k Views Asked by At

So we've been using Aviary SDK in our project for a long time, and no problems occured. But when we updated the Aviary version to latest, some strange behavior was revealed - when u first install application with new version of Aviary bundled on a device, which has version of app with older Aviary version, app crashes with exception -

FATAL EXCEPTION: IntentService[AviaryCdsService]
java.lang.IllegalStateException: Missing required api key secret

second run of installed app work as expected, and all functions are working properly. If device doesn't have previously installed app, no crash occured and installation runs fine. This behavior revealed when migrating from com.aviary.android.feather.sdk:aviary-sdk:3.4.3.351 to com.aviary.android.feather.sdk:aviary-sdk:3.6.3

Does anyone else had such problem, and is there any way to avoid this crash?

4

There are 4 best solutions below

0
On

I was experiencing the same exception, but it may have been because I was calling AviaryIntent.createCdsInitIntent inside an activity. Once I moved the call to AviaryIntent.createCdsInitIntent to the Application this exception went away.

0
On

Create application class and put below code in onCreate() methide

Intent cdsIntent = AviaryIntent.createCdsInitIntent(getBaseContext(), API_SECRET, null); startService( cdsIntent );

2
On

The answer is in the documentation.

4.1. Assets Folder Create a folder called "aviary" inside the assets folder of your application. Inside, create a file called "aviary.txt" - on the first line of this file put your API-secret and on the second line put your Google Play billing public API key. This file is not entirely necessary but you will receive a warning if you exclude it. We do this to optimize content downloads when your app is not active. Check the assets folder of the sample application for a template on how to do this.

1
On

What if you don't have a Google Play billing public API key for the app?