如何在android studio中添加带有资源的v7支持库?

时间:2014-05-30 10:01:45

标签: android android-studio android-support-library

我试图使用AppCompat中的Theme作为我的父级,但似乎我无法包含资源。 例如:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="CustomActionBarTheme"
           parent="@style/Theme.AppCompat.Light.DarkActionBar">
    </style>
</resources>

给了我一个错误:

  

错误:任务&#39;:processDebugResources&#39;执行失败。   com.android.ide.common.internal.LoggedErrorException:无法运行命令:       G:\ Android \ android-studio \ sdk \ build-tools \ 19.0.3 \ aapt.exe包-f --no-crunch -IG:\ Android \ android-studio \ sdk \ platforms \ android-19 \ android。 jar -ME:\ Studio \ Git \ face_rec_android \ build \ manifests \ debug \ AndroidManifest.xml -SE:\ Studio \ Git \ face_rec_android \ build \ res \ all \ debug -AE:\ Studio \ Git \ face_rec_android \ build \ assets \ debug -m -JE:\ Studio \ Git \ face_rec_android \ build \ source \ r \ debug -FE:\ Studio \ Git \ face_rec_android \ build \ libs \ face_rec_android-debug.ap_ --debug-mode --custom-package in.amolgupta.helpingfaceless   错误代码:       1   输出:       E:\ Studio \ myapp \ build \ res \ all \ debug \ values \ values.xml:127:错误:检索项目的父项时出错:找不到与给定名称匹配的资源&#39; @ style / Theme.AppCompat。 Light.DarkActionBar&#39;

我已经尝试过包含jar文件,该文件显然没有资源但主要与build.gradle一起玩

dependencies {
        compile 'com.android.support:appcompat-v7:19.1.+'
    }

我能以任何方式完成这项工作吗? 无法从extra中导入模块,因为那里没有build.gradle文件。

1 个答案:

答案 0 :(得分:0)

您需要从位于Android SDK文件夹中的SDK Manager下载此lib,然后转到sdk文件夹/ extras / android / v7 / find .jar lib文件并将此文件放入项目的库文件夹中。

相关问题