Wednesday, April 10, 2013

[android help] Android Maps V2 Crashing


My big project for today was migrating my app to the new Google Maps API V2. However, I am hitting an error now that I can't seem to find the root cause of.


My stack trace looks like this:



12-17 17:16:20.366: E/AndroidRuntime(3634): FATAL EXCEPTION: main
12-17 17:16:20.366: E/AndroidRuntime(3634): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mobile.barwatch/com.mobile.barwatch.TestActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2088)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2113)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread.access$700(ActivityThread.java:139)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1224)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.os.Handler.dispatchMessage(Handler.java:99)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.os.Looper.loop(Looper.java:137)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread.main(ActivityThread.java:4918)
12-17 17:16:20.366: E/AndroidRuntime(3634): at java.lang.reflect.Method.invokeNative(Native Method)
12-17 17:16:20.366: E/AndroidRuntime(3634): at java.lang.reflect.Method.invoke(Method.java:511)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
12-17 17:16:20.366: E/AndroidRuntime(3634): at dalvik.system.NativeStart.main(Native Method)
12-17 17:16:20.366: E/AndroidRuntime(3634): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:306)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.Activity.setContentView(Activity.java:1901)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.mobile.barwatch.TestActivity.onCreate(TestActivity.java:18)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.Activity.performCreate(Activity.java:5048)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2052)
12-17 17:16:20.366: E/AndroidRuntime(3634): ... 11 more
12-17 17:16:20.366: E/AndroidRuntime(3634): Caused by: java.lang.RuntimeException: API key not found. Check that is in the element of AndroidManifest.xml
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.z.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.z.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.z.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.ae.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.bu.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.p.onCreateView(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.maps.internal.IMapFragmentDelegate$Stub.onTransact(IMapFragmentDelegate.java:107)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.os.Binder.transact(Binder.java:326)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.maps.internal.IMapFragmentDelegate$a$a.onCreateView(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.maps.MapFragment$b.onCreateView(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.internal.d$4.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.internal.d.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.internal.d.onCreateView(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.maps.MapFragment.onCreateView(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:807)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1013)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1112)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.Activity.onCreateView(Activity.java:4704)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
12-17 17:16:20.366: E/AndroidRuntime(3634): ... 20 more


My activity class looks like this:



package com.mobile.barwatch;

import android.app.Activity;
import android.os.Bundle;
import com.google.android.gcm.GCMRegistrar;
import com.google.android.gms.common.*;
import com.mobile.barwatch.tasks.*;
import com.mobile.barwatch.models.Constants;

public class TestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map_screen);
}
}


My layout file looks like this:




android:id="@+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment"/>


And the relevant parts of my manifest look like this:



package="com.mobile.barwatch"
android:versionCode="1"
android:versionName="1.0" >

android:minSdkVersion="11"
android:targetSdkVersion="15" />
android:glEsVersion="0x00020000"
android:required="true"/>
android:protectionLevel="signature"/>
android:protectionLevel="signature" />











android:allowBackup="true"
android:icon="@drawable/ic_launcher_barwatch"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
....
android:label="@string/app_name">

android:value="xx"/>




Im really banging my head against the wall on this one so any help would be greatly appreciated.



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...