【问题标题】:How to add v7 support lib with resources in android studio?如何在 android studio 中添加带有资源的 v7 支持库?
【发布时间】:2014-05-30 18:54:32
【问题描述】:

我正在尝试将 AppCompat 中的主题用作我的父级,但似乎我无法包含资源。 例如:

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

给我一​​个错误:

错误:任务“:processDebugResources”执行失败。 com.android.ide.common.internal.LoggedErrorException:无法运行命令: G:\Android\android-studio\sdk\build-tools\19.0.3\aapt.exe 包 -f --no-crunch -I G:\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 -A E:\Studio\Git\face_rec_android\build\assets \debug -m -J E:\Studio\Git\face_rec_android\build\source\r\debug -F E:\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:错误:检索项目的父项时出错:找不到与给定名称匹配的资源 '@style/Theme.AppCompat.Light.DarkActionBar '。

我尝试过包含显然没有资源但主要使用build.gradle 之类的 jar 文件

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

我有什么办法可以做到这一点? 由于那里没有 build.gradle 文件,因此无法从额外模块导入。

【问题讨论】:

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


【解决方案1】:

您需要从 SDK Manager 中下载这个 lib,它放在 Android SDK 文件夹中,然后转到 sdk 文件夹/extras/android/v7/ 找到 .jar lib 文件并将此文件放入项目的 library 文件夹中。

【讨论】:

  • 正如我在问题中提到的.. jar 文件中没有资源。
猜你喜欢
  • 1970-01-01
  • 2014-12-30
  • 2013-07-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-23
  • 2015-10-04
相关资源
最近更新 更多