Closed bluestar712 closed 5 months ago
Post your gradle dependencies:
$ cd android
$ ./gradlew app:dependencies
Also review the Android Setup Instructions where it was recommended to use gradle ext vars use ext.compileSdkVersion, ext.targetSdkVersion rather than hard-coding in your app/build.gradle (where 3rd party plug-ins cannot be aware of):
compileSdkVersion 34
There are plenty of post about this in SO:
https://stackoverflow.com/questions/69033022/message-error-resource-androidattr-lstar-not-found
Thank you so much! I fixed this issue.
Added these codes on app/build.gradle
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildTypes {
release {
signingConfig signingConfigs.debug
// signingConfig signingConfigs.release
minifyEnabled true
shrinkResources false
proguardFiles "proguard-rules.pro"
proguardFiles "${background_geolocation.projectDir}/proguard-rules.pro"
}
}
configurations.all {
resolutionStrategy {
force 'androidx.core:core:1.6.0'
force 'androidx.core:core-ktx:1.6.0'
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.core:core-ktx:1.6.0'
}
Removed gradle dependencies on android/build.gradle
ext {
compileSdkVersion = 34
appCompatVersion = "1.4.2"
playServicesLocationVersion = "21.1.0"
hmsLocationVersion = "6.12.0.300"
removeBackgroundGeolocationDebugSoundsInRelease = false
}
buildscript {
ext.kotlin_version = '1.8.10'
repositories {
google()
mavenCentral()
}
dependencies {
// classpath "com.android.tools.build:gradle:8.3.1"
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(':flutter_background_geolocation').projectDir}/libs" }
maven { url 'https://developer.huawei.com/repo/' }
maven { url "${project(':background_fetch').projectDir}/libs" }
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
By my test, this command only working on debug mode. (signingConfig signingConfigs.debug)
flutter build apk --release
And this command is working well on release mode. ( signingConfig signingConfigs.release)
flutter build appbundle
Hope it will help to others that facing this issue... Thank you for a great support!
Yes, you are right. Thank you!
Your Environment
Plugin version: 4.15.4
Platform: iOS or Android: Android
OS version: Android 13, API 33
Device manufacturer / model: Samsung
Flutter info (
flutter doctor
): Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.19045.4412], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Chrome - develop for the web [√] Android Studio (version 2023.1) [√] VS Code (version 1.90.0) [√] Connected device (3 available) [√] Network resourcesPlugin config: Plugin is working well on debug mode.
Issue: I am getting this error when I try go build release apk.
flutter build apk --release
It's my build.gradle in app
It's my build.gradle in android