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

AAPT: error: resource android:attr/lStar not found. #120

Open
SX-Code opened this issue Sep 2, 2024 · 8 comments
Open

AAPT: error: resource android:attr/lStar not found. #120

SX-Code opened this issue Sep 2, 2024 · 8 comments

Comments

@SX-Code
Copy link

SX-Code commented Sep 2, 2024

问题描述

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ota_update:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/Users/swcode/Documents/FlutterProjects/test_package/build/ota_update/intermediates/merged_res/release/values/values.xml:211: AAPT: error: resource android:attr/lStar not found.

flutter --version: Flutter 3.24.0

将版本回退到3.22.0,该问题消失。

@fuadarradhi
Copy link

same here, temporary fix

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

@oggers
Copy link

oggers commented Sep 3, 2024

@fuadarradhi Where should I include this snippet?

@fuadarradhi
Copy link

@fuadarradhi Where should I include this snippet?

android/build.gradle.

@oggers
Copy link

oggers commented Sep 4, 2024

@fuadarradhi thank you. It didn't work until I commented out the previous block containing project.evaluationDependsOn(':app')

Here is my android/build.gradle:

// build.gradle (allprojects)

// Set up repositories for dependencies

allprojects {
    repositories {
        google()
        mavenCentral()
    }

    // Set the build directory
    rootProject.buildDir = '../build'

    // Configure subprojects
    subprojects {
        project.buildDir = "${rootProject.buildDir}/${project.name}"
    }

    // Ensure evaluation depends on the app module
    //subprojects {
    //    project.evaluationDependsOn(':app')
    //}

    // Commented previous block and inserted this block, as indicated by
    // https://github.com/4Q-s-r-o/ota_update/issues/120
    subprojects {
        afterEvaluate { project ->
            if (project.plugins.hasPlugin("com.android.application") ||
                    project.plugins.hasPlugin("com.android.library")) {
                project.android {
                    compileSdkVersion 34
                    buildToolsVersion "34.0.0"
                }
            }
        }
    }

    // Register a clean task
    //tasks.register("clean", Delete) {
    //    delete rootProject.buildDir
    //}
}

@KyoShio
Copy link

KyoShio commented Sep 11, 2024

+1

@pierrecorsini
Copy link

pierrecorsini commented Sep 21, 2024

I encountered the same problem; the workaround worked.
Could someone provide more details about the root cause ? This seems linked to sdk version not being updated to 34; but what package is concerned and where should it be fixed ?

@ogak-github
Copy link

Also have this error when run in profile mode.

@eduardohr-muniz
Copy link

eduardohr-muniz commented Oct 11, 2024

This pull request resolve this bug #121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants