You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After applying the namespace fix from PR #81, there's an additional build error due to missing kotlinOptions configuration in the android/build.gradle file.
This issue is related to PR #81 but requires an additional fix for full AGP 8+ compatibility.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':screenshot_callback:compileDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (21).
Expected Behavior
The plugin should build successfully without requiring manual modifications to package files.
Actual Behavior
Build fails after applying only the namespace fix. Requires additional kotlinOptions configuration.
Root Cause
The android/build.gradle file is missing the kotlinOptions block that sets the JVM target to match Java's version (1.8).
Manually edit [pub-cache]/hosted/pub.dev/screenshot_callback-3.0.1/android/build.gradle to add the kotlinOptions block. However, this must be repeated on every development machine and after flutter clean.
This issue: Adds kotlinOptions (completes AGP 8+ compatibility)
Both fixes are needed for full compatibility.
Additional Note
It appears this package may not be actively maintained (PR #81 has been open since October 2023). If there's no response, I'm willing to create a fork with both fixes and maintain it for the community.
Description
After applying the namespace fix from PR #81, there's an additional build error due to missing kotlinOptions configuration in the android/build.gradle file.
This issue is related to PR #81 but requires an additional fix for full AGP 8+ compatibility.
Environment
Steps to Reproduce
Error Message
Expected Behavior
The plugin should build successfully without requiring manual modifications to package files.
Actual Behavior
Build fails after applying only the namespace fix. Requires additional kotlinOptions configuration.
Root Cause
The android/build.gradle file is missing the kotlinOptions block that sets the JVM target to match Java's version (1.8).
Proposed Solution
android { namespace 'com.flutter.moum.screenshot_callback' compileSdkVersion 33 defaultConfig { minSdkVersion 21 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } lintOptions { disable 'InvalidPackage' } kotlinOptions { // Add this block jvmTarget = '1.8' } }Impact
This affects all users of this plugin with:
Workaround
Manually edit [pub-cache]/hosted/pub.dev/screenshot_callback-3.0.1/android/build.gradle to add the kotlinOptions block. However, this must be repeated on every development machine and after flutter clean.
Related
Both fixes are needed for full compatibility.
Additional Note
It appears this package may not be actively maintained (PR #81 has been open since October 2023). If there's no response, I'm willing to create a fork with both fixes and maintain it for the community.