NoClassDeffoundError Google-Play 서비스 /지도
-
20-12-2019 - |
문제
프로젝트 내에서 NoClassDefFoundError
및 Google-Play-Services 폴더에서 발견 된 Android 샘플의 Google지도에서
지금까지 시도한 것 :
- 마법사를 통해 Google-Play-Services_Lib을 작업 영역으로 가져 와서 코드가 디렉토리에 복사되는지 확인합니다.
- 샘플이있는 디렉토리에 Google-Play-Services_lib를 수동으로 복사 한 다음 작업 공간 로 가져 오기
- JAR 복사
- Google Play 서비스는 테스트 장치 (Nexus 5, Galaxy S4) 에 설치됩니다.
- 속성> Android 에 나가있을 때 내 프로젝트 아래의 라이브러리 옆에있는 녹색 점검이 있습니다.
- 컴파일 시간에 소스의 클래스를 볼 수 있습니다. 오류가없는 컴파일
- Android SDK 관리자에서 lib를 다시 설치하고 Google API 콘솔에서 키가 올바른지 확인했습니다.또한 해당 키에 대해 맵의 v2가 활성화되었는지
- 통합 지침 에 따라 Proguard 예외가 추가되었습니다.
아이디어가 있습니까?
매니페스트 :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.package.projectname"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="21" />
<permission
android:name="com.package.projectname.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.package.projectname.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.package.projectname.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<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" >
<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>
<activity
android:name="com.package.projectname.MapActivity"
android:label="@string/title_activity_map"
android:parentActivityName="com.package.projectname.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.package.projectname.MainActivity" />
</activity>
<uses-library
android:name="com.google.android.maps"
android:required="true" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value=“my_key_from_google_api_console” />
</application>
</manifest>
. 해결책
라인이 필요하다고 생각하지 않습니다.
<uses-library
android:name="com.google.android.maps"
android:required="true" />
.
사실, 나는 그것이 이전지도 라이브러리의 이름이라고 생각합니다. 제거하고 문제를 해결하는지 확인하십시오. 또한 코드가 com.google.android.gms.maps
및 com.google.android.gms.maps.model
에서 Google Maps API v2의 패키지를 가져 오는지 확인하십시오.
업데이트
빌드 구성은 APK에서 Google Play 서비스 Jar를 포함하지 않습니다.
intellij : https://stackoverflow.com/a/17977734/1235702
이런이 Rel="> https://docs.google.com/document/pub?id=19nqzvkp-avld7_vrpwnhfl-ae9fjbjysowonzztnhzw (이 doc를 쓰지 않았지만 누구든지 kudos를 쓰지 않았습니다!)
- Google Play 서비스 프로젝트를 Eclipse 작업 공간에 추가하십시오.
- 파일 -> 가져 오기 ...를 클릭하고 Android -> 기존 Android 코드를 작업 영역으로 선택하십시오. 찾아보기 / extras / google / google_play_services / libproject / google-play-services_lib
를 선택하십시오.- Google Play 서비스에 대한 종속성을 프로젝트에 추가하기 위해
- 프로젝트 -> 속성 -> Android -> 라이브러리, 추가 -> Google-Play-Services_Lib
(죄송합니다. 마크 다운은 숫자를 3과 4를 명시 적으로 설정하게하지 않습니다.)
Postity 용 OP에서 스크린 샷 :
제휴하지 않습니다 StackOverflow