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

Execution failed for task ':receive_sharing_intent:compileDebugKotlin'. #326

Open tempo-riz opened 1 month ago

tempo-riz commented 1 month ago

Execution failed for task ':receive_sharing_intent:compileDebugKotlin'.

Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17).

full log :

ignicubeLaeeq commented 1 month ago

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...

FAILURE: Build failed with an exception.

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

Exited (1).

davidfranquet commented 1 month ago

Which Gradle version are you using?

ignicubeLaeeq commented 1 month ago

@davidfranquet: distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip

plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "8.1.1" apply false // START: FlutterFire Configuration id "com.google.gms.google-services" version "4.3.15" apply false // END: FlutterFire Configuration id "org.jetbrains.kotlin.android" version "2.0.0" apply false }

App only throws error after this package is added.

davidfranquet commented 1 month ago

The solution for now is downgrading your gradle version to 7.3.0

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "7.3.0" apply false
    id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}
ignicubeLaeeq commented 1 month ago

@davidfranquet it appears my project will not let me downgrade as I am working on latest flutter. Can you suggest some alternative.

IlyaZadyabin commented 1 month ago

I have the same issue

davidfranquet commented 1 month ago

I'm using Flutter 3.24.3

@davidfranquet it appears my project will not let me downgrade as I am working on latest flutter. Can you suggest some alternative.

I'm using Flutter 3.24.3

environment:
  ....
  flutter: ^3.24.3

What's your error?

HEBOS commented 4 weeks ago

Any news here guys? This is a showstopper.

jaredweinfurtner commented 3 weeks ago

create a new flutter project using flutter 3.24.3 and add receive_sharing_intent and it fails with the same error: Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17).

Kuzmenko commented 3 weeks ago

I haven't fully tested this yet, but adding following code

#compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = '1.8'
}

to build.gradle helped me.