wasabeef / flutter_ua_client_hints

Provide User-Agent Client Hints to a Flutter app.
MIT License
44 stars 21 forks source link

Support Android Studio Ladybug #128

Open dkaera opened 1 month ago

dkaera commented 1 month ago

Hey everyone, I’ve encountered an issue while migrating to the newly released Android Studio version, Ladybug:

Could not determine the dependencies of task ':ua_client_hints:bundleLibCompileToJarDebug'.
> Could not create task ':ua_client_hints:compileDebugJavaWithJavac'.
   > Failed to calculate the value of task ':ua_client_hints:compileDebugJavaWithJavac' property 'javaCompiler'.
      > Cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=17, vendor=any vendor, implementation=vendor-specific} for MAC_OS on aarch64.
         > No locally installed toolchains match and toolchain download repositories have not been configured.

Honestly, I don’t see any reason to set the target JVM to version 17 for this package, especially since Flutter’s default setup uses JVM 1.8, which overrides this anyway and causes compatibility issues for end users of the plugin.

I propose updating the Kotlin and Gradle versions to meet the requirements of the latest Android Studio version, and that should resolve the issue. Let me know your thoughts or if you have any comments.

Here is PR

dkaera commented 1 month ago

I wanted to follow up on my previous comment regarding the issue with migrating to Android Studio Ladybug.

Initially, I mentioned that I didn’t see the need to set the target JVM to version 17, especially since Flutter’s default setup uses JVM 1.8. However, after further investigation and seeing the new warning:

warning: [options] source value 8 is obsolete and will be removed in a future release

It turns out that migrating to jvmTarget 17 was indeed the correct approach, but the implementation should have been handled differently. I apologize for the earlier suggestion that wasn’t fully accurate.

In the latest commit, I’ve made the necessary adjustments to properly migrate to jvmTarget 17, which should resolve the compatibility issues without conflicting with Flutter’s setup.

Please feel free to review the changes, and let me know your thoughts or if anything needs further tweaking.