Bug 53053 - Invalid base theme used when theme created from designer
Summary: Invalid base theme used when theme created from designer
Alias: None
Product: Android
Classification: Xamarin
Component: Designer ()
Version: 7.2 (15.1)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Jérémie Laval
Depends on:
Reported: 2017-03-04 14:15 UTC by Marek Habersack
Modified: 2017-03-07 16:18 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 53053 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Marek Habersack 2017-03-04 14:15:40 UTC
The application uses `@style/Theme.AppCompat` as its default theme:

   <application android:allowBackup="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:theme="@style/Theme.AppCompat"></application>

And when the designer's Theme Editor is used to save a new theme after modifying the app colors, the following theme file is generated:

  <?xml version="1.0" encoding="UTF-8"?>
        <color name="theme_appcompat_background">#ff03071c</color>
        <style name="Theme.Custom" parent="@android:style/Theme.AppCompat">
                <item name="android:colorBackground">@color/theme_appcompat_background</item>
                <item name="android:windowBackground">?android:attr/colorBackground</item>
                <item name="android:colorPrimary">#ff3949ab</item>
                <item name="android:colorPrimaryDark">#ff1a237e</item>
                <item name="android:colorAccent">#ffc51162</item>

Note the `parent` attribute value - the `android:` prefix should not have been used since the app's theme does not use it. The end result is this AAPT error when trying to package the app:

  Resources/values/theme.xml(2): error APT0000: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.AppCompat'
Comment 1 Marek Habersack 2017-03-04 14:18:09 UTC
Forgot to mention, this is with:

   tip of the mono 4.8.0 branch (Mono JIT compiler version 4.8.0 (mono-4.8.0-branch/0494d702876 Sat  4 Mar 13:20:17 CET 2017)
   Ubuntu 16.10 64-bit
   Oracle Java 1.8.121
   Android Build Tools 25.0.2