配置GoogleMap后android.view.InflateException:Binary XML file line # 10:Error inflating class

来源:互联网 发布:屏蔽ip地址软件 编辑:程序博客网 时间:2024/06/06 05:39

今天刚开始看Google Map API v2, 自己敲完之后一运行就抱了一大推的错误

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sljjyy.example.map/com.sljjyy.example.map.MainActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class fragment

因为一般异常看最上面的类型就能处理, 然后就开始百度, 遇到这问题的人是很多, 但是貌似他们解决的方式对我都没用, 然后我就往下看, 然后就发现问题了

Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 4030500 but found 0.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

看着最后那段明显是Manifest里的内容, 然后在官方资料里一看, 果然是得加这句, 这个问题就解决了, 如果大家还在为类似问题疯狂百度谷歌, 不妨再看看下面的异常


PS: 其实我一次还没解决, 改完又报了同样的错误, 不过下面那段改成


低端了 低端了.....大家敲代码请细心...

0 0
原创粉丝点击