V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
shiji
V2EX  ›  问与答

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

  •  
  •   shiji · Apr 16, 2016 · 3297 views
    This topic created in 3675 days ago, the information mentioned may be changed or developed.
    其实软件就是 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

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

    谢谢
    Supplement 1  ·  Apr 17, 2016
    补充一下,首先 gitcheck out 的是最新的 tag
    然后命令行下用 sbt 编译打包的时候其实也会出现同样的 error ,但是貌似直接给它忽略掉了
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   909 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 21:06 · PVG 05:06 · LAX 14:06 · JFK 17:06
    ♥ Do have faith in what you're doing.