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 on release build #86

Open
BulbulH opened this issue Nov 2, 2023 · 14 comments
Open

Comments

@BulbulH
Copy link

BulbulH commented Nov 2, 2023

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':cached_video_player:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
Android resource linking failed
ERROR:C:\Users\Administrator\StudioProjects\mfacelook\build\cached_video_player\intermediates\merged_res\release\values\values.xml:141: 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.

BUILD FAILED in 1m 59s
Running Gradle task 'assembleRelease'... 120.6s
Gradle task assembleRelease failed with exit code 1

@walulyafrancis
Copy link

Am having the same problem
ERROR:C:\Users\HP.gradle\caches\transforms-3\d29dffee86f384b4b728ebb9ca805500\transformed\core-1.7.0\res\values\values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

@codersangam
Copy link

codersangam commented Nov 23, 2023

I fixed it by overriding package:
Go to android->build.gradle

Change compileSdkVersion to 33 and minSdkVersion to 21.

🔥 Works for Me!

Screenshot 2023-11-23 at 14 15 55

codersangam added a commit to codersangam/flutter_cached_video_player that referenced this issue Nov 23, 2023
@walulyafrancis
Copy link

I fixed it by overriding package: Go to android->build.gradle

Change compileSdkVersion to 33 and minSdkVersion to 21.

🔥 Works for Me!

Screenshot 2023-11-23 at 14 15 55

I have a library that requires compile SDK 34

@walulyafrancis
Copy link

walulyafrancis commented Nov 25, 2023

I will be using this forked version https://pub.dev/packages/cached_video_player_fork since it is working well in release until the issue is resolved

@Vadefolarin
Copy link

I have this same issues, and It took me days to figure out that its this package that is causing a build to fail.

@Vadefolarin
Copy link

I will be using this forked version https://pub.dev/packages/cached_video_player_fork since it is working well in release until the issue is resolved

This worked for me thanks

@walulyafrancis
Copy link

Found a decent solution from @
Yash Garg https://stackoverflow.com/questions/76749280/could-not-compile-my-app-in-release-mode-due-to-aapt-error-resource-androida with an explanation to why this happens in release and not in debug.

you need to add the dependency like this in your pubspec.yaml since the problem comes from the dependency gradle

 cached_video_player:
    git:
        url: https://github.com/vikram25897/flutter_cached_video_player
        ref: feature/gradle_version_bump

@walulyafrancis
Copy link

the plugin Kotilin version and targetSdkVersion need to be updated for a fix

@SantiagoPineapple
Copy link

Im using packages that needs "minSdkVersion 23" so I fixed using this installation

cached_video_player:
git:
url: https://github.com/vikram25897/flutter_cached_video_player
ref: feature/gradle_version_bump
and removing package="com.lazyarts.vikram.cached_video_player" from AndroidManifest located in the package, but only works locally

@PrashantSengar0523
Copy link

same as well but in flutter sound
anybody can help me
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':flutter_sound:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
Android resource linking failed

 ERROR:C:\Users\thaku\OneDrive\Desktop\MieRideDriver\MieRideDriver\build\flutter_sound\intermediates\merged_res\release\values\values.xml:2536: 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.

BUILD FAILED in 1m 7s

@JamesGZM
Copy link

JamesGZM commented Dec 23, 2024

same as well but in flutter sound同样,但在 Flutter Sound 中 anybody can help me  任何人都可以帮助我 FAILURE: Build failed with an exception.FAILURE:构建失败并出现异常。

  • What went wrong:  出了什么问题:
    Execution failed for task ':flutter_sound:verifyReleaseResources'.任务 ':flutter_sound:verifyReleaseResources' 执行失败。

A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action执行 com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action 时出错
Android resource linking failedAndroid 资源链接失败

 ERROR:C:\Users\thaku\OneDrive\Desktop\MieRideDriver\MieRideDriver\build\flutter_sound\intermediates\merged_res\release\values\values.xml:2536: AAPT: error: resource android:attr/lStar not found.  
  • Try:  尝试:

Run with --stacktrace option to get the stack trace.使用 --stacktrace 选项运行以获取堆栈跟踪。
Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获取更多日志输出。
Run with --scan to get full insights.使用 --scan 运行以获取完整的见解。

BUILD FAILED in 1m 7s在 1 分 7 秒内构建失败

#86 (comment)

after

Try this out

Add this at the end of allprojects in android/build.gradle

subprojects {
        afterEvaluate { project ->
            if (project.hasProperty('android')) {
                project.android {
                    def sdkVersion = compileSdkVersion.toString()
                    def sdkNumber = sdkVersion.replaceAll("[^0-9]", "").toInteger()
                    if (sdkNumber < 30) {
                        compileSdkVersion 30
                    }

                    buildFeatures {
                        buildConfig = true
                    }
                }
            }
        }
    }

@walulyafrancis
Copy link

walulyafrancis commented Dec 24, 2024

Can you please post your pubspec.yaml
APK releases have R8 which trys to shrink resources ending up not packaging some of them.

To prevent this, you need to add the package directly in your pubspec.yaml like this:

dependencies:
    cached_video_player:
        git:
          url: https://github.com/vikram25897/flutter_cached_video_player
          ref: feature/gradle_version_bump

@JamesGZM
Copy link

JamesGZM commented Jan 3, 2025

Can you please post your pubspec.yaml你能把你的 pubspec.yaml 发布吗 APK releases have R8 which trys to shrink resources ending up not packaging some of them.APK 版本具有 R8,它尝试缩小资源,最终不会打包其中一些资源。

To prevent this, you need to add the package directly in your pubspec.yaml like this:为了防止这种情况,你需要直接在 pubspec.yaml 中添加 package,如下所示:

dependencies:
    cached_video_player:
        git:
          url: https://github.com/vikram25897/flutter_cached_video_player
          ref: feature/gradle_version_bump
dependency_overrides:
  cached_video_player:
    git:
      url: https://github.com/vikram25897/flutter_cached_video_player
      ref: feature/gradle_version_bump

@walulyafrancis
Copy link

remove video_player_platform_interface: ^6.1.0

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