【问题标题】:Build Errors (token_refresh.xml) for Android Hackbook in Eclipse在 Eclipse 中为 Android Hackbook 构建错误 (token_refresh.xml)
【发布时间】:2012-04-24 10:43:42
【问题描述】:

我跟随 Facebook 的 Android 开发网站在 Eclipse 中设置 Facebook Android 项目: https://developers.facebook.com/docs/guides/mobile/android_hackbook/

我使用 build.xml 中的“调试”目标来使用 Ant 进行构建。但我收到了这些错误:

[aapt] E:\Android\facebook-android-sdk\examples\Hackbook\res\layout\token_refresh.xml:15:错误:错误:不允许字符串类型(在 'layout_width' 处,值为 'match_parent') . [aapt] E:\Android\facebook-android-sdk\examples\Hackbook\res\layout\token_refresh.xml:28:错误:错误:不允许字符串类型(在 'layout_width' 处,值为 'match_parent')。

构建失败 C:\Android\android-sdk-windows\tools\ant\build.xml:598:执行此行时出现以下错误: C:\Android\android-sdk-windows\tools\ant\build.xml:627: null 返回:1

为什么 token_refresh.xml 出错了?我没有对我从 github 下载的最新 facebook sdk 进行任何更改。

我确实更改了 Hackbook 的 APP_ID 以使用我创建的新的。我在这个项目中引用了 facebook sdk。我在这个项目中有 libs 文件夹。

我打开 token_refresh.xml,它在日志中显示了这些错误:

注意:该项目包含资源错误,所以 aapt 没有成功,可能会导致渲染失败。先解决资源问题。

Failed to convert @color/grey into a drawable
Couldn't resolve resource @string/app_name
Couldn't resolve resource @string/access_token_label
Couldn't resolve resource @string/access_token_expires_label
Couldn't resolve resource @color/grey
Couldn't resolve resource @string/refresh_button
Couldn't resolve resource @string/tip_label
Couldn't resolve resource @string/refresh_token_tip
Exception details are logged in Window > Show View > Error Log

有谁知道如何解决这些问题?

谢谢

【问题讨论】:

    标签: android eclipse facebook


    【解决方案1】:

    Hackbook 仅适用于 Android SDK 2.2 +。我把它设置为2.1,所以它不起作用。现在它可以在我的 AVD 2.2 上编译和运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-12
      • 1970-01-01
      • 2011-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多