简体   繁体   中英

How to make aapt.exe resolve android styles in SDK Tools r12

Since updating my SDK Tools to r12, an existing project (with zero code changes) now fails during aapt generation with:

[INFO] C:\Dev\Android-sdk\platform-tools\aapt.exe [package, -m, -J, C:\Source\android\Jumblee\target\generated-sources\r, -M, C:\Source\android\Jumblee\target\filtered-manifest\AndroidManifest.xml, -S, C:\Source\android\Jumblee\target\generated-sources\combined-resources\res, --auto-add-overlay, -I, C:\Dev\Android-sdk\platforms\android-10\android.jar]

[INFO] C:\Source\android\Jumblee\target\generated-sources\combined-resources\res\values\theme.xml:16: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/WindowTitle.

The relevant lines from the resource file are:

<!-- Set the theme for the window title -->
<!-- NOTE: setting android:textAppearance to style defined above --
<style name="CustomWindowTitle" parent="@android:style/WindowTitle">
     <item name="android:textAppearance">@style/CustomWindowTitleText</item>
</style>

Has anyone seem something similar? Or better still know wtf is going on?

OK the issue I raised was http://code.google.com/p/android/issues/detail?id=18659

It turns out that @android:style/WindowTitle and a few other styles that people have been using are not published styles.

So the proper solution is to stop using those private styles. And the most appropriate way of doing that it is probably to copy the style in question to your own project and make it your own style.

Found Hot Fix , but yes it's just hot fix. Looking for better solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM