Skip navigation

Importing and linking the Google Play services library

Importing and linking the Google Play services library: Building Mobile Apps with Google Maps Android API v2
Importing and linking the Google Play services library: Building Mobile Apps with Google Maps Android API v2

Join for an in-depth discussion in this video Importing and linking the Google Play services library, part of Building Mobile Apps with Google Maps Android API v2.

Resume Transcript Auto-Scroll
Skill Level Intermediate
3h 50m
Duration
123,695
Views
Show More Show Less

<div><span style="font-family: 'Times New Roman'; font-size: 12pt;">Q: In the Chapter 2 movie "Checking the device for the Google Play services APK," when I create&nbsp;</span><span style="font-family: 'Times New Roman'; orphans: 2; widows: 2; font-size: 12pt;">my first Google Maps app, the app crashes when I call the custom method servicesOK(). The error in LogCat starts with:</span></div><div>&nbsp;</div><div><span style="font-family: 'Times New Roman'; orphans: 2; widows: 2; font-size: 12pt;">"java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value."</span></div><div>&nbsp;</div><div><span style="font-family: 'Times New Roman'; font-size: 12pt;">How do I fix this?&nbsp;</span></div>

<div><span style="font-family: 'Times New Roman'; font-size: 12pt;">A:&nbsp;</span><span style="font-family: 'Times New Roman'; orphans: 2; widows: 2; font-size: 12pt;">The latest version of the Google Play services library has a new required meta-data tag in the app manifest. Add the following tag within the &lt;application&gt; tag:</span></div><div>&nbsp;</div><div><span style="font-family: 'Times New Roman'; orphans: 2; widows: 2; font-size: 12pt;">&lt;meta-data</span><br style="font-family: Helvetica; orphans: 2; widows: 2;" /><span style="font-family: 'Times New Roman'; orphans: 2; widows: 2; font-size: 12pt;">&nbsp; &nbsp; &nbsp;android:name="com.google.android.gms.version"</span><br style="font-family: Helvetica; orphans: 2; widows: 2;" /><span style="font-family: 'Times New Roman'; orphans: 2; widows: 2; font-size: 12pt;">&nbsp; &nbsp; &nbsp;android:value="@integer/google_play_services_version" /&gt;</span>&nbsp;</div><div><span style="font-family: 'Times New Roman';">&nbsp;</span></div><div><span style="font-family: 'Times New Roman'; orphans: 2; widows: 2; font-size: 12pt;">After rebuilding the app, the error should be resolved.</span>&nbsp;</div>

Skills covered in this course
Developer Mobile Apps Android

Continue Assessment

You started this assessment previously and didn't complete it. You can pick up where you left off, or start over.

Start Your Free Trial Now

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now