4Q-s-r-o / ota_update

Flutter plugin implementing OTA update for both iOS and Android
MIT License
182 stars 63 forks source link

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

Open SX-Code opened 2 months ago

SX-Code commented 2 months ago

问题描述

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 commented 2 months ago

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 commented 2 months ago

@fuadarradhi Where should I include this snippet?

fuadarradhi commented 2 months ago

@fuadarradhi Where should I include this snippet?

android/build.gradle.

oggers commented 2 months ago

@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 commented 2 months ago

+1

pierrecorsini commented 1 month ago

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 commented 1 month ago

Also have this error when run in profile mode.

eduardohr-muniz commented 1 month ago

This pull request resolve this bug #121