ajinasokan / flutter_fgbg

Flutter plugin to detect when app(not Flutter container) goes to background or foreground
MIT License
81 stars 34 forks source link

Android compiling error: AAPT: error: resource android:attr/lStar not found. #21

Open ClemPalf opened 1 month ago

ClemPalf commented 1 month ago

Hi, since I updated flutter to 3.24.0 and the kotlin version to 2.0.10, I get this compiling error:

Regards,

Saria-houloubi commented 1 month ago

me too any fix found ?

ClemPalf commented 1 month ago

I manually updated the build.gradle of the library like this:

group 'com.ajinasokan.flutter_fgbg'
version '1.0'

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.0'
    }
}

rootProject.allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion 34

    defaultConfig {
        minSdkVersion 21
    }
    lintOptions {
        disable 'InvalidPackage'
    }
    namespace "com.ajinasokan.flutter_fgbg"
}

dependencies {
    implementation 'androidx.lifecycle:lifecycle-process:2.2.0'
}

And I managed to compile. (I updated com.android.tools.build:gradle:7.3.0, compileSdkVersion 34, and minSdkVersion 21)

AlehPankoInterexy commented 1 month ago

Upgrading to compileSdkVersion 34 helped me too. Is this the best solution, since I have some more packages with the same problem?

csells commented 1 month ago

another dup reporting the same thing: https://github.com/ajinasokan/flutter_fgbg/issues/23 (closed)

hafidzaini commented 1 month ago

disable 'InvalidPackage'

my setting android.tools.build:gradle:7.3.0, compileSdkVersion 34, minSdkVersion 23

still build error

ClemPalf commented 1 month ago

@hafidzaini Did you update those settings in the build.gradle of the library specifically (.pub-cache/hosted/pub.dev)?

hafidzaini commented 1 month ago

@hafidzaini Did you update those settings in the build.gradle of the library specifically (.pub-cache/hosted/pub.dev)?

i mean thats my project setting oh.. is that setting change on plugin?

ClemPalf commented 1 month ago

Yes, that should do the job (while we wait for a proper fix)

hafidzaini commented 1 month ago

editing pub cache still no luck for me 😰

flutter : 3.24 android.application / gradle : 7.3.0 jetbrain kotlin: 1.9.0 compileSdkVersion 34 minSdkVersion 23

elio1fiore commented 1 month ago

+1

ajinasokan commented 4 weeks ago

Can anyone try version 0.5.0? flutter_fgbg: ^0.5.0

I think this is related to the old gradle versions and not the SDK versions because AFAIK a Flutter app always considers the SDK versions in its own gradle file.

ahmic commented 4 weeks ago

Can anyone try version 0.5.0? flutter_fgbg: ^0.5.0

I think this is related to the old gradle versions and not the SDK versions because AFAIK a Flutter app always considers the SDK versions in its own gradle file.

I've just installed this package and got same error flutter_fgbg: ^0.5.0

Upgrading to compileSdkVersion 34 helped me too

csells commented 4 weeks ago

Yep. Same error with the published v.0.5.0:

Execution failed for task ':flutter_fgbg:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/Users/csells/Code/stuffed/stuff/build/flutter_fgbg/intermediates/merged_res/release/values/values.xml:194: AAPT: error: resource android:attr/lStar not found.
ajinasokan commented 4 weeks ago

I was finally able to reproduce this. Oddly this didn't happen to my existing projects, only on a fresh project.

I have pushed a new version with compile SDK as 34. Try flutter_fgbg: ^0.6.0

csells commented 3 weeks ago

With this 0.6.0 version, I can get a build, but the output contains all kinds of scary warnings:

e: /Users/csells/.gradle/caches/transforms-3/c683cde5b1f5377825fe27da54e1b718/transformed/fragment-1.7.1/jars/classes.jar!/META-INF/fragment_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/4b07bb875192e8c29c9b76677237c5c8/transformed/jetified-activity-1.8.1/jars/classes.jar!/META-INF/activity_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/455c428e62a6dd75da98c7152f7af462/transformed/jetified-lifecycle-livedata-core-ktx-2.7.0/jars/classes.jar!/META-INF/lifecycle-livedata-core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/0313b4099446464f98d0df0606c58c95/transformed/lifecycle-livedata-2.7.0/jars/classes.jar!/META-INF/lifecycle-livedata_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/2e94595ca22e3aadcdebdc547820608c/transformed/lifecycle-viewmodel-2.7.0/jars/classes.jar!/META-INF/lifecycle-viewmodel_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/ce9e6112a0f9c5113844bb49506e7a06/transformed/lifecycle-livedata-core-2.7.0/jars/classes.jar!/META-INF/lifecycle-livedata-core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/6e7c2231d2ac9b957ecfe9d432e59ed2/transformed/jetified-lifecycle-viewmodel-savedstate-2.7.0/jars/classes.jar!/META-INF/lifecycle-viewmodel-savedstate_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/740c93e8e1043856a6b7cb15a7eaa9f0/transformed/jetified-core-ktx-1.13.1/jars/classes.jar!/META-INF/core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/fac84cd5ecf1ec88a8c98571217c9350/transformed/core-1.13.1/jars/classes.jar!/META-INF/core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/98474e5913354eaede53aaa879a4dd8b/transformed/lifecycle-runtime-2.7.0/jars/classes.jar!/META-INF/lifecycle-runtime_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/d674cd90e13def17f77b3f8010d35e09/transformed/jetified-lifecycle-process-2.7.0/jars/classes.jar!/META-INF/lifecycle-process_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/modules-2/files-2.1/androidx.lifecycle/lifecycle-common/2.7.0/85334205d65cca70ed0109c3acbd29e22a2d9cb1/lifecycle-common-2.7.0.jar!/META-INF/lifecycle-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/5292c4072ce6d2ab49b0e25db445cdfe/transformed/jetified-window-java-1.2.0/jars/classes.jar!/META-INF/window-java_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/d47b1192960df52846144d82ac9e1d6f/transformed/jetified-window-1.2.0/jars/classes.jar!/META-INF/window_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-jvm/1.7.1/63a0779cf668e2a47d13fda7c3b0c4f8dc7762f4/kotlinx-coroutines-core-jvm-1.7.1.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-android/1.7.1/c2d86b569f10b7fc7e28d3f50c0eed97897d77a7/kotlinx-coroutines-android-1.7.1.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/transforms-3/aadceac8ee0316c01a9163bad1a5e0ed/transformed/jetified-savedstate-1.2.1/jars/classes.jar!/META-INF/savedstate_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/csells/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.22/1a8e3601703ae14bb58757ea6b2d8e8e5935a586/kotlin-stdlib-common-1.8.22.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.