Custom attribute not resolved inside styles and theme
Asked Answered
U

1

6

I have android application with custom themes which was developed 2-3 year ago. I had this stylable in my attr.xml resouce file:

<declare-styleable name="EVETextViewPlus">
    <attr name="customFont" format="string" />
    <attr name="pageStripFont" format="string" />
</declare-styleable>

And I've used this inside my style_warm.xml resource file:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
    <style name="style_display_page_title_warm">
        <item name="my.app.package.:pageStripFont">fonts/b_titr.ttf</item>
        <item name="android:textSize">25dp</item>
        <item name="android:textColor">@color/colorDisplayPageTitle</item>
    </style>
....

When I'm going to sign my app, it checks for errors and prompts:

Cannot resolve symbol 'my.app.package:pageStripFont'

I should mention my.app.package is package name of my application defined in manifest.

This is piece of code which was working until 2 years ago and when I migrated my application to latest android SDK tools, Gradle and androidX, this error was eventually appeared and I don't know what's wrong.

I did see this answer, this one but I could not find the problem.

I also checked this and this which see more revelant but I did not realize how to fix the error.

Upheave answered 19/7, 2019 at 15:11 Comment(0)
D
3

Replace this

<item name="my.app.package.:pageStripFont">fonts/b_titr.ttf</item>

with this

<item name="pageStripFont">fonts/b_titr.ttf</item>
Deerstalker answered 2/8, 2019 at 14:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.