Open kururu-abdo opened 2 months ago
I'm having this issue too when building an android APK
Me to:
I was trying flutter build apk
and was facing the same issue. Than I tried to update the kotin version insdie settings.gradle to 2.0.20
. After that I made the following changes to:
~/.pub-cache/hosted/pub.dev/flutter_barcode_scanner-2.0.0/android/build.gradle
android {
compileSdkVersion 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
}
}
the compilesdk and tragetsdk versions should follow the project versions.
Than flutter clean; flutter pub get; flutter build apk
and it worked.
Facing the same issue
This helped me temporarily fix the issue (seems to be related to Flutter 3.24):
in android/build.gradle
subprojects {
afterEvaluate { project ->
if (project.plugins.hasPlugin("com.android.application") ||
project.plugins.hasPlugin("com.android.library")) {
project.android {
compileSdkVersion 34
buildToolsVersion "34.0.0"
}
}
}
}
https://github.com/livekit/client-sdk-flutter/issues/569#issuecomment-2275686786
I found the same solution as others. changing the compileSdkVersion and targetSdkVersion from 30 to 31 in the package's build.gradle file fixed the issue:
android {
compileSdkVersion 31
defaultConfig {
minSdkVersion 16
targetSdkVersion 31
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
}
}
Error when building for release (debug didn't show the error for some reason):
Execution failed for task ':flutter_barcode_scanner:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
> Android resource linking failed
ERROR:/Users/-/IDZ/flutter-app/zcloud/build/flutter_barcode_scanner/intermediates/merged_res/release/values/values.xml:6135: AAPT: error: resource android:attr/lStar not found.
This PR should fix this issue as it updates the compileSdkVersion and targetSdkVersion to 34: https://github.com/AmolGangadhare/flutter_barcode_scanner/pull/348
To temporary solve the issue you can use this following code:
Replace it in pubspec.yaml file
flutter_barcode_scanner:
git:
url: https://github.com/wrteam-anish/flutter_barcode_scanner.git
ref: master
Thank you!
+1
I'll give it a try, thanks!
simple_barcode_scanner 0.1.1 depends on flutter_barcode_scanner ^2.0.0 and no versions of simple_barcode_scanner match >0.1.1 <0.2.0, simple_barcode_scanner ^0.1.1 requires flutter_barcode_scanner from hosted. So, because app depends on both flutter_barcode_scanner from git and simple_barcode_scanner ^0.1.1, version solving failed.
I tried building with compileSdk = 34 minSdk = 33 targetSdk = 34
Flutter version: 3.24.2-stable Kotlin version: 1.7 Gradle version: 7.6 JDK: 19.0.2
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':flutter_barcode_scanner:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
> Android resource linking failed
ERROR:<path to project DIR>\build\flutter_barcode_scanner\intermediates\merged_res\release\values\values.xml:6135: AAPT: error: resource android:attr/lStar not found.
I tried building with compileSdk = 34 minSdk = 33 targetSdk = 34
Flutter version: 3.24.2-stable Kotlin version: 1.7 Gradle version: 7.6 JDK: 19.0.2
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':flutter_barcode_scanner:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action > Android resource linking failed ERROR:<path to project DIR>\build\flutter_barcode_scanner\intermediates\merged_res\release\values\values.xml:6135: AAPT: error: resource android:attr/lStar not found.
set minSdk = 21
and try also delete .gradle
folder and delete pubspec.lock
This helped me temporarily fix the issue (seems to be related to Flutter 3.24):
in
android/build.gradle
subprojects { afterEvaluate { project -> if (project.plugins.hasPlugin("com.android.application") || project.plugins.hasPlugin("com.android.library")) { project.android { compileSdkVersion 34 buildToolsVersion "34.0.0" } } } }
This solution worked for me
I have a similar issue is there any way to resolve it? Can any buddy help with the below? I am facing an issue after upgrading to Flutter version 3.24.1
android { compileSdkVersion 34
defaultConfig {
minSdkVersion 24
targetSdkVersion 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
}
} Error when building for release (debug didn't show the error for some reason):
Execution failed for task ':flutter_barcode_scanner:verifyReleaseResources'.
A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action Android resource linking failed ERROR:/Users/-/IDZ/flutter-app/zcloud/build/flutter_barcode_scanner/intermediates/merged_res/release/values/values.xml:6135: AAPT: error: resource android:attr/lStar not found.
anyone experience this error on Flutter 3.19?