9

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?

VanKhulup
  • 146
  • 7
  • 2
    If anyone get the same problem, our team figured out workaround for this - we add these lines of code in onCreate() method of our Application class: Intent cdsIntent = AviaryIntent.createCdsInitIntent(getBaseContext(), API_SECRET, null); startService( cdsIntent ); – VanKhulup Dec 23 '14 at 13:13

4 Answers4

2

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

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

0

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.

Josh Kovach
  • 7,679
  • 3
  • 45
  • 62
Wyatt Wong
  • 19
  • 5
0

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.

Josh Kovach
  • 7,679
  • 3
  • 45
  • 62
0

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

Milk Run
  • 17
  • 8
  • You should be able to just pass an empty string instead of the Google Play billing key. That's how it works in the Creative SDK Image Editor. – Ash Ryan Arnwine Nov 16 '15 at 15:36