두분 답변 있었는데...제가 실수로 삭제 해버렸네요 ..ㅡㅡ
죄송합니다...두분에게..
permission을 추가해도...역시 죽네요...ㅡㅡ..
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-library android:name="com.google.android.maps" />
logcat메세지 보면 xml쪽이 문제인것 같은데...
알려주신데로...permission을 추가 했는데...그래도..죽네요..ㅡㅡ..
logcat 메세지 입니다..
xml 쪽에서 문제 인것 깉은데... ㅡㅡ..
03-18 07:05:44.163: WARN/dalvikvm(508): threadid=3: thread exiting with uncaught exception (group=0x4000fe68)
03-18 07:05:44.163: ERROR/AndroidRuntime(508): Uncaught handler: thread main exiting due to uncaught exception
03-18 07:05:44.183: ERROR/AndroidRuntime(508): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gabjun.mapView/com.gabjun.mapView.mapView}: android.view.InflateException: Binary XML file line #23: Error inflating class java.lang.reflect.Constructor
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2141)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2157)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.app.ActivityThread.access$1800(ActivityThread.java:112)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1581)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.os.Handler.dispatchMessage(Handler.java:88)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.os.Looper.loop(Looper.java:123)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.app.ActivityThread.main(ActivityThread.java:3739)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at java.lang.reflect.Method.invokeNative(Native Method)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at java.lang.reflect.Method.invoke(Method.java:515)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at dalvik.system.NativeStart.main(Native Method)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): Caused by: android.view.InflateException: Binary XML file line #23: Error inflating class java.lang.reflect.Constructor
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.view.LayoutInflater.createView(LayoutInflater.java:512)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:231)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.app.Activity.setContentView(Activity.java:1567)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at com.gabjun.mapView.mapView.onCreate(mapView.java:20)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1122)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2104)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): ... 11 more
03-18 07:05:44.183: ERROR/AndroidRuntime(508): Caused by: java.lang.reflect.InvocationTargetException
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at com.google.android.maps.MapView.<init>(MapView.java:229)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at java.lang.reflect.Constructor.constructNative(Native Method)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at java.lang.reflect.Constructor.newInstance(Constructor.java:424)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at android.view.LayoutInflater.createView(LayoutInflater.java:499)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): ... 21 more
03-18 07:05:44.183: ERROR/AndroidRuntime(508): Caused by: java.lang.IllegalArgumentException: MapViews can only be created inside instances of MapActivity.
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at com.google.android.maps.MapView.<init>(MapView.java:273)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): at com.google.android.maps.MapView.<init>(MapView.java:246)
03-18 07:05:44.183: ERROR/AndroidRuntime(508): ... 25 more
03-18 07:05:44.243: INFO/Process(50): Sending signal. PID: 508 SIG: 3
03-18 07:05:44.263: INFO/dalvikvm(508): threadid=7: reacting to signal 3
03-18 07:05:44.303: INFO/dalvikvm(508): Wrote stack trace to '/data/anr/traces.txt'
03-18 07:05:53.503: WARN/ActivityManager(50): Launch timeout has expired, giving up wake lock!
03-18 07:05:53.993: WARN/ActivityManager(50): Activity idle timeout for HistoryRecord{4352eb38 {com.gabjun.mapView/com.gabjun.mapView.mapView}}
03-18 07:05:59.163: DEBUG/dalvikvm(92): GC freed 223 objects / 10392 bytes in 155ms
====================================================================================================
mapview보는 간단한 app 작성중입니다.
안드로이드에서 mapkey 도 인증받고
소스에
package testapp2.hdlnc.com;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class testapp2 extends MapActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
main.xml에
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0JlIztz5WHTh06n8potTiwoOSlYfxcFgalsuPhA"
/>
<Button android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Open Search-Dialog" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
컴파일하면 에러없이 컴파일됩니다.
근데...에뮬로 app 실행하면 자꾸 죽어요..ㅡㅡ..
unexpected 로 해서...
도움 부탁드립니다.
어케 수정해야하나요?