Reputation: 21
I have an application that uses google maps. Previously, it was working fine, but last night I was updating some things in the sdk manager and doing so caused my map activity to crash my app. After multiple tries at fixing it, I updated to the newest version of eclipse, redownloaded the google play services, and generated a new API key. However, my app is still crashing when running it on my android device and I can't figure out why. Please please help. Below is my manifest file (which I updated with my new API key), along with the log that contains the errors. Any help at all would much appreciated. Thanks. Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.workoutprofile"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="5"
android:targetSdkVersion="17" />
<permission
android:name="com.example.workoutprofile.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.workoutprofile.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBp5Var-gdHHN2d6ENeHMW2kPSlGjLywFU"/>
<activity
android:name="com.example.workoutprofile.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="Map"></activity>
<activity android:name="Record"></activity>
<activity android:name="Setup"></activity>
<activity android:name="Bluetooth"></activity>
<activity android:name="Chart"></activity>
<activity android:name="History"></activity>
<activity android:name="org.achartengine.GraphicalActivity"></activity>
<activity android:name="Test"></activity>
<activity android:name="MapTest"></activity>
</application>
</manifest>
LogCat:
11-06 20:35:57.708: D/dalvikvm(12454): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp
11-06 20:35:57.708: W/dalvikvm(12454): VFY: unable to resolve instance field 32
11-06 20:35:57.708: D/dalvikvm(12454): VFY: replacing opcode 0x52 at 0x0012
11-06 20:35:57.708: D/dalvikvm(12454): VFY: dead code 0x0014-0018 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b (Landroid/content/res/Resources;)Z
11-06 20:35:57.715: D/AndroidRuntime(12454): Shutting down VM
11-06 20:35:57.715: W/dalvikvm(12454): threadid=1: thread exiting with uncaught exception (group=0x4001e560)
11-06 20:35:57.723: E/AndroidRuntime(12454): FATAL EXCEPTION: main
11-06 20:35:57.723: E/AndroidRuntime(12454): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.workoutprofile/com.example.workoutprofile.Map}: android.view.InflateException: Binary XML file line #19: Error inflating class fragment
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1702)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1722)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.app.ActivityThread.access$1500(ActivityThread.java:124)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:974)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.os.Handler.dispatchMessage(Handler.java:99)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.os.Looper.loop(Looper.java:130)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.app.ActivityThread.main(ActivityThread.java:3821)
11-06 20:35:57.723: E/AndroidRuntime(12454): at java.lang.reflect.Method.invokeNative(Native Method)
11-06 20:35:57.723: E/AndroidRuntime(12454): at java.lang.reflect.Method.invoke(Method.java:507)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-06 20:35:57.723: E/AndroidRuntime(12454): at dalvik.system.NativeStart.main(Native Method)
11-06 20:35:57.723: E/AndroidRuntime(12454): Caused by: android.view.InflateException: Binary XML file line #19: Error inflating class fragment
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:587)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:253)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.app.Activity.setContentView(Activity.java:1716)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.example.workoutprofile.Map.onCreate(Map.java:64)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1666)
11-06 20:35:57.723: E/AndroidRuntime(12454): ... 11 more
11-06 20:35:57.723: E/AndroidRuntime(12454): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4030500 but found 0. 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" />
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.google.android.gms.maps.internal.q.v(Unknown Source)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.google.android.gms.maps.internal.q.u(Unknown Source)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.google.android.gms.maps.SupportMapFragment$b.cE(Unknown Source)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.google.android.gms.dynamic.a.a(Unknown Source)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
11-06 20:35:57.723: E/AndroidRuntime(12454): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
11-06 20:35:57.723: E/AndroidRuntime(12454): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
11-06 20:35:57.723: E/AndroidRuntime(12454): ... 20 more
Map Layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<TextView
android:id="@+id/mapHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="MAP"
android:textAppearance="?android:attr/textAppearanceLarge" />
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="480dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<Button
android:id="@+id/buttonRouteStart"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/buttonScreenshot"
android:layout_alignBottom="@+id/buttonScreenshot"
android:layout_alignRight="@+id/map"
android:text="Route" />
<Button
android:id="@+id/buttonScreenshot"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_below="@+id/mapHeader"
android:layout_alignLeft="@+id/map"
android:text="Save" />
</RelativeLayout>
Upvotes: 1
Views: 5140
Reputation: 3530
The api key that you have provided is wrong. The key doesn't contain "-". Go to cloud console . Select android in Platform. Select Accessing "APIs directly from Android" provide package name and SHA1 fingerprint.Copy paste the generated API Key. Also make sure "Google Maps Android API v2" under API and auth is turned on.
Edit : Google have updated the library hence the problem. The solution to your problem can be found here
Upvotes: 3