Google MAP API V2无法加载 [英] Google MAP API V2 unable to load

查看:79
本文介绍了Google MAP API V2无法加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我试图在我的Android移动应用程序中使用谷歌地图API V2,我使用的文章指导如何做到这一点..但我仍然无法将地图加载到我的应用程序中。



我的清单是





< manifest xmlns:android = http://schemas.android.com/apk/res/android\">

package =com.example.map

android:versionCode =1

android:versionName =1.0>



< permission>

android:name = com.example.map.permission.MAPS_RECEIVE

android:protectionLevel =signature/>



< uses-permission android:name =com.example.map.permission.MAPS_RECEIVE>



< uses-permission android:name =android.permission.INTERNET> ;

< uses-permission android:name =android.permission.WRITE_EXTERNAL_STORAGE>

< uses-permission android:name =com.google.android .providers.gsf.permission.READ_GSERVICES​​>

< uses-permission android:name =android.permission.ACCESS_COARSE_LOCATION>

< uses-permissionandroid:name =android.permission.ACCESS_FINE_LOCATION>



< uses-feature>

android:glEsVersion =0x00020000

android:required =true/>





< uses-sdk>

android:minSdkVersion =12

android:targetSdkVersion =17/>



< application> ;

android:allowBackup =true

android:icon =@ drawable / ic_launcher

android:label =@ string / app_name

android:theme =@ style / AppTheme>

< activity>

android:name =com.example .map.MainActivity

android:label =@ string / app_name>

< intent-filter>

< action android:name =android.intent.action.MAIN>



< category android:name =android.inte nt.category.LAUNCHER>







< meta-data

android:name =com.google.android.maps.v2.API_KEY

android:value =my key/>









我的activiyu_main



< relativelayout xmlns:android =http://schemas.android.com/apk/res/android>

xmlns:tools =http://schemas.android.com/tools

android:layout_width =match_parent

android:layout_height =match_parent

工具:context =。MainActivity>



< textview>

android:layout_width =wrap_content

android:layout_height =wrap_content

android:layout_centerHorizo​​ntal =true

android:layout_centerVertical =true

android:text =@ string / hello_world/>



< fragment>

android:id =@ + id / map

android:layout_width =match_parent

android: layout_height =match_parent

android:name =com.google.android.gms.maps.MapFragment/>







和我的主要activity.java是



包com.example.map;



导入com.google.android.gms.maps.GoogleMap;

import com.google.android.gms.maps.MapFragment;

导入android.os.Bundle;

导入android.app.Activity;

导入android.view.Menu;

import android .widget.Toast;



公共类MainActivity扩展活动{





私人GoogleMap googleMap;



@Override

protected void onCreate(Bundle savedInstanceState){

super.onCreate (savedInstanceState);

setContentView(R.layout.activity_main);





试试{

//正在加载地图

initilizeMap();



} catch(例外e){

e.printStackTrace();

}

}



private void initilizeMap(){

// TODO自动生成方法存根

if(googleMap == null){

googleMap =((MapFragment)getFragmentManager()。findFragmentById(

R.id.map))。getMap();



//检查地图是否成功创建

if(googleMap == null){

Toast.makeText(getApplicationContext(),

对不起!无法创建地图,Toast.LENGTH_SHORT)

.show();

}

}

< br $>
}



@Override

public boolean onCreateOptionsMenu(菜单菜单){

//给菜单充气;如果它存在,这会将项目添加到操作栏。

getMenuInflater()。inflate(R.menu.activity_main,menu);

返回真的;

}



}



我的logCAT是



01-24 09:46:14.271:W / Trace(962):来自nativeGetEnabledTags的意外值:0

01-24 09:46: 14.271:W / Trace(962):来自nativeGetEnabledTags的意外值:0

01-24 09:46:14.571:W / Trace(962):来自nativeGetEnabledTags的意外值:0

01-24 09:46:14.571:W / Trace(962):来自nativeGetEnabledTags的意外值:0

01-24 09:46:15.181:D / AndroidRuntime(962):关闭down VM

01-24 09:46:15.181:W / dalvikvm( 962):threadid = 1:线程退出未捕获异常(组= 0x40a70930)

01-24 09:46:15.251:E / AndroidRuntime(962):致命异常:主要

01-24 09:46:15.251:E / AndroidRuntime(962):java.lang.RuntimeException:无法启动活动ComponentInfo {com.example.map/com.example.map.MainActivity}:android.view。 InflateException:二进制XML文件行#14:错误扩充类片段

01-24 09:46:15.251:E / AndroidRuntime(962):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2180)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)

01 -24 09:46:15.251:E / AndroidRuntime(962):在android.app.ActivityThread.access $ 600(ActivityThread.java:141)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1234)

01-24 09:46:15.251:E / AndroidRuntime(962):at android.os .Handler.di spatchMessage(Handler.java:99)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.os.Looper.loop(Looper.java:137)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.app.ActivityThread.main(ActivityThread.java:5039)

01-24 09:46 :15.251:E / AndroidRuntime(962):at java.lang.reflect.Method.invokeNative(Native Method)

01-24 09:46:15.251:E / AndroidRuntime(962):at java .lang.reflect.Method.invoke(Method.java:511)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:793)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java :560)

01-24 09:46:15.251:E / AndroidRuntime(962):at dalvik.system.NativeStart.main(Native Method)

01-24 09:46:15.251:E / AndroidRuntime(962):引起:android.view.InflateException:二进制XML文件行#14:错误扩充类片段

01-24 09:46: 15.251:E / AndroidRuntime(962):在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)

01-24 09:46:15.251:E / AndroidRuntime(962):at android .view.LayoutInflater.rInflate(LayoutInflater.java:746)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.view.LayoutInflater.inflate(LayoutInflater.java: 489)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.view.LayoutInflater.inflate(LayoutInflater.java:396)

01 -24 09:46:15.251:E / AndroidRuntime(962):在android.view.LayoutInflater.inflate(LayoutInflater.java:352)

01-24 09:46:15.251:E / AndroidRuntime (962):at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)

01-24 09:46:15.251:E / AndroidRuntime(962):at android.app.Activity.setContentView(Activity.java:1881)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.example.map.MainActivity.onCreate(MainActivity .java:23)

01-24 09:46:15.251:E / AndroidRunti我(962):在android.app.Activity.performCreate(Activity.java:5104)

01-24 09:46:15.251:E / AndroidRuntime(962):at android.app.Instrumentation .callActivityOnCreate(Instrumentation.java:1080)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)

01-24 09:46:15.251:E / AndroidRuntime(962):... 11更多

01-24 09:46:15.251:E / AndroidRuntime(962) :引起:java.lang.IllegalStateException:应用程序的AndroidManifest.xml中的元数据标记没有正确的值。预期4132500但找到0.您必须在< application>中包含以下声明: element:< meta-data android:name =com.google.android.gms.versionandroid:value =@ integer / google_play_services_version/>

01-24 09:46: 15.251:E / AndroidRuntime(962):at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)

01-24 09:46:15.251:E / AndroidRuntime(962) :at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android。 gms.maps.internal.qv(未知来源)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android.gms.maps.internal.qu(未知来源)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android.gms.maps.MapFragment $ b.eb(Unknown Source)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android.gms.maps.MapFragment $ ba(U nknown来源)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android.gms.dynamic.aa(Unknown Source)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android.gms.dynamic.a.onInflate(Unknown Source)

01-24 09:46: 15.251:E / AndroidRuntime(962):at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)

01-24 09:46:15.251:E / AndroidRuntime(962) :在android.app.Activity.onCreateView(Activity.java:4716)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.view.LayoutInflater.createViewFromTag(LayoutInflater) .java:680)

01-24 09:46:15.251:E / AndroidRuntime(962):... 21更多



任何帮助都非常感谢



谢谢

Hi all,

I have tried to use Google map API V2 in my android mobile application and I used the article which was guide how to do it..But still I failed to load the map into my app.

my manifest is


<manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="com.example.map"
android:versionCode="1"
android:versionName="1.0" >

<permission>
android:name="com.example.map.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>

<uses-permission android:name="com.example.map.permission.MAPS_RECEIVE">

<uses-permission android:name="android.permission.INTERNET">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE">
<uses-permission android:name="com.google.android.providers.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"/>


<uses-sdk>
android:minSdkVersion="12"
android:targetSdkVersion="17" />

<application>
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity>
android:name="com.example.map.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN">

<category android:name="android.intent.category.LAUNCHER">



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




my activiyu_main

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<textview>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world" />

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



and my main activity.java is

package com.example.map;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.Toast;

public class MainActivity extends Activity {


private GoogleMap googleMap;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


try {
// Loading map
initilizeMap();

} catch (Exception e) {
e.printStackTrace();
}
}

private void initilizeMap() {
// TODO Auto-generated method stub
if (googleMap == null) {
googleMap = ((MapFragment) getFragmentManager().findFragmentById(
R.id.map)).getMap();

// check if map is created successfully or not
if (googleMap == null) {
Toast.makeText(getApplicationContext(),
"Sorry! unable to create maps", Toast.LENGTH_SHORT)
.show();
}
}

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}

}

My logCAT is

01-24 09:46:14.271: W/Trace(962): Unexpected value from nativeGetEnabledTags: 0
01-24 09:46:14.271: W/Trace(962): Unexpected value from nativeGetEnabledTags: 0
01-24 09:46:14.571: W/Trace(962): Unexpected value from nativeGetEnabledTags: 0
01-24 09:46:14.571: W/Trace(962): Unexpected value from nativeGetEnabledTags: 0
01-24 09:46:15.181: D/AndroidRuntime(962): Shutting down VM
01-24 09:46:15.181: W/dalvikvm(962): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
01-24 09:46:15.251: E/AndroidRuntime(962): FATAL EXCEPTION: main
01-24 09:46:15.251: E/AndroidRuntime(962): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.map/com.example.map.MainActivity}: android.view.InflateException: Binary XML file line #14: Error inflating class fragment
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.os.Handler.dispatchMessage(Handler.java:99)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.os.Looper.loop(Looper.java:137)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.ActivityThread.main(ActivityThread.java:5039)
01-24 09:46:15.251: E/AndroidRuntime(962): at java.lang.reflect.Method.invokeNative(Native Method)
01-24 09:46:15.251: E/AndroidRuntime(962): at java.lang.reflect.Method.invoke(Method.java:511)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-24 09:46:15.251: E/AndroidRuntime(962): at dalvik.system.NativeStart.main(Native Method)
01-24 09:46:15.251: E/AndroidRuntime(962): Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class fragment
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.Activity.setContentView(Activity.java:1881)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.example.map.MainActivity.onCreate(MainActivity.java:23)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.Activity.performCreate(Activity.java:5104)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-24 09:46:15.251: E/AndroidRuntime(962): ... 11 more
01-24 09:46:15.251: E/AndroidRuntime(962): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4132500 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" />
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.maps.internal.q.v(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.maps.internal.q.u(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.maps.MapFragment$b.eb(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.dynamic.a.a(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.Activity.onCreateView(Activity.java:4716)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
01-24 09:46:15.251: E/AndroidRuntime(962): ... 21 more

Any help is really appreciate

Thanks

推荐答案

600(ActivityThread.java:141)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.app.ActivityThread
600(ActivityThread.java:141)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.ActivityThread


H.handleMessage(ActivityThread.java:1234)< />
01-24 09:46:15.251:E / AndroidRuntime(962):在android.os.Handler.dispatchMessage(Handler.java:99)

01-24 09:46:15.251: E / AndroidRuntime(962):在android.os.Looper.loop(Looper.java:137)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.app .ActivityThread.main(ActivityThread.java:5039)

01-24 09:46:15.251:E / AndroidRuntime(962):at java.lang.reflect.Method.invokeNative(Native Method)

01-24 09:46:15.251:E / AndroidRuntime(962):at java.lang.reflect.Method.invoke(Method.java:511)

01- 24 09:46:15.251:E / AndroidRuntime(962):at com.android.internal.os.ZygoteInit
H.handleMessage(ActivityThread.java:1234)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.os.Handler.dispatchMessage(Handler.java:99)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.os.Looper.loop(Looper.java:137)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.ActivityThread.main(ActivityThread.java:5039)
01-24 09:46:15.251: E/AndroidRuntime(962): at java.lang.reflect.Method.invokeNative(Native Method)
01-24 09:46:15.251: E/AndroidRuntime(962): at java.lang.reflect.Method.invoke(Method.java:511)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.android.internal.os.ZygoteInit


MethodAndArgsCaller.run(ZygoteInit.java:793)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)

01-24 09 :46:15.251:E / AndroidRuntime(962):at dalvik.system.NativeStart.main(Native Method)

01-24 09:46:15.251:E / AndroidRuntime(962):引起的:android.vie w.InflateException:二进制XML文件行#14:错误扩充类片段

01-24 09:46:15.251:E / AndroidRuntime(962):在android.view.LayoutInflater.createViewFromTag(LayoutInflater。 java:704)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.view.LayoutInflater.rInflate(LayoutInflater.java:746)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.view.LayoutInflater.inflate(LayoutInflater.java:489)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.view.LayoutInflater.inflate(LayoutInflater.java:396)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.view。 LayoutInflater.inflate(LayoutInflater.java:352)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow) .java:270)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.app.Activity.setContentView(Activity.java:1881)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.e xample.map.MainActivity.onCreate(MainActivity.java:23)

01-24 09:46:15.251:E / AndroidRuntime(962):at android.app.Activity.performCreate(Activity.java :5104)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)

01-24 09:46:15.251:E / AndroidRuntime(962):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)

01-24 09:46:15.251:E / AndroidRuntime(962):... 11更多

01-24 09:46:15.251:E / AndroidRuntime(962):引起:java.lang.IllegalStateException:你的元数据标签应用程序的AndroidManifest.xml没有正确的值。预期4132500但找到0.您必须在< application>中包含以下声明: element:< meta-data android:name =com.google.android.gms.versionandroid:value =@ integer / google_play_services_version/>

01-24 09:46: 15.251:E / AndroidRuntime(962):at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)

01-24 09:46:15.251:E / AndroidRuntime(962) :at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android。 gms.maps.internal.qv(未知来源)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android.gms.maps.internal.qu(未知来源)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)

01-24 09:46:15.251:E / AndroidRuntime(962):at com.google.android.gms.maps.MapFragment
MethodAndArgsCaller.run(ZygoteInit.java:793)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-24 09:46:15.251: E/AndroidRuntime(962): at dalvik.system.NativeStart.main(Native Method)
01-24 09:46:15.251: E/AndroidRuntime(962): Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class fragment
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.Activity.setContentView(Activity.java:1881)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.example.map.MainActivity.onCreate(MainActivity.java:23)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.Activity.performCreate(Activity.java:5104)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-24 09:46:15.251: E/AndroidRuntime(962): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-24 09:46:15.251: E/AndroidRuntime(962): ... 11 more
01-24 09:46:15.251: E/AndroidRuntime(962): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4132500 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" />
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.maps.internal.q.v(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.maps.internal.q.u(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
01-24 09:46:15.251: E/AndroidRuntime(962): at com.google.android.gms.maps.MapFragment


这篇关于Google MAP API V2无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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