skip to Main Content
  • What went wrong:
    Execution failed for task ‘:flutter_barcode_scanner:verifyReleaseResources’.

A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
Android resource linking failed
ERROR: C:Usersfismfsourcereposministry_financebuildflutter_barcode_scannerintermediatesmerged_resreleasevaluesvalues.xml:6135: AAPT: error: resource android:attr/lStar not found.

i did this but still not solved "android {
namespace "com.example.flutter_barcode_scanner" // Replace with the actual package name
compileSdkVersion 33
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
}
}"

2

Answers


  1. According to the package issue here: Issue link

    You can try to do the following in your android/build.gradle

    subprojects {
    afterEvaluate { project ->
        if (project.plugins.hasPlugin("com.android.application") ||
                project.plugins.hasPlugin("com.android.library")) {
            project.android {
                compileSdkVersion 34
                buildToolsVersion "34.0.0"
            }
        }
      }
    }
    

    As the package is outdated, please refer to the issue tabs of the related package.

    Login or Signup to reply.
  2. I noticed an issue with the namespace declaration made by you:

    android {
        namespace = "com.example.flutter_barcode_scanner"
        //...other build.gradle configurations here
    }
    

    If you still haven’t noticed it early, especially in production, you’ll have an issue with the deployed project and the patch update. So please, if you have a plugin that you want to use.

    Here’s the documentation about this,

    Every Android app has a unique application ID that looks like a Java
    or Kotlin package name, such as com.example.myapp. This ID uniquely
    identifies your app on the device and in the Google Play Store.

    Important: Once you publish your app, you should never change the
    application ID. If you change the application ID, Google Play Store
    treats the upload as a completely different app. If you want to upload
    a new version of your app, you must use the same application ID and
    signing certificate as when originally published.

    Source is from the official site of the Android Developer

    So, I hope now you know what to do.

    Moreover, it is better to use the terminal like this.

    (in your IDE terminal)

    Do this if you want to add a certain plugin (you want to add an extra feature in your app)

    PS C:your_project_default_directory>flutter pub add flutter_barcode_scanner
    

    If you want to remove that plugin

    PS C:your_project_default_directory>flutter pub remove flutter_barcode_scanner
    

    It will automatically added or removed to/from your pubspec.yaml file

    I recommend this approach because it is compatibility-safe (i.e., providing a version that is compatible with your current build), but of course, compatible only if your environment is compatible with the plugin you’re using (e.g., Flutter version, Java SDK version, Gradle version, Kotlin version, etc.)

    You can ONLY manually add your plugin to your pubspec.yaml file if you know what you’re doing, but if you are new to the framework, I advice you to use the better one (i.e., using terminal command).

    It will save time and it will save you as well XD

    However, if you are having confusion with the exception you’re dealing.

    Please do this in your terminal:

    PS C:your_project_default_directory>cd android
    

    For release info logs-checker

    PS C:your_project_default_directoryandroid>./gradlew assembleRelease --info
    

    For debug info logs-checker

    PS C:your_project_default_directoryandroid>./gradlew assembleDebug --info
    

    By following the aforementioned practices to identify the root cause, you can resolve it on your own. But if there’s still an unresolved issue or error, you can include it in your question.

    I hope it helps!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search