简体   繁体   English

在Genymotion模拟器上运行Google Maps API v2时发生ClassNotFoundException

[英]ClassNotFoundException when running Google Maps API v2 on Genymotion Emulator

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.MapFragment" on path: /data/app/com.example.nagivationalmapktm-1.apk 原因:java.lang.ClassNotFoundException:在路径:/data/app/com.example.nagivationalmapktm-1.apk上找不到类“ com.google.android.gms.maps.MapFragment”

I've imported the GooglePlayServices and added it to my project, then also I'm getting this error. 我已导入GooglePlayServices并将其添加到我的项目中,然后我也收到此错误。 Please Help 请帮忙

if you are trying to use google map api v2 for the first time than...follow each and every step of below link carefully. 如果您是第一次尝试使用google map api v2,请...按照下面的每个步骤仔细进行链接。

https://expertsview.wordpress.com/2013/07/05/google-maps-android-api-v2-quick-start-guide/ https://expertsview.wordpress.com/2013/07/05/google-maps-android-api-v2-quick-start-guide/

if you are trying to build on emulator than.. point 3 in above link might be usefull to you 如果您要在仿真器上构建比..以上链接中的第3点可能对您有用

3.Install a compatible version of the Google APIs platform.If you want to test your app on the emulator, expand the directory for Android 4.2.2 (API 17) or a higher version, select Google APIs, and install it. 3.安装兼容版本的Google API。如果要在模拟器上测试应用,请展开适用于Android 4.2.2(API 17)或更高版本的目录,然后选择Google API并进行安装。 Then create a new AVD with Google APIs as the platform target.Note: Only Android 4.2.2 and higher versions of the Google APIs platform include Google Play services. 然后,以Google API为平台目标创建新的AVD。注意:只有Android 4.2.2和更高版本的Google API平台才包含Google Play服务。

Its better to look all the points and setup a working new project. 最好查看所有要点并设置一个可以正常工作的新项目。

You obviously don't have the fragment support library in you compile path. 显然,您的编译路径中没有片段支持库。 The map fragments needs the v4 compatibility library in the compile path. 映射片段在编译路径中需要v4兼容性库。 The map samples are a bear to get straight I followed these directions. 地图样本是我按照这些指示直行的熊。 http://developer.android.com/tools/support-library/setup.html http://developer.android.com/tools/support-library/setup.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM