【问题标题】:Failed to install six.apk on device 'emulator-5556 Launch canceled无法在设备 'emulator-5556 上安装 Six.apk 启动已取消
【发布时间】:2012-12-09 17:02:42
【问题描述】:

当我运行我的 android 应用程序时,我遇到了一个安装错误:无法在模拟器上安装我的应用程序并取消启动。我的应用向用户显示谷歌地图。

我的 xml 文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

       <com.google.android.maps.MapView
        android:id="@+id/mapview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:apiKey="************************** "
        android:clickable="true" />
</LinearLayout>

我的清单

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.six"
    android:versionCode="1"
    android:versionName="1.0" >

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

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

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
            <uses-library android:name="com.google.android.maps"/>    
    </application>   
</manifest>

主文件

package com.example.six;
import android.os.Bundle;
import android.view.Menu;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class MainActivity extends MapActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        MapView mapView = (MapView) findViewById(R.id.mapview);
        mapView.setBuiltInZoomControls(true);
    }


    @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;}
        @Override
        protected boolean isRouteDisplayed() {
            return false;

    }


}

请告诉我我的代码有什么问题或者我的 Eclipse 有什么问题吗? 我有 eclipse juno 和 sdk 4.2,我使用的是 google api level 17。

【问题讨论】:

  • 您的模拟器是否设置为使用谷歌 API?
  • 是的,我已经安装了谷歌 API,并在设置项目时选择了谷歌 API

标签: android eclipse installation emulation logcat


【解决方案1】:

您的模拟器映像需要使用 Google API

【讨论】:

  • 我已经在我的项目中使用了google API,但我不知道背后的原因
  • 当您创建也需要使用 Google API 制作的模拟器图像时
猜你喜欢
  • 2014-02-17
  • 1970-01-01
  • 2011-09-16
  • 1970-01-01
  • 2011-05-31
  • 1970-01-01
  • 1970-01-01
  • 2015-10-23
相关资源
最近更新 更多