IllegalStateException in Android IMA SDK V3b6 with Companion Ads

872 views
Skip to first unread message

Allen Schober

unread,
May 1, 2014, 9:41:19 PM5/1/14
to ima...@googlegroups.com
Hi,

I'm seeing a fatal IllegalStateException thrown by the Android IMA SDK when receiving a VAST ad with two companion display ads.

When the ad is returned without companion display ads, the IMA SDK runs as expected. When the ad is returned with companion display ads, the IMA SDK throws the fatal exception after making the ad request.

The IMA SDK appears to be looking for an old version of Google Play Services. I include the latest Google Play Services library (r16) in my app for needed functionality. Any ideas on the root cause or a workaround?

Stack trace below --

05-01 20:29:42.306: E/AndroidRuntime(22333): FATAL EXCEPTION: AsyncTask #1
05-01 20:29:42.306: E/AndroidRuntime(22333): Process:<removed>, PID: 22333
05-01 20:29:42.306: E/AndroidRuntime(22333): java.lang.RuntimeException: An error occured while executing doInBackground()
05-01 20:29:42.306: E/AndroidRuntime(22333): at android.os.AsyncTask$3.done(AsyncTask.java:300)
05-01 20:29:42.306: E/AndroidRuntime(22333): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
05-01 20:29:42.306: E/AndroidRuntime(22333): at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
05-01 20:29:42.306: E/AndroidRuntime(22333): at java.util.concurrent.FutureTask.run(FutureTask.java:242)
05-01 20:29:42.306: E/AndroidRuntime(22333): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
05-01 20:29:42.306: E/AndroidRuntime(22333): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
05-01 20:29:42.306: E/AndroidRuntime(22333): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
05-01 20:29:42.306: E/AndroidRuntime(22333): at java.lang.Thread.run(Thread.java:841)
05-01 20:29:42.306: E/AndroidRuntime(22333): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 4031500 but found 4323000.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.a.b.b.c.b(Unknown Source)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.a.b.b.c.a(Unknown Source)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.a.b.a.a.a.b(Unknown Source)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.a.b.a.a.a.a(Unknown Source)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.a.a.f.c(IMASDK:88)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.a.a.f.b(IMASDK:129)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.a.a.d.c(IMASDK:242)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.a.a.d.a(IMASDK:182)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.a.a.g.b(IMASDK:300)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.a.a.g.a(IMASDK:159)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.ads.interactivemedia.v3.b.e$a.a(IMASDK:98)
05-01 20:29:42.306: E/AndroidRuntime(22333): at com.google.ads.interactivemedia.v3.b.e$a.doInBackground(IMASDK:76)
05-01 20:29:42.306: E/AndroidRuntime(22333): at android.os.AsyncTask$2.call(AsyncTask.java:288)
05-01 20:29:42.306: E/AndroidRuntime(22333): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
05-01 20:29:42.306: E/AndroidRuntime(22333): ... 4 more

Shawn Busolits (IMA SDK Team)

unread,
May 2, 2014, 11:16:38 AM5/2/14
to ima...@googlegroups.com
Hi Allen,

I'm sorry to hear you're running into this issue. Could you include both of your ad tags (with and without companions) so that we can replicate on our end?

Thanks,
Shawn Busolits
IMA SDK Team

Allen Schober

unread,
May 2, 2014, 12:45:59 PM5/2/14
to ima...@googlegroups.com

Shawn Busolits (IMA SDK Team)

unread,
May 5, 2014, 11:32:20 AM5/5/14
to ima...@googlegroups.com
Hi Allen,

Are you able to replicate this with our sample app? I tested both tags there and they are both working, so it could have something to do with the way your companions are set up in your app.

Thanks,
Shawn Busolits
IMA SDK Team


On Friday, May 2, 2014 12:45:59 PM UTC-4, Allen Schober wrote:
To unsubscribe from this group and all its topics, send an email to ima-sdk+unsubscribe@googlegroups.com.

Kate Kelly

unread,
May 5, 2014, 1:36:28 PM5/5/14
to ima...@googlegroups.com
We're having the same problem – using Android Studio, with 
compile 'com.google.android.gms:play-services:4.+'
under the dependencies block in build.gradle, and using the beta 6 build of the IMA SDK. In AndroidManifest, we have
<meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
We have the same stack trace as well.
Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 4031500 but found 4323000.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

I tried to use this as a workaround:
compile 'com.google.android.gms:play-services:4.0.+'
but that gives the same error – it still expects 4031500 but this time it finds 4030500. It's like the specific version the IMA SDK is targeting is not in the public repos? 

We are seeing this even without companion display ads in the VAST response.

Thanks,
Kate
To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.

Shawn Busolits (IMA SDK Team)

unread,
May 5, 2014, 3:42:44 PM5/5/14
to ima...@googlegroups.com
Hi all,

Just to keep you updated, we are aware of the issue with the sample app and google_play_services_version as of the beta 6 release. We're looking into the issue and will let you know as soon as we have more info.

Thanks,
Shawn Busolits
IMA SDK Team
Message has been deleted

Shawn Busolits (IMA SDK Team)

unread,
May 7, 2014, 1:24:09 PM5/7/14
to ima...@googlegroups.com
Hi all,

Another update here - we think we've found the issue, but it's most likely going to require another release of the SDK to resolve. In the mean time we recommend that you continue to use the beta5 jar to avoid the issue.

Thanks,
Shawn Busolits
IMA SDK Team

Hamady Cisse

unread,
May 8, 2014, 11:19:44 AM5/8/14
to ima...@googlegroups.com
Hi,

I have started using the Google IMA SDK Beta v6 2 days ago and I just ran to the same issue. 
When can I download the v5 of the beta?

Thank you very much!

Shawn Busolits (IMA SDK Team)

unread,
May 8, 2014, 12:23:53 PM5/8/14
to ima...@googlegroups.com
Hi Hamaday,

You can download beta version 5 here.

Thanks,
Shawn Busolits
IMA SDK Team

Hamady Cisse

unread,
May 8, 2014, 1:00:33 PM5/8/14
to ima...@googlegroups.com
Thank you so much Shawn!

Hans van der Gragt

unread,
Jun 1, 2014, 4:17:02 AM6/1/14
to ima...@googlegroups.com
The release notes of beta 7 indicated that the issue should be resolved, for me however the fix does not work.
This is my stacktrace:
Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 4323000 but found 4452000.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
at com.google.ads.interactivemedia.v3.android.gms.common.c.b(Unknown Source)
            at com.google.ads.interactivemedia.v3.android.gms.common.c.a(Unknown Source)
            at com.google.android.gms.a.a.a.b(Unknown Source)
            at com.google.android.gms.a.a.a.a(Unknown Source)
            at com.google.android.a.f.c(IMASDK:88)
            at com.google.android.a.f.b(IMASDK:129)
            at com.google.android.a.d.c(IMASDK:242)
            at com.google.android.a.d.a(IMASDK:182)
            at com.google.android.a.g.b(IMASDK:300)
            at com.google.android.a.g.a(IMASDK:159)
            at com.google.ads.interactivemedia.v3.b.e$a.a(IMASDK:98)
            at com.google.ads.interactivemedia.v3.b.e$a.doInBackground(IMASDK:76)
            at android.os.AsyncTask$2.call(AsyncTask.java:288)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)

Compared to the first stacktrace you can see that I have a newer version of Play Services installed than requested.
If the IMA SDK is dependant on a specific version of Play Services, why not include it in the Play Services package?

The issue can be worked around by using the 4.3.23 version of Play Services.
This should be in added in the documentation.

Is a fix expected where a minimun version of Play Services is required instead of a specific version? 

Best Regards,

Hans

Hamady Cisse

unread,
Jun 2, 2014, 6:11:20 PM6/2/14
to ima...@googlegroups.com
Thank you, the Beta V7 works fine for me, I no longer have that exception.

Hans, have integrated the Google Play Services to your application?

Hans van der Gragt

unread,
Jun 3, 2014, 3:31:13 AM6/3/14
to ima...@googlegroups.com
Hi Hamady,

Yes, I have the Play Services integrated in my application.

I had the latest version: compile 'com.google.android.gms:play-services:4.4.52'
and have now worked around the issue with the previous version:  compile 'com.google.android.gms:play-services:4.3.23'

Best regards,

Hans

Bret McGowen

unread,
Jun 3, 2014, 6:02:41 PM6/3/14
to ima...@googlegroups.com
Hi Hans,

Can you double check that you went through the steps in http://developer.android.com/google/play-services/setup.html -- specifically this line in your manifest file:

Hans van der Gragt

unread,
Jun 4, 2014, 3:09:58 AM6/4/14
to ima...@googlegroups.com
Hi Bret,

Yes, that line is included in my manifest file.
The value of that string is: 4452000. (This is the most recent version of Play Services)
The SDK throws an error saying that I do not have version: 4323000. (Which is an older version).

For now I have worked around the issue by using an older version of Play Services, which is not ideal since we cannot take advantage of the latest additions and bugfixes in Play Services.

When opening the JAR file I see that the specific Play Services version is requested:
if ((m = localBundle.getInt("com.google.android.gms.version")) != 4323000)
        throw new IllegalStateException("The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 4323000 but found " + m + ".  You must have the following declaration within the <application> element:     <meta-data android:name=\"com.google.android.gms.version\" android:value=\"@integer/google_play_services_version\" />");


Best regards,

Hans

Bret McGowen

unread,
Jun 9, 2014, 5:36:32 PM6/9/14
to ima...@googlegroups.com
Hi Hans,

Where are you seeing that play services version code? (which JAR and which file?)

Thanks,
Bret McGowen
IMA SDK Team

Hans van der Gragt

unread,
Jun 10, 2014, 3:18:41 AM6/10/14
to ima...@googlegroups.com
Hi Bret,

I see this in the ima sdk beta 7 jar in the class file: com.google.ads.interactivemedia.v3.android.gms.common.c

Best regards,

Hans

Bret McGowen

unread,
Jun 12, 2014, 12:51:38 PM6/12/14
to ima...@googlegroups.com
Hi Hans,

This is a bug with the current version of the SDK as we made it dependent on a specific version. We're working on a fix now so you won't have to use an older version of play services or spoof the version. I'll let you know when we get the fix out.

Thanks for letting us know,

Bret McGowen

unread,
Jun 30, 2014, 4:47:28 PM6/30/14
to ima...@googlegroups.com
Hi Hans,

Quick update-- we released beta 8 of the IMA Android SDK which resolves the SDK version issue you were having. You can get it from our SDK downloads page.

Cheers,
Reply all
Reply to author
Forward
0 new messages