【问题标题】:Google Map View Error when running - Droid运行时谷歌地图视图错误 - Droid
【发布时间】:2011-01-05 15:00:05
【问题描述】:

我想为我的安卓手机学习一些编程。 我成功地制作了 hello world 应用程序。 现在我想试试这里的地图视图:http://developer.android.com/resources/tutorials/views/hello-mapview.html

我的代码如下:

package com.example.hellomapview;

import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.ZoomControls;
import com.google.android.maps.*;


public class HelloMapView extends MapActivity {
    /** Called when the activity is first created. */
 LinearLayout linearLayout;
 MapView mapView;
 ZoomControls mZoom;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        linearLayout = (LinearLayout) findViewById(R.id.zoomview);
        mapView = (MapView) findViewById(R.id.mapview);
        mZoom = (ZoomControls) mapView.getZoomControls();
        linearLayout.addView(mZoom);
        setContentView(R.layout.main);
    }
    protected boolean isRouteDisplayed() {    return false;}
}

我正在使用 eclipse,并且我已经正确安装了 SDK 和 AVD,但是一旦我执行运行->在 eclipse 中运行,它就可以开始了:

[2010-01-15 12:27:03 - HelloMapView]New emulator found: emulator-5554
[2010-01-15 12:27:03 - HelloMapView]Waiting for HOME ('android.process.acore') to be launched...
[2010-01-15 12:27:46 - HelloMapView]HOME is up on device 'emulator-5554'
[2010-01-15 12:27:46 - HelloMapView]Uploading HelloMapView.apk onto device 'emulator-5554'
[2010-01-15 12:27:46 - HelloMapView]Installing HelloMapView.apk...

The emulator comes up and I see my droid phone ready to load the HelloMapView app..but then it dies with the following:

[2010-01-15 12:27:51 - HelloMapView]Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2010-01-15 12:27:51 - HelloMapView]Please check logcat output for more details.
[2010-01-15 12:27:52 - HelloMapView]Launch canceled!

我从来没有做过任何 android 类型的开发,而且我来自 C# 背景,所以我的 java 是不确定的......但是有人看到我可能遗漏的任何东西吗?

【问题讨论】:

  • 系统名为AndroidDroid 是摩托罗拉手机。
  • 对,但我的手机机器人正在运行系统 android...我哪里出错了?
  • 我的意思是标签:使用android 而不是droid

标签: java android eclipse google-maps


【解决方案1】:

我的猜测是您创建了一个不包含 Google API 的模拟器。

如果您启动 tools/android,您将在可用的软件包中看到例如“SDK Platform Android 1.5, API 3”和“Google APIs by Google Inc. Android API 3”。

如果您想使用地图,您需要安装 Google API 包,并在创建虚拟设备时使用该包。

【讨论】:

  • 现在我已经安装了 google APIS android api 3 rev 3。我在运行时遇到的新错误->运行是“HelloMapView] 找不到 HelloMapView.apk”。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-05-09
  • 1970-01-01
  • 1970-01-01
  • 2015-06-16
  • 2014-08-18
相关资源
最近更新 更多