Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error in Android after adding this plugin. #54

Open
ManasaCh07 opened this issue Jan 28, 2025 · 4 comments
Open

Build error in Android after adding this plugin. #54

ManasaCh07 opened this issue Jan 28, 2025 · 4 comments

Comments

@ManasaCh07
Copy link

When I added this plugin to my app, I am getting build errors in Android. Below is the error that I am getting:
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':secure_application:compileDebugKotlin'.

'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 12s
Error: Gradle task assembleDebug failed with exit code 1

@camilocubillosstori
Copy link

I have the same error with flutter 3.27.1 , any update about this?

@tyagnesh-mufin
Copy link

same issue with latest gradle plugin and flutter sdk

@develonursahin
Copy link

I am experiencing the same issue with Flutter 3.24.5 and Dart 3.5.4 (stable).
When I added the secure_application package to my project, I encountered the following error:

Flutter Version:

  • Flutter: 3.24.5
  • Dart: 3.5.4 (stable)

This issue is caused by the mismatch between Java 1.8 and Kotlin 17 versions for the compileDebugJavaWithJavac and compileDebugKotlin tasks.
The Java version in the compileDebugJavaWithJavac task is set to 1.8, while Kotlin is set to JVM 17, which causes the build failure.

Here is the error message:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':secure_application:compileDebugKotlin'.
> 'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 12s
Error: Gradle task assembleDebug failed with exit code 1

I believe this is a compatibility issue between the Java and Kotlin versions. Adjusting the Java and Kotlin versions to be compatible with each other (specifically Java 17) may resolve this. Let me know if there are any other suggestions or solutions.

@islandream
Copy link

I get same error. Spent 3 hours but couldnt solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants