2014-10-08 4 views
2

Google지도 v2 용 앱을 하나 개발하려고합니다. 나는 모든 지시를 따랐다. 내가 API_KEY 생성하고 안드로이드 매니 페스트 파일에 배치. "주문 및 내보내기"탭에서 내 프로젝트에서 "Android 개인 라이브러리"를 선택했습니다. 또한 참조하는 라이브러리 프로젝트에 대해이 작업을 수행했습니다. 하지만 난 안드로이드 장치뿐만 아니라 에뮬레이터에서 애플 리케이션을 실행할 때 오류가 발생합니다. 내 로그 고양이 같은 오류를 경작android, Google지도 api v2 오류

10-09 03:02:37.905: E/PAUSE(2949): TIMERS! 
10-09 03:02:37.921: W/dalvikvm(2949): VFY: unable to find class referenced in signature (Lcom/google/android/gms/maps/GoogleMap;) 
10-09 03:02:37.921: I/dalvikvm(2949): Could not find method com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable, referenced from method com.zarrin.negar.LocationActivity.checkGooglePlayServicesForUpdate 
10-09 03:02:37.921: W/dalvikvm(2949): VFY: unable to resolve static method 3699: Lcom/google/android/gms/common/GooglePlayServicesUtil;.isGooglePlayServicesAvailable (Landroid/content/Context;)I 
10-09 03:02:37.925: D/dalvikvm(2949): VFY: replacing opcode 0x71 at 0x0005 
10-09 03:02:37.925: E/dalvikvm(2949): Could not find class 'com.google.android.gms.maps.SupportMapFragment', referenced from method com.zarrin.negar.LocationActivity.initialization 
10-09 03:02:37.925: W/dalvikvm(2949): VFY: unable to resolve check-cast 615 (Lcom/google/android/gms/maps/SupportMapFragment;) in Lcom/zarrin/negar/LocationActivity; 
10-09 03:02:37.933: D/dalvikvm(2949): VFY: replacing opcode 0x1f at 0x0021 
10-09 03:02:37.937: E/dalvikvm(2949): Could not find class 'com.google.android.gms.maps.model.LatLng', referenced from method com.zarrin.negar.LocationActivity.setGps 
10-09 03:02:37.941: W/dalvikvm(2949): VFY: unable to resolve new-instance 618 (Lcom/google/android/gms/maps/model/LatLng;) in Lcom/zarrin/negar/LocationActivity; 
10-09 03:02:37.941: D/dalvikvm(2949): VFY: replacing opcode 0x22 at 0x0021 
10-09 03:02:37.941: E/dalvikvm(2949): Could not find class 'com.google.android.gms.maps.model.LatLng', referenced from method com.zarrin.negar.LocationActivity.setLocation 
10-09 03:02:37.945: W/dalvikvm(2949): VFY: unable to resolve new-instance 618 (Lcom/google/android/gms/maps/model/LatLng;) in Lcom/zarrin/negar/LocationActivity; 
10-09 03:02:37.945: D/dalvikvm(2949): VFY: replacing opcode 0x22 at 0x001e 
10-09 03:02:37.949: D/dalvikvm(2949): DexOpt: unable to opt direct call 0x0f0e at 0x27 in Lcom/zarrin/negar/LocationActivity;.setGps 
10-09 03:02:37.949: D/dalvikvm(2949): DexOpt: unable to opt direct call 0x0f10 at 0x37 in Lcom/zarrin/negar/LocationActivity;.setGps 
10-09 03:02:37.949: D/dalvikvm(2949): DexOpt: unable to opt direct call 0x0f0e at 0x40 in Lcom/zarrin/negar/LocationActivity;.setGps 
10-09 03:02:37.949: I/dalvikvm(2949): Failed resolving Lcom/zarrin/negar/LocationActivity$1; interface 612 'Lcom/google/android/gms/maps/GoogleMap$OnMapClickListener;' 

매니페스트 :

<uses-sdk 
    android:minSdkVersion="9" 
    android:targetSdkVersion="18" /> 
<uses-feature android:name="android.hardware.camera" android:required="false"/> 
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> 

<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.CAMERA" /> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> 
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> 
<uses-permission android:name="android.permission.GET_TASKS" /> 
<uses-permission android:name="android.permission.RECORD_AUDIO" /> 
<uses-permission android:name="android.permission.VIBRATE" /> 
<uses-permission android:name="android.permission.READ_LOGS" /> 
<uses-permission android:name="android.permission.CLEAR_CACHE" /> 
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> 
<permission 
    android:name="com.zarrin.negar.permission.C2D_MESSAGE" 
    android:protectionLevel="signature" /> 

<uses-permission android:name="com.zarrin.negar.permission.C2D_MESSAGE" /> 

<permission 
    android:name="com.zarrin.negar.permission.MAPS_RECEIVE" 
    android:protectionLevel="signature" /> 

<uses-permission android:name="com.zarrin.negar.permission.MAPS_RECEIVE" /> 
<uses-feature 
    android:glEsVersion="0x00020000" 
    android:required="true" /> 
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> 
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> 
<uses-permission android:name="android.permission.WAKE_LOCK" /> 

내 활동

<activity 
     android:name="com.zarrin.negar.LocationActivity" 
     android:screenOrientation="portrait" 
     android:launchMode="singleTop" > 
    </activity> 

메타 데이터 : 내 프로젝트의 속성

<meta-data 
     android:name="com.google.android.maps.v2.API_KEY" 
     android:value="my_api_key" /> 

    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 

이미지 :

때문에 프로젝트 구성 또는 에뮬레이터 구성의

image 1

image 2

+0

질문을 매니페스트 항목으로 업데이트하십시오. 빌드 문제가 의심됩니다. 내가 구글에서 서비스를 재생 설치하기 때문에 1.google_play_services.jar 2.google_play_services_lib.jar 이 문제는 에뮬레이터에서하지 않습니다 – ashoke

답변

0

이 될 수 있습니다.

프로젝트

  • 는 구글이 SDK에서 서비스 프로젝트를 재생 라이브러리로 가져 적이 있습니까?

에뮬레이터 Google Play 서비스를 설치했습니다

  • 에뮬레이터? SDK (Google API)가 포함 된 에뮬레이터를 실행 해보십시오.

행운을 빌어 요!

+0

그래, 나 또한 google_play_services_lib에서 도서관 이러한 jar 파일을 추가, 라이브러리 프로젝트로 google_play_services_lib 수입 에뮬레이터, 또한 내 휴대 전화 (HTC 한)에 내 응용 프로그램을 설치했지만 다시는 작동하지 않습니다! : –

+0

SDK를 업데이트하십시오.이 절실한 상황에서 SDK를 제거하고 다시 설치하십시오. 한 가지 경우에만 이것이 내가 가지고있는 문제를 해결할 수있는 유일한 방법이었습니다. –

+0

tnx alot, worked :) –