Flutter Build: FAILURE: Build failed with an exception

every time i try to build my app i get this error

Running Gradle task ‘assembleRelease’…

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:flutter_native_image:verifyReleaseResources’.

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

  • Try:

Run with –stacktrace option to get the stack trace.
Run with –info or –debug option to get more log output.
Run with –scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 17s
Running Gradle task ‘assembleRelease’… 18.5s
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1

this is my flutter doctor
flutter doctor -v
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.19045.4894], locale en-US)
• Flutter version 3.24.3 on channel stable at G:Flutter filesflutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (12 days ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain – develop for Android devices (Android SDK version 35.0.0)
• Android SDK at C:Usersyosf3AppDataLocalAndroidsdk
• Platform android-35, build-tools 35.0.0
• Java binary at: G:Android Studiojbrbinjava
• Java version OpenJDK Runtime Environment (build 17.0.10+0–11609105)
• All Android licenses accepted.

[√] Chrome – develop for the web
• Chrome at C:Program FilesGoogleChromeApplicationchrome.exe

[X] Visual Studio – develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the “Desktop development with C++” workload, including all of its default components

[√] Android Studio (version 2024.1)
• Android Studio at G:Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.10+0–11609105)

[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.4894]
• Chrome (web) • chrome • web-javascript • Google Chrome 129.0.6668.59
• Edge (web) • edge • web-javascript • Microsoft Edge 129.0.2792.52

[√] Network resources
• All expected network resources are available.

! Doctor found issues in 1 category.

New contributor

joo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Gradle is telling you the answer. In the failure output you pasted, this line has the important piece.

"G:shakawasystembuildflutter_native_imageintermediatesmerged_resreleasevaluesvalues.xml:194: AAPT: error: resource android:attr/lStar not found."

Specifically the resource of android:attr/lStar not found is not found. This looks to be a failure in the flutter_native_image package. Unfortunately it looks like this project is discontinued.

If you are looking to resize images you can check out this website as a potential option.

The error you’re encountering (resource android:attr/lStar not found) is related to a compatibility issue between the Flutter package flutter_native_image and the Android SDK version or the Gradle setup you’re using.

See some steps you can follow to resolve the issue, I’ll break it down

1. Update compileSdkVersion and targetSdkVersion

  • This error often occurs when the SDK versions in your
    android/app/build.gradle are lower than the required version. Update
    the compileSdkVersion and targetSdkVersion to 33 or higher.
    See an example here, in your android/app/build.gradle, update this:
android {
    compileSdkVersion 33
    defaultConfig {
        targetSdkVersion 33
    }
}

2. Update the Gradle Plugin and Wrapper

  • Ensure you’re using the latest version of the Gradle plugin and
    wrapper. Update the android/build.gradle file:
dependencies {
    classpath 'com.android.tools.build:gradle:8.1.0'
}

Also, make sure your gradle-wrapper.properties file has the latest Gradle version:

distributionUrl=https://services.gradle.org/distributions/gradle-8.1-all.zip

3. Clean and Rebuild the Project

  • After updating, make sure you run the following commands to clean and
    rebuild the project and see the result:
flutter clean
flutter pub get

Then, try building again:

flutter build apk --release

4. Check for Dependencies

  • Sometimes dependencies might not be compatible with the latest SDK
    versions. Ensure that the flutter_native_image package you’re
    using is up to date. If the issue persists, you might look for an
    alternative package or consider checking the open issues on the
    flutter_native_image GitHub repository.

    Link: https://github.com/btastic/flutter_native_image.git

5. Check for Specific Android Version in Packages

  • If flutter_native_image is not actively maintained or has
    compatibility issues with SDK 33+, consider adding the following to
    android/build.gradle to ignore certain issues:
android {
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

6. Review Flutter Plugin Version

  • Ensure that your Flutter SDK and its plugins are up to date by
    running:
flutter upgrade

Try applying these changes, you should be able to resolve the build failure you’re encountering. Let me know if you need further assistance!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật