Android 在AVD上获取信息;此应用程序赢得了';除非更新Google play服务,否则无法正常工作;
我想在我的android应用程序中添加谷歌地图。在完成所有步骤并删除“膨胀类片段”等异常后,my AVD现在显示Android 在AVD上获取信息;此应用程序赢得了';除非更新Google play服务,否则无法正常工作;,android,eclipse,google-maps,Android,Eclipse,Google Maps,我想在我的android应用程序中添加谷歌地图。在完成所有步骤并删除“膨胀类片段”等异常后,my AVD现在显示除非您更新Google play services,否则此应用程序将无法运行。我尝试通过以下步骤更新Google play服务 右键单击项目>Android工具>添加支持库 但收到了两条错误消息 [2013-08-08 09:36:00 - SDK Manager] Failed to fetch URL https://dl-ssl.google.com/android/
除非您更新Google play services,否则此应用程序将无法运行。我尝试通过以下步骤更新Google play服务
右键单击项目>Android工具>添加支持库
但收到了两条错误消息
[2013-08-08 09:36:00 - SDK Manager] Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: Connection to http://10.10.10.100:8080 refused
[2013-08-08 09:37:45 - SDK Manager] Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-8.xml, reason: HttpHostConnect Connection to http://10.10.10.100:8080 refused
我正在使用emulator Eclipse 4.2.0版
manifest.xml
文件附于此处
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.newapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<permission
android:name="com.example.newapp.maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.newapp.maps.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" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.newapp.NewApp"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="*********************************" />
</application>
</manifest>
请给我任何建议。谷歌安卓地图Api v2文档说,你不能在安卓模拟器上运行谷歌地图v2。您必须使用设备进行测试。但是一些人建议可以通过在模拟器中安装所需的服务,如googleplayservices
来实现。看到下面帖子的各种答案,你会得到一些线索
最新版本的Google地图无法在emulator中运行,因为它没有安装Google Play服务。@user2012,但Google地图在我的emulator中作为一个单独的应用程序提供。注意:要运行v2地图,必须安装Google Play服务,而不是Google地图。可能的重复项
<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".NewApp" >
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout
package com.example.newapp;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
public class NewApp extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_app);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.new_app, menu);
return true;
}
}