java.lang.NoClassDefFoundError:com.google.android.gms.R $ styleable [英] java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable

查看:98
本文介绍了java.lang.NoClassDefFoundError:com.google.android.gms.R $ styleable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在XML中

 < fragment android:id =@ + id / map
android:name =in.mpo.mpmobile.KioskListLocation
android:layout_width =match_parent
android:layout_height =wrap_content
class =com.google.android.gms.maps.SupportMapFragment />

我正在尝试加载Google地图,但不幸显示错误


java.lang.NoClassDefFoundError:com.google.android.gms.R $ styleable at
com.google.android.gms.maps.GoogleMapOptions.createFromAttri butes (未知
来源)com.google.android.gms.maps.MapFragment.onInflate(未知
来源)



在构建文件中

 依赖项
{
编译fileTree(包括:['* .jar '',dir:'libs')
编译文件('libs / android-support-v4.jar')
编译文件('libs / google-play-services.jar')
}


解决方案

更改xml中的类

 < fragment android:id =@ + id / map
android:layout_width =match_parent
android :layout_height =match_parent
class =com.google.android.gms.maps.MapFragment/>


in XML

<fragment android:id="@+id/map" 
   android:name="in.mpo.mpmobile.KioskListLocation" 
   android:layout_width="match_parent" 
   android:layout_height="wrap_content" 
   class="com.google.android.gms.maps.SupportMapFragment" />

I am trying to load Google Map but unfortunately it show error

java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable at com.google.android.gms.maps.GoogleMapOptions.createFromAttri‌​butes(Unknown Source) at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)

in build File

dependencies 
{ 
  compile fileTree(include: ['*.jar'], dir: 'libs') 
  compile files('libs/android-support-v4.jar') 
  compile files('libs/google-play-services.jar') 
} 

解决方案

change class in your xml

<fragment android:id="@+id/map" 
   android:layout_width="match_parent" 
   android:layout_height="match_parent" 
   class="com.google.android.gms.maps.MapFragment" />

这篇关于java.lang.NoClassDefFoundError:com.google.android.gms.R $ styleable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆