appcompat-v721.0.0' No resource found that matches the given name attr 'androidactionModeShareDrawable'
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
In the world of Android development, the AppCompat library serves as a key component in ensuring backward compatibility with previous versions of Android while maintaining a consistent look and feel of applications on diverse devices. A common issue developers may run into is the error message: "No resource found that matches the given name: attr 'android:actionModeShareDrawable'" when using `appcompat-v7:21.0.0`. Let's delve into why this error occurs and how to resolve it effectively.
Understanding the Error
The error "No resource found that matches the given name: attr 'android:actionModeShareDrawable'" typically occurs in reference to a missing or inaccessible resource in your Android project. This specific attribute, `android:actionModeShareDrawable`, is part of the core Android resource set introduced in a certain API level but may be unavailable in `appcompat-v7:21.0.0`.
Why This Happens
- API Level Mismatch: The `android:actionModeShareDrawable` attribute is added in a later API level than what some components in `appcompat-v7:21.0.0` might support.
- Library Version: The `appcompat-v7:21.0.0` library might be using attributes that are not defined within its supported API level range. This can happen if the library is expecting API 21 resources, but your project is configured for a lower API level.
- Resource Conflicts: Conflicts can occur if your application or other libraries using the AppCompat theme try to access resources that are not yet available.
Resolving the Issue
To address this error, developers can employ several strategies. Below is a comprehensive approach to resolving this error:
1. Update the SDK and Libraries
Ensure that your Android SDK and related libraries are up to date. You can do this by navigating to the SDK Manager in Android Studio and ensuring all installed packages are updated.
2. Use a Compatible appcompat Library Version
Check and configure your project to use a compatible version of the appcompat library. You might need a more recent version than `appcompat-v7:21.0.0` if defining attributes like `android:actionModeShareDrawable`.
Related reading
- AppCompat v7 r21 returning error in values.xml?
- appearanceWhenContainedIn in Swift
- appearanceWhenContainedIn in Swift
- Append data to a POST NSURLRequest
- AppFabric unable to create a DataCache (LMTRepopulationJob FAILS)
- Apple M1 can't start the confluent control center using docker
- Append String in Swift
- Appending NSDictionary to other NSDictionary
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.