2012-12-21 4 views
4

Google API를 사용하는 Android 앱에서 Google지도를 사용하려고합니다. 내 HTC 욕망 전화에서 응용 프로그램을했지만, 충돌에 계속됩니다. 필자는 Project Build Target을 Android 2.2 및 Android 4.2로 변경하려고 시도했지만 여전히 운이 없다. 내 프로젝트에 android-support-v4.jar도 추가했습니다.Google API V2를 사용할 때 앱이 계속 충돌합니다.

googleMaps.manifest

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.luiz.googleMaps" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <permission 
     android:name="com.luiz.googleMaps.permission.MAPS_RECEIVE" 
     android:protectionLevel="signature" /> 

    <uses-permission android:name="com.luiz.googleMaps.permission.MAPS_RECEIVE" /> 

    <uses-sdk 
     android:minSdkVersion="8" 
     android:targetSdkVersion="8" /> 

    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> 
    <!-- External storage for caching. --> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <!-- My Location --> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
    <!-- Maps API needs OpenGL ES 2.0. --> 
    <uses-feature 
     android:glEsVersion="0x00020000" 
     android:required="true" /> 

    <application 
     android:allowBackup="true" 
     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="I have used my keys;com.luiz.googleMaps" /> 

     <activity 
      android:name="com.luiz.googleMaps.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> 
    </application> 

</manifest> 

activity_main.xml

<?xml version="1.0" encoding="utf-8"?> 
<fragment xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/map" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    class="com.google.android.gms.maps.SuppportMapFragment"/> 
을 : 나는이 여기 Link

하는 내 코드를 따라 시도

MainActivity

package com.luiz.googleMaps; 

import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.SupportMapFragment; 

import android.os.Bundle; 

public class MainActivity extends android.support.v4.app.FragmentActivity { 

    private GoogleMap map; 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 

     map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); 
    } 
} 

로그 캣 오류 :

12-21 06:08:30.734: D/dalvikvm(7102): GC_EXTERNAL_ALLOC freed 54K, 50% free 2692K/5379K, external 0K/0K, paused 93ms 
12-21 06:08:30.754: E/ActivityThread(7102): Failed to inflate 
12-21 06:08:30.754: E/ActivityThread(7102): android.view.InflateException: Binary XML file line #2: Error inflating class fragment 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:587) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.view.LayoutInflater.inflate(LayoutInflater.java:386) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 
12-21 06:08:30.754: E/ActivityThread(7102):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:213) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.app.Activity.setContentView(Activity.java:1657) 
12-21 06:08:30.754: E/ActivityThread(7102):  at com.luiz.googleMaps.MainActivity.onCreate(MainActivity.java:31) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.app.ActivityThread.access$1500(ActivityThread.java:123) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.os.Handler.dispatchMessage(Handler.java:99) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.os.Looper.loop(Looper.java:130) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.app.ActivityThread.main(ActivityThread.java:3835) 
12-21 06:08:30.754: E/ActivityThread(7102):  at java.lang.reflect.Method.invokeNative(Native Method) 
12-21 06:08:30.754: E/ActivityThread(7102):  at java.lang.reflect.Method.invoke(Method.java:507) 
12-21 06:08:30.754: E/ActivityThread(7102):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) 
12-21 06:08:30.754: E/ActivityThread(7102):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) 
12-21 06:08:30.754: E/ActivityThread(7102):  at dalvik.system.NativeStart.main(Native Method) 
12-21 06:08:30.754: E/ActivityThread(7102): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SuppportMapFragment: make sure class name exists, is public, and has an empty constructor that is public 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.support.v4.app.Fragment.instantiate(Fragment.java:401) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.support.v4.app.Fragment.instantiate(Fragment.java:369) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 
12-21 06:08:30.754: E/ActivityThread(7102):  ... 19 more 
12-21 06:08:30.754: E/ActivityThread(7102): Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.SuppportMapFragment in loader dalvik.system.PathClassLoader[/data/app/com.luiz.googleMaps-2.apk] 
12-21 06:08:30.754: E/ActivityThread(7102):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 
12-21 06:08:30.754: E/ActivityThread(7102):  at java.lang.ClassLoader.loadClass(ClassLoader.java:551) 
12-21 06:08:30.754: E/ActivityThread(7102):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 
12-21 06:08:30.754: E/ActivityThread(7102):  at android.support.v4.app.Fragment.instantiate(Fragment.java:391) 
12-21 06:08:30.754: E/ActivityThread(7102):  ... 22 more 
12-21 06:08:30.764: D/AndroidRuntime(7102): Shutting down VM 
12-21 06:08:30.764: W/dalvikvm(7102): threadid=1: thread exiting with uncaught exception (group=0x40128560) 
12-21 06:08:30.764: E/AndroidRuntime(7102): FATAL EXCEPTION: main 
12-21 06:08:30.764: E/AndroidRuntime(7102): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.luiz.googleMaps/com.luiz.googleMaps.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1768) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.app.ActivityThread.access$1500(ActivityThread.java:123) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.os.Handler.dispatchMessage(Handler.java:99) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.os.Looper.loop(Looper.java:130) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.app.ActivityThread.main(ActivityThread.java:3835) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at java.lang.reflect.Method.invokeNative(Native Method) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at java.lang.reflect.Method.invoke(Method.java:507) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at dalvik.system.NativeStart.main(Native Method) 
12-21 06:08:30.764: E/AndroidRuntime(7102): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:587) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.view.LayoutInflater.inflate(LayoutInflater.java:386) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:213) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.app.Activity.setContentView(Activity.java:1657) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at com.luiz.googleMaps.MainActivity.onCreate(MainActivity.java:31) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  ... 11 more 
12-21 06:08:30.764: E/AndroidRuntime(7102): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SuppportMapFragment: make sure class name exists, is public, and has an empty constructor that is public 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.support.v4.app.Fragment.instantiate(Fragment.java:401) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.support.v4.app.Fragment.instantiate(Fragment.java:369) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  ... 19 more 
12-21 06:08:30.764: E/AndroidRuntime(7102): Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.SuppportMapFragment in loader dalvik.system.PathClassLoader[/data/app/com.luiz.googleMaps-2.apk] 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at java.lang.ClassLoader.loadClass(ClassLoader.java:551) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  at android.support.v4.app.Fragment.instantiate(Fragment.java:391) 
12-21 06:08:30.764: E/AndroidRuntime(7102):  ... 22 more 
12-21 06:08:36.299: I/Process(7102): Sending signal. PID: 7102 SIG: 9 
12-21 06:18:46.745: D/dalvikvm(7174): GC_EXTERNAL_ALLOC freed 55K, 50% free 2691K/5379K, external 0K/0K, paused 45ms 
12-21 06:18:46.765: E/ActivityThread(7174): Failed to inflate 
12-21 06:18:46.765: E/ActivityThread(7174): android.view.InflateException: Binary XML file line #2: Error inflating class fragment 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:587) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.view.LayoutInflater.inflate(LayoutInflater.java:386) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 
12-21 06:18:46.765: E/ActivityThread(7174):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:213) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.app.Activity.setContentView(Activity.java:1657) 
12-21 06:18:46.765: E/ActivityThread(7174):  at com.luiz.googleMaps.MainActivity.onCreate(MainActivity.java:15) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.app.ActivityThread.access$1500(ActivityThread.java:123) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.os.Handler.dispatchMessage(Handler.java:99) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.os.Looper.loop(Looper.java:130) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.app.ActivityThread.main(ActivityThread.java:3835) 
12-21 06:18:46.765: E/ActivityThread(7174):  at java.lang.reflect.Method.invokeNative(Native Method) 
12-21 06:18:46.765: E/ActivityThread(7174):  at java.lang.reflect.Method.invoke(Method.java:507) 
12-21 06:18:46.765: E/ActivityThread(7174):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) 
12-21 06:18:46.765: E/ActivityThread(7174):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) 
12-21 06:18:46.765: E/ActivityThread(7174):  at dalvik.system.NativeStart.main(Native Method) 
12-21 06:18:46.765: E/ActivityThread(7174): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SuppportMapFragment: make sure class name exists, is public, and has an empty constructor that is public 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.support.v4.app.Fragment.instantiate(Fragment.java:401) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.support.v4.app.Fragment.instantiate(Fragment.java:369) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 
12-21 06:18:46.765: E/ActivityThread(7174):  ... 19 more 
12-21 06:18:46.765: E/ActivityThread(7174): Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.SuppportMapFragment in loader dalvik.system.PathClassLoader[/data/app/com.luiz.googleMaps-1.apk] 
12-21 06:18:46.765: E/ActivityThread(7174):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 
12-21 06:18:46.765: E/ActivityThread(7174):  at java.lang.ClassLoader.loadClass(ClassLoader.java:551) 
12-21 06:18:46.765: E/ActivityThread(7174):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 
12-21 06:18:46.765: E/ActivityThread(7174):  at android.support.v4.app.Fragment.instantiate(Fragment.java:391) 
12-21 06:18:46.765: E/ActivityThread(7174):  ... 22 more 
12-21 06:18:46.775: D/AndroidRuntime(7174): Shutting down VM 
12-21 06:18:46.775: W/dalvikvm(7174): threadid=1: thread exiting with uncaught exception (group=0x40128560) 
12-21 06:18:46.775: E/AndroidRuntime(7174): FATAL EXCEPTION: main 
12-21 06:18:46.775: E/AndroidRuntime(7174): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.luiz.googleMaps/com.luiz.googleMaps.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1768) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.app.ActivityThread.access$1500(ActivityThread.java:123) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.os.Handler.dispatchMessage(Handler.java:99) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.os.Looper.loop(Looper.java:130) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.app.ActivityThread.main(ActivityThread.java:3835) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at java.lang.reflect.Method.invokeNative(Native Method) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at java.lang.reflect.Method.invoke(Method.java:507) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at dalvik.system.NativeStart.main(Native Method) 
12-21 06:18:46.775: E/AndroidRuntime(7174): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:587) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.view.LayoutInflater.inflate(LayoutInflater.java:386) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:213) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.app.Activity.setContentView(Activity.java:1657) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at com.luiz.googleMaps.MainActivity.onCreate(MainActivity.java:15) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  ... 11 more 
12-21 06:18:46.775: E/AndroidRuntime(7174): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SuppportMapFragment: make sure class name exists, is public, and has an empty constructor that is public 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.support.v4.app.Fragment.instantiate(Fragment.java:401) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.support.v4.app.Fragment.instantiate(Fragment.java:369) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  ... 19 more 
12-21 06:18:46.775: E/AndroidRuntime(7174): Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.SuppportMapFragment in loader dalvik.system.PathClassLoader[/data/app/com.luiz.googleMaps-1.apk] 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at java.lang.ClassLoader.loadClass(ClassLoader.java:551) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  at android.support.v4.app.Fragment.instantiate(Fragment.java:391) 
12-21 06:18:46.775: E/AndroidRuntime(7174):  ... 22 more 
12-21 06:23:46.827: I/Process(7174): Sending signal. PID: 7174 SIG: 9 
+1

아래 답변은 아직 언급되지 않았지만 해결 방법은 잊어 버리고 대신 API v3을 사용하는 데 집중할 수 있습니다. 2013 년 5 월 19 일 버전 2는 더 이상 작동하지 않습니다. 참조 : https://developers.google.com/maps/documentation/javascript/v2/reference – Sparky

답변

0

당신으로 MapFragment를 사용하는 대신 SupportMapFragment를 사용하여 노력했다.

내 주요 활동은 응용 프로그램에서 android-support-v4.jar & google-play-services.jar을 포함 시켰이

public class MapActivity extends Activity { 

private GoogleMap mMap; 

@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.mapactivity); 
    this.getActionBar().setTitle("Map"); 

    getActionBar().setDisplayHomeAsUpEnabled(true); 

    mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); 


} 

}

+0

MapFragment를 사용해 보았지만 "getFragmentManager"가이 오류를 던지고 있습니다. "getFragmentManager() 메소드가 MainActivity 유형에 대해 정의되지 않았습니다." . – Luiz

+0

다음을 가져 오십시오. import com.google.android.gms.maps.MapFragment; – brendan

0

처럼 보인다? 그래 그럼 그냥 후속으로 활동 태그의 완전한 이름을 제거하는 경우 :

`<activity 
     android:name=".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>` 
+0

에뮬레이터가 시작될 때 시작해야하는 MAIN 활동을 지탱할 수 없기 때문에이 문제는 해결되지 않습니다. –

0

나는 구글이 서비스가 가능한 첫 번째입니다 재생 여부를 확인한다고 생각합니다.

int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()); 
if(status == ConnectionResult.SUCCESS) { 
      // what you want to do 
} 
관련 문제