如何正确界定V7 appcompat的依赖? [英] How to define v7 appcompat dependency correctly?

查看:351
本文介绍了如何正确界定V7 appcompat的依赖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得(继承)的Andr​​oid项目建设。我使用蚂蚁和放大器;命令行工具(和IDEA)。

I'm trying to get an (inherited) Android project to build. I'm using Ant & command line tools (and IDEA).

在styles.xml,有引用该不能被解析,如:

In styles.xml, there are references that cannot be resolved such as:

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">

这是原来的错误我遇到了:

This is the original error I ran into:

[...]/res/values/styles.xml:8: error: Error retrieving parent for item:
No resource found that matches the given name '@style/Theme.AppCompat.Light'.

然后我注意到 project.properties 有这个appcompat参考这是我的(OS X)机破:

I then noticed that project.properties has this appcompat reference which is broken on my (OS X) machine:

target=android-18
android.library.reference.1=../../../../adt-bundle-linux-x86_64/sdk/extras/android/support/v7/appcompat

我试图修复通过参照相对于以 $ {sdk.dir}

android.library.reference.1=${sdk.dir}/extras/android/support/v7/appcompat

所以,现在这条道路应该是正确的。但现在当我运行蚂蚁调试

BUILD FAILED
/opt/android-sdk-macosx/tools/ant/build.xml:573: 
  /opt/android-sdk-macosx/extras/android/support/v7/appcompat resolve to a 
  path with no project.properties file for project /Users/joka/devel/project/

所以,任何想法?什么是获得该项目建成最简单的方法是什么?

So, any ideas? What's the simplest way to get this project built?

(请注意,Ecplise有针对性的建议将不会对我很有帮助。)

(Please note that Ecplise-specific advice won't be useful to me.)

修改的:Android的SDK安装看起来是这样的:

Edit: The Android SDK installation looks like this:

推荐答案

我遇到了同样的问题,所以我尝试使用相对路径和解决了这个问题对我来说。它看起来像只是相对的路径与android.library.reference工作。我做了快速搜索,确认这一点,碰到<一href="http://stackoverflow.com/questions/7925747/how-do-you-set-the-android-library-absolute-path-in-ant-properties">this计算器链接这表明绝对路径将与android.library.reference工作在Windows,但不能在Unix或Mac。

I ran into the same problem, so I tried using a relative path and that fixed the problem for me. It looks like only relative paths work with android.library.reference. I did a quick search to verify this, and came across this stackoverflow link which indicates that absolute paths will work with android.library.reference on Windows, but not on Unix or Mac.

和平。

这篇关于如何正确界定V7 appcompat的依赖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆