V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
shiji
V2EX  ›  问与答

尝试编译安卓程序 Error retrieving parent for item: No resource found that matches the given name

  •  
  •   shiji · 2016-04-16 22:30:12 +08:00 · 3008 次点击
    这是一个创建于 3100 天前的主题,其中的信息可能已经有所发展或是发生改变。
    其实软件就是 SS ,想学习安卓,看看这东西是怎么写的。

    想预览一下 layout ,总是报错:
    Rendering Problems Missing styles.
    Is the correct theme chosen for this layout?
    Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.

    NOTE: One or more layouts are missing the layout_width or layout_height attributes. These are required in most layouts.
    Or: Automatically add all missing attributes
    The following classes could not be found:

    - android.support.v7.widget.Toolbar (Fix Build Path, Edit XML, Create Class)

    Tip: Try to build the project.
    Couldn't resolve resource @style/ThemeOverlay.AppCompat.Dark.ActionBar (3 similar errors not shown) Failed to find style 'switchStyle' in current theme (18 similar errors not shown) Exception raised during rendering: Color value '?android:attr/textColorSecondary' must start with # (Details) (2 similar errors not shown)

    尝试 Make 也会出现类似的错误:
    Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.Widget.AppCompat.Toolbar.Title'.
    Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
    Error: No resource found that matches the given name: attr 'colorAccent'.
    ...后面还有十多个一样的错误

    等等都是类似这样的问题,用的是 API 23 , java1.8

    查了一下,发现这个 AppCompat 是 API7 的东西, SDK 工具里面我也安装了 Android Support Library
    ~/Library/Android/sdk/extras/android/support/v7/ 里面也是有 appcompat

    那么我怎么才能把它导进去呢?试了几种方法都依旧出错

    谢谢
    第 1 条附言  ·  2016-04-17 01:42:11 +08:00
    补充一下,首先 gitcheck out 的是最新的 tag
    然后命令行下用 sbt 编译打包的时候其实也会出现同样的 error ,但是貌似直接给它忽略掉了
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2551 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 12:24 · PVG 20:24 · LAX 05:24 · JFK 08:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.