KasemJaffer / receive_sharing_intent

A Flutter plugin that enables flutter apps to receive sharing photos, text and url from other apps.
Apache License 2.0
334 stars 395 forks source link

FAILURE: Build failed with an exception. #337

Closed santoshvandari closed 1 week ago

santoshvandari commented 1 week ago

I followed all the setups mentioned in the docs, tried to build/run, and got the following issue. I have tried all the mentioned things my AI model, google and stack overflow But I still have this issue. Please anyone help me to solve this:

wabisabi@wabisabi:~/Desktop/AnyDoc/android$ flutter run
Changing current working directory to: /home/wabisabi/Desktop/AnyDoc
Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':receive_sharing_intent: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 19s
Running Gradle task 'assembleDebug'...                             20.0s
Error: Gradle task assembleDebug failed with exit code 1
wabisabi@wabisabi:~/Desktop/AnyDoc/android$ 
santoshvandari commented 1 week ago

Updated: I slove the issue By Downloading the JDK version 17 and updating the following file: android/app/build.gradle android/gradle/wrapper/gradle-wrapper.properties android/build.gradle