As an Android developer, you might have encountered a common issue while building your project. The “AAPT: Error: Resource Android:attr/lstar not found” error message can be frustrating and time-consuming to fix, especially if you are not familiar with the error or don’t know where to start looking for a solution. In this blog, we’ll discuss the causes of this error and walk you through the steps to fix it.
Understanding the “AAPT: Error: Resource Android:attr/lstar not found” Issue
The “AAPT: Error: Resource Android:attr/lstar not found” error message is a common build error that occurs when the Android Asset Packaging Tool (AAPT) cannot find the “lstar” resource in your project. The “lstar” resource is a style attribute used by the Android framework to set the default line spacing for text. This resource is usually defined in the appcompat library, which is included by default in most Android projects.
When the AAPT cannot find the “lstar” resource, it means that there is an issue with the appcompat library, or it’s not being included correctly in your project. This error can also occur if there is a conflict with another library that you are using in your project.
Fixing the “AAPT: Error: Resource Android:attr/lstar not found” Issue
Now that we understand the cause of the error let’s discuss how to fix it. Here are some steps you can take to resolve the “AAPT: Error: Resource Android:attr/lstar not found” issue.
Update the appcompat library
The first step in fixing this error is to update the appcompat library to the latest version. To do this, open the build. gradle file of your app module and add the latest version of the appcompat library to the dependencies section:
ArduinoCopy code
dependencies { implementation 'com.android.support:appcompat-v7:28.0.0' }
Replace the version number with the latest version available. You can find the latest version by visiting the Android developer website or by using the Android Studio’s “Project Structure” dialog.
Once you have updated the appcompat library, rebuild your project to see if the error has been resolved.

Clean and Rebuild the Project
If updating the appcompat library doesn’t fix the error, the next step is to clean and rebuild the project. This process will remove any intermediate build files and rebuild the project from scratch, which can help to resolve build issues.
To clean the project, go to the “Build” menu in Android Studio and select “Clean Project.” Once the cleaning process is complete, select “Rebuild Project” from the same menu.
This process can take some time, depending on the size of your project. Once the rebuild is complete, run the project and check if the error has been resolved.
Check for Conflicts with Other Libraries
If the error still persists after updating the appcompat library and cleaning the project, it’s possible that there is a conflict with another library in your project. To check for conflicts, review the dependencies section of your build. gradle file and make sure that there are no conflicting libraries.
If you find a conflict, you can exclude the conflicting library from the dependency using the exclude statement in the dependencies section. For example, if there is a conflict with the “support-v4” library, you can exclude it as follows:
SQLCopy code
dependencies { implementation ('com.android.support:appcompat-v7:28.0.0') { exclude group: 'com.android.support', module: 'support-v4' } }
Once you have excluded the conflicting library, rebuild the project and check if the error
The “lstar” resource is a style attribute used by the Android framework to set the default line spacing for text. This resource is usually defined in the appcompat library, which is included by default in most Android projects.
When the AAPT cannot find the “lstar” resource, it means that there is an issue with the appcompat library, or it’s not being included correctly in your project.