2013-08-24 5 views
1

저는 며칠 동안이 문제를 현명하게 처리하지 못했습니다. main.xml에에서com.google.android.maps.MapView를 프로젝트 또는 라이브러리에서 찾을 수 없습니다.

내가 말하는 오류 얻을 : 정말

이 "레이아웃 파일, com.google.android.maps.MapView에서 참조 클래스, 프로젝트 또는 라이브러리에서 찾을 수 없습니다" Google API의 MapView.class를 볼 때마다 퍼즐이 생깁니다 [Android 2.3.3] maps.jar

이 문제를 해결하기위한 아이디어가 있으십니까? 이건 정말 내가 직접 해결책을 찾을 수없는 버그.

내 API 키는 Ver. 나는 이클립스를 사용하고 2

은 - 안드로이드 개발자 도구는 빌드 : v22.0.0-675183

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:id="@+id/mapView" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:enabled="true" 
    android:clickable="true" 
    android:apiKey="AIzaSyCSeU48SfPfRRuA-3YycsVxd_s9MFV8g3M" 
    /> 
</LinearLayout> 

그리고 매니페스트

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

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

<uses-feature 
android:glEsVersion="0x00020000" 
android:required="true" /> 

<permission 
android:name="com.tit.GPSLocator.permission.MAPS_RECEIVE" 
android:protectionLevel="signature" /> 
<uses-permission android:name="com.tit.GPSLocator.permission.MAPS_RECEIVE" /> 
<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.INTERNET" /> 

<application 
    android:icon="@drawable/icon" 
    android:label="@string/app_name" 
    android:allowBackup="true"> 

    <uses-library android:name="com.google.android.maps" /> 
    <activity android:name="com.tit.GPSLocator.GPSLocatorActivity" 
      android:label="@string/app_name"> 
     <meta-data 
      android:name="com.google.android.maps.v2.API_KEY" 
      android:value="AIzaSyCSeU48SfPfRRuA-3YycsVxd_s9MFV8g3M" /> 

     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 

</application> 
</manifest> 
+0

프로젝트를 지우려고 했습니까? – wakaka

+0

오 예. 꽤 몇 번. 고마워요, 어쨌든 :) –

+0

안에 API 키 을 옮긴 후, 프로젝트를 다시 청소했습니다. 응용 프로그램을 실행할 수있었습니다. 지도에서 표를 얻었지만지도 타일이 없습니다. "java.io.IOException : 서버가 반환했습니다 : 3"그러나 thst는 다른 문제입니다. –

답변

0

대부분의 경우, 당신은해야 처음에는 com.google.android.maps.MapView을 사용하지 마십시오. 사용 중지 된 Maps V1 API 용입니다. 다른 모든 작업, 특히 API 키는 the Maps V2 API입니다.

+0

예, MapView에 대한 지원이 중단 된 것을 보았습니다. 그러나 다음을 발견했습니다. [link] (https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/MapView) 더 이상 사용되지 않는 언급이 없습니다. 어쨌든, 이것이 API 버전과 관련이 없다고 생각합니다. 구글 API의 MapView.class [Android 2.3.3] maps.jar를 볼 수 있기 때문에 거기에 있습니다. –

+0

@MogensBurapa : "예, MapView에 대한 지원이 중단 된 것을 보았습니다. 그렇지만이 링크를 발견 했으므로 deprecated에 대한 언급이 없습니다."- 사용중인 클래스가 아닙니다. 이 페이지는 Maps V2'MapView'를위한 것으로, com.google.android.gms.maps.MapView입니다. 당신은 그것을 사용하지 않습니다. map V1'MapView' 인'com.google.android.maps.MapView'를 사용하고 있습니다. 지도 V1과지도 V2를 섞어서 사용하지 마십시오. – CommonsWare

+0

네, 위의 링크에 대해 맞습니다. 내 실수. –

0

meta-data API keyactivity 안에 이동 한 후 프로젝트를 다시 청소하고 응용 프로그램을 실행할 수있었습니다. 지도 위에 그리드가 표시되지만지도 타일이 없습니다 : java.io.IOException: Server returned: 3하지만 다른 문제입니다.

관련 문제