-
Notifications
You must be signed in to change notification settings - Fork 167
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
[BUG] AAPT: error: resource android:attr/lStar not found. #369
Comments
Same here. It stopped working since latest Flutter upgrade. Works in debug mode but not in release. |
Post both your gradle files. nobody is specifying what version of the plug-in they’re using. |
build.gradle:
Using latest plugin version and latest Flutter version. |
First-of-all, the maven repo jcenter() has been deprecated since 2021. second, you’ve not fully implemented the Android setup instructions linked in the readme (the I suggest you generate a fresh hello-world app and compare the changes in the default build.gradle with those in your own app. you’ve failed to properly upgrade your app with the latest requirement of the latest flutter SDK. That’s why you have problems. |
I am getting same issue allprojects { rootProject.buildDir = '../build' tasks.register("clean", Delete) { |
See my comment above: #369 (comment) you did not fully implement the Setup Instructions ( |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
I just have added below
|
I am using Flutter 3.24.0 • channel stable , while building resale apk i am getting ... |
Try to add below
|
I have tried this but the problem is same, can not build the release apk. |
I'm also using Flutter 3.24.0, but I can build the release APK.
If the problem is still there, you need to post your |
This problem is related to the compileSdkVersion and targetSdkVersion of the plugins. This problem occurs because the compileSdkVersion and targetSdkVersion of some plugins are outdated. Either go to the source files of the plugin in your project and make the compileSdkVersion and targetSdkVersion versions the same as your project (version 34 compatible), or add the code block below to the build.gradle file in your project directory.
This code is a Gradle configuration script used in Android projects. The subprojects block allows you to configure certain settings for all subprojects (modules) in the project. The android block inside defines Android-related configuration settings, and the compileSdkVersion 34 line allows projects to be compiled with Android API 34. |
Post both your .gradle files. |
app/build.gradle`allprojects { rootProject.buildDir = "../build" subprojects { subprojects { tasks.register("clean", Delete) { |
Post the entire contents of both your gradle files:
|
You have not added
|
@Aziz-T i suggest you consult with the required Android Setup Instructions, linked in the readme and carefully follow ALL the instructions. |
I upgraded cupertino_icons to the latest version and it works now hope this helps someone. |
If you are like me and have updated to the new Flutter version, You can consider this temporary solution |
My plug-ins never hard-code sdk versions, they read them from we learned to do this years ago in the React Native world. |
bhai tera huaa kya, m b pareshaan hu |
rootProject.buildDir = "../build" tasks.register("clean", Delete) { |
ext { subprojects { afterEvaluate { android { compileSdkVersion 34 } } } it working for me for release build in latest flutter 3.24 version. |
I am facing the same problem, def localProperties = new Properties() def flutterVersionCode = localProperties.getProperty('flutter.versionCode') def flutterVersionName = localProperties.getProperty('flutter.versionName') android {
} flutter { dependencies {} |
Same issues +++++++++++++++++++++++++++ 1: Task failed with an exception.
2: Task failed with an exception.
|
Search "AAPT: error: resource android:attr/lStar not found.": https://stackoverflow.com/questions/69033022/message-error-resource-androidattr-lstar-not-found |
100% working solution: the problem is with background_fetch package that you used in pubspec.yaml. comment or remove this package then make the build. it will must work. note: the to find the problem: when you get the error check the direction first.ERROR:/home/sonu/projects/flutter/H-ATTENDANCE/build/background_fetch/intermediates/merged_res/release/values/values.xml:2520: AAPT: error so here: search immediate folder after build folder. here immediate folder is 'background_fetch'. so, the problem is in backgroudn fetch package. there may have file missing when the package is downloaded. this is why the error(resource android:attr/lStar not found) came. |
No!. This error is typically associated with the Android dependency check your people having problems with this likely have multiple plugins importing different versions of this dependency. Consult https://maven.google.com to see a dependency tree of your app, execute: $ ./gradlew app:dependencies |
This plug-in is happy to import any version of {
appCompatVersion = "1.4.2" // or higher / as desired
} |
I was facing this issue, and finded a fix to my case. In my case, the issue was the PDF package and PRINTING package. Upgraded to this versions and fixed the issue: If you use firebase too, consider reading this PR: firebase/flutterfire#13200 |
Would really help me if someone can check my code or give any advise. My current versions are: Channel -> Stable The problem only occurs in release mode, not debug. What went wrong:Execution failed for task
I upgraded my dependencies in
Tried resources: app/build.gradleplugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
android {
// Added by the comments
def buildConfig = rootProject.extensions.getByName("ext")
compileSdkVersion rootProject.ext.compileSdkVersion // Added checking the INSTALL-ANDROID.md
namespace = "com.example.newflutter"
compileSdk = 34
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId = "com.example.newflutter"
minSdk = 21
targetSdk = 34
versionCode = flutter.versionCode
versionName = flutter.versionName
// Added checking the INSTALL-ANDROID.md
targetSdkVersion rootProject.ext.targetSdkVersion
}
buildTypes {
release {
signingConfig = signingConfigs.debug
}
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.work:work-runtime:2.7.0'
implementation project(path: ':gdpr_dialog')
}
flutter {
source = "../.."
}
android/build.gradlebuildscript {
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2' // or 8.0.2 for Java 11+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.15'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "${project(':background_fetch').projectDir}/libs" }
}
configurations.all {
resolutionStrategy {
force "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
}
ext {
compileSdkVersion = 34
targetSdkVersion = 34
// Had an error with the compiler changed from 1.7 to 1.6.1 works now
appCompatVersion = "1.6.1"
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
} |
Show me the result of the following command (it’s a lot of output)
|
Try version |
Add this to android/build.gradle subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android { compileSdkVersion 34 }
}
}
} |
In version
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android { compileSdkVersion 34 }
}
}
} This plugin does not require this if you provide the required Of course, other plugins may have hard-coded |
This plug-in does not use Kotlin. |
how to resolve it? |
I have no idea. The plug-in has nothing to do with Kotlin version. |
worked for me |
Adding this workaround on our android/build.gradle has resolved the issue for us. subprojects {
afterEvaluate { project ->
if (project.plugins.hasPlugin("com.android.application") ||
project.plugins.hasPlugin("com.android.library")) {
project.android {
compileSdkVersion 34
buildToolsVersion "34.0.0"
}
}
}
} |
@ahmedevcode thank you. It works |
FAILURE: Build failed with an exception.
BU�LD FAILED in 51s |
this works for me, tks man |
Execution failed for task ':background_fetch:verifyReleaseResources'.
The text was updated successfully, but these errors were encountered: