안녕하세요..
구글 맵 띄우고 있는데요.. 자꾸 같은 문제로 같은 에러가 나서 이렇게 글을 적게 되었습니다.
로그캣에 나오는 에러는 아래와 같구요.. (무슨파일인지 찾아보면 해당 액티비티 onCreate만 찾아가네요.)
Could not find class 'com.google.android.gms.maps.SupportMapFragment', referenced from method com.example.googlemapv2test.MainActivity.onCreate
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.googlemapv2test/com.example.googlemapv2test.MainActivity}: android.view.InflateException: Binary XML file line #13: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #13: Error inflating class fragment
Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SupportMapFragment: make sure class name exists, is public, and has an empty constructor that is public
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.SupportMapFragment" on path: DexPathList[[zip file "/data/app/com.example.googlemapv2test-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.googlemapv2test-1, /vendor/lib, /system/lib]]
저기서 에러있다고 하는 xml파일의 13번째 줄은
<fragment <<이부분입니다.
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
xml파일은 별 다른 특이한 것도 없고
MainActivity도 FragmentActivity를 상속받고 있구요.
메니페스트 파일에서도 퍼미션, 메타데이터 2개(API키, 버전) 다 넣었구요..
google-play-services_lib 이거 프로젝트 라이브러리로 참고하고,
Java Build Path에서 Order and Export에 있는 거 체크 다 했고
Android Dependencies에
google-play-services_lib.jar
android-support-v4.jar
google-play-services.jar 이렇게 들어있네요.
(스샷에 빌드 타겟이 두갠데 4.2로 해도 안되고 4.4.2로 해도 안됩니다. 원래는 4.2 하나만 있었을 때도 안됬구요.)
넣어주라는 건 다 넣어 준 것 같은데 자꾸 익셉션 나구요..
제가 SDK Manager에서 구글 플레이 서비스가 없어서 따로 다운받아서 import 시켜줬는데
그런 것 때문에 문제가 생긴다거나 하나요?
-_- 세시간동안 뭘 해도 같은 에러만 나오니 미칠 것 같네요..