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

2016-04-16 22:30:12 +08:00
 shiji
其实软件就是 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

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

谢谢
3008 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/271658

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX