获取有关AVD&QUOT消息,这个程序将无法正常工作,除非你更新谷歌播放服务];无法正常、消息、程序、工作

2023-09-08 09:30:11 作者:柒安

我想补充谷歌地图在我的Andr​​oid应用程序。以下所有步骤和消除异常,如充气类片段后,我的AVD现在显示此应用程序将无法正常工作,除非你更新谷歌播放服务。我尝试更新完成以下步骤谷歌播放服务

I want to add google map in my android app. After following all the steps and removing exceptions such as "inflating class fragment", my AVD is now showing This app won't work unless you update Google play services. I tried to update Google play services through the following steps

右键单击项目>安卓工具>添加支持库

Right click on Project > Android Tools > Add Support Library

但有2错误消息。

    [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

我现在用的模拟器Eclipse版本4.2.0 的manifest.xml 文件附在这里

I am using the emulator Eclipse version 4.2.0 manifest.xml file is attached here

    <?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>

activity_new_app.xml

activity_new_app.xml

   <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

> NewApp.java

> NewApp.java

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;
    }

}

请给我任何建议。

推荐答案

谷歌Android地图API第2医生说,你不能在Android模拟器上运行谷歌地图V2。您必须使用设备为你的测试。但有些人认为它可以通过安装所需要的服务,如谷歌播放服务在模拟器中进行。请参阅以下职位的各种答案,你会得到一些线索。

Google Android Map Api v2 doc says,you can't run google maps v2 on Android emulator. You must use a device for your tests. But some people suggest it can be done by installing the required services like Google Play Services in the emulator. See the various answers of the following post, you will get some clue.

Running谷歌地图v2的在Android模拟器