【问题标题】:Google Maps FragmentActivity error谷歌地图 FragmentActivity 错误
【发布时间】:2013-06-15 17:43:34
【问题描述】:

我有一个使用 google maps api 的应用程序,但我不得不重新安装 windows,现在当我将项目导入 eclipse 时,我抛出了多个错误。但是,所有这些都可能源自一个错误。

我在this link 之后添加了 Google Play Services 作为库项目。

然后我将示例项目导入 Eclipse,但在 RetainMapActivity 中,它会在 public class RetainMapActivity extends FragmentActivity 行中引发错误: FragmentActivity 无法解析为类型

import android.support.v4.app.FragmentActivity 上: 无法解析导入的android.support.v4.app.FragmentActivity

示例应用中没有 lib 文件夹,但文档没有告诉添加它。

我的应用程序中可能的错误来源是包含片段的 xml:

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:map="http://schemas.android.com/apk/res-auto"
  android:id="@+id/map"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  class="com.google.android.gms.maps.SupportMapFragment"
  map:cameraZoom="14"
  map:mapType="normal"
  android:layout_weight="2"
/>


Multiple annotations found at this line:
    - error: No resource identifier found for attribute 'mapType' in package 
     'com.myapp'
    - error: No resource identifier found for attribute 'cameraZoom' in package 
     'com.myapp'

我在 libs 文件夹中有 android-support-v4.jar 以及在 Properties/Java Build Path 中,但在 Properties/Android 中,我用红色 X 标记了 google-play-services_lib。我也尝试过清理。就像我说的,在我格式化硬盘之前,一切正常。

【问题讨论】:

  • 红色 x 表示链接断开,您没有正确添加 google play 服务库

标签: android


【解决方案1】:

Android 又烂了。我不得不从现有代码中将库导入为 File_New_Other_Android 项目,而不是 File_Import。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-09
    • 1970-01-01
    • 2016-11-24
    • 2015-06-16
    相关资源
    最近更新 更多