DavBfr / dart_pdf

Pdf creation module for dart/flutter
https://pub.dev/packages/pdf
Apache License 2.0
1.39k stars 613 forks source link

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

Open brianngeywo opened 1 month ago

brianngeywo commented 1 month ago

The bug When attempting to build the APK for my Flutter project, the build process fails with the following error:

flutter build apk

You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':printing:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:C:\Users\Public\Engineer\projects\dart\baraton_soko\build\printing\intermediates\merged_res\release\values\values.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 13s
Running Gradle task 'assembleRelease'...                           14.9s
Gradle task assembleRelease failed with exit code 1

AAPT: error: resource android:attr/lStar not found. Additionally, there is a deprecation warning about the Gradle plugin usage.

To Reproduce flutter build apk Expected behavior The APK should build successfully without errors related to missing resources or deprecation warnings.

Screenshots N/A

Flutter Doctor


[√] Flutter (Channel master, 3.24.0-1.0.pre.27, on Microsoft Windows [Version 10.0.22631.3880], locale en-US)
    • Flutter version 3.24.0-1.0.pre.27 on channel master at C:\tools\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 1cec4ef20c (4 weeks ago), 2024-07-05 03:37:38 -0400
    • Engine revision ba9c7b6336
    • Dart version 3.5.0 (build 3.5.0-323.0.dev)
    • DevTools version 2.37.0

[√] 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:\Users\Administrator\AppData\Local\Android\sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: C:\Users\Administrator\AppData\Local\Programs\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.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 2023.1)
    • Android Studio at C:\Users\Administrator\AppData\Local\Programs\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.7+0-b2043.56-10550314)

[√] VS Code, 64-bit edition (version 1.91.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.92.0

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22631.3880]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 127.0.6533.73
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 127.0.2651.74

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

! Doctor found issues in 1 category.

am running on Android

Aljnk commented 1 month ago

Same problem

Only for - flutter build apk. If I use flutter run - no any error

Zeyad-Amr commented 1 month ago

I'm facing the same android:attr/lStar not found error during the build. Has anyone found a solution or workaround?

DavBfr commented 1 month ago

Try the latest version: printing 5.13.2

Zeyad-Amr commented 1 month ago

Try the latest version: printing 5.13.2

Thanks, it works!

wemgl commented 1 month ago

I just ran into this issue. Still looking for a workaround or fix.