Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: ImergeDebugResources-17:/values/values.xml:3874: error: style attribute 'android:attr/customOperation1' not found. error: failed linking references. #1187

Closed
3 of 5 tasks
e-Mood opened this issue Oct 12, 2023 · 5 comments
Labels
P3 Issues that we currently consider unimportant. platform: android Issue is related to the Android platform. type: question Issue contains a question about the project

Comments

@e-Mood
Copy link

e-Mood commented Oct 12, 2023

Please check the following before submitting a new issue.

Please select for which platform(s) you need help

  • Android
  • iOS
  • Windows

Your question

mergeDebugResources-17:/values/values.xml:3874: error: style attribute 'android:attr/customOperation1' not found.
error: failed linking references.

I met above compile error while compile my demo apk when I want to use the attrs added by myself in /frameworks/base/core/res/res/values/attrs.xml and public.xml .
In framework I add atts customOperation1 and framework compile OK, and then I configured dependence of classes.jar in Android Studio gradle file . But when I uses the attrs customOperation1 in my demo apk's theme , there's above error.

Something more : I added some interfaces in framework and configured classes.jar in my demo apk project ,and it can compile well. And also no problem at runtime when I called the interfaces added in framework.

So why the added attrs can not work ? Anyone any suggestions ?

Version

1

@e-Mood
Copy link
Author

e-Mood commented Oct 12, 2023

Below is the code in my demo app theme try to use added attrs:
<item name="android:customOperation1">@drawable/decor_maximize_button_light</item>

@JeroenWeener
Copy link
Contributor

Hi @e-Mood,

Is this a question specific to the permission handler? From the information you provided it seems to me that you require help directed at Android and its build process.

@JeroenWeener JeroenWeener added platform: android Issue is related to the Android platform. status: needs more info We need more information before we can continue work on this issue. type: question Issue contains a question about the project P3 Issues that we currently consider unimportant. labels Oct 12, 2023
@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label Oct 12, 2023
@e-Mood
Copy link
Author

e-Mood commented Oct 12, 2023

Hi @e-Mood,

Is this a question specific to the permission handler? From the information you provided it seems to me that you require help directed at Android and its build process.

Hi @JeroenWeener,
Sorry for require help from wrong place. Yes I want help at Android and its build process

@JeroenWeener
Copy link
Contributor

No worries. You can find help at several places online. For example the Android Stack Exchange: https://android.stackexchange.com/ and StackOverflow: https://stackoverflow.com/.

Having a quick glance at your question, the problem might be coming from the way you access your custom attr. If my memory serves me well, android:attr retrieves attributes bundled with the Android SDK. To access your attr you should leave out android. Your line of code would then become attr/customOperation1. I don't think you should be editing /frameworks/base/core/res/res/values/attrs.xml as this is part of the Android SDK. Instead, create your own attrs.xml file in the values directory in your project.

@e-Mood
Copy link
Author

e-Mood commented Oct 12, 2023

No worries. You can find help at several places online. For example the Android Stack Exchange: https://android.stackexchange.com/ and StackOverflow: https://stackoverflow.com/.

Having a quick glance at your question, the problem might be coming from the way you access your custom attr. If my memory serves me well, android:attr retrieves attributes bundled with the Android SDK. To access your attr you should leave out android. Your line of code would then become attr/customOperation1. I don't think you should be editing /frameworks/base/core/res/res/values/attrs.xml as this is part of the Android SDK. Instead, create your own attrs.xml file in the values directory in your project.

@JeroenWeener Thanks for your suggestion, I'm a framework developer and want to add our custom attrs in framework ,so our APP developers can use them in their app project . Then framework can implement specific features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Issues that we currently consider unimportant. platform: android Issue is related to the Android platform. type: question Issue contains a question about the project
Projects
None yet
Development

No branches or pull requests

2 participants