Flutter-AssetsAudioPlayer icon indicating copy to clipboard operation
Flutter-AssetsAudioPlayer copied to clipboard

Inconsistent JVM-target compatibility detected for tasks 'compileReleaseJavaWithJavac' (1.8) and 'compileReleaseKotlin' (17)

Open ikoshik opened this issue 1 year ago • 13 comments

Flutter Version

[✓] Flutter (Channel stable, 3.24.1, on macOS 14.6.1 23G93 darwin-x64, locale ru-RU) [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc3) [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.1) [✓] VS Code (version 1.92.2)

pubspec.yaml environment: sdk: ^3.5.1

android/app/build.gradle

 compileOptions {
       sourceCompatibility JavaVersion.VERSION_17
       targetCompatibility JavaVersion.VERSION_17
       coreLibraryDesugaringEnabled true
}

kotlinOptions {
        jvmTarget = '17'
}

gradle-wrapper.properties distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip

android/settings.gradle

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version '8.3.2' apply false
    id 'com.android.library' version '8.3.2' apply false
    id "org.jetbrains.kotlin.android" version "1.9.25" apply false
}

Lib Version

My version : assets_audio_player: ^3.1.1

Platform (Android / iOS / web) + version

Platform : android

Describe the bug

FAILURE: Build failed with an exception.

What went wrong:

Execution failed for task ':assets_audio_player_web:compileReleaseKotlin'. Inconsistent JVM-target compatibility detected for tasks 'compileReleaseJavaWithJavac' (1.8) and 'compileReleaseKotlin' (17).

ikoshik avatar Aug 26 '24 11:08 ikoshik

any solution?

arthas1888 avatar Sep 07 '24 16:09 arthas1888

Has anyone found a way around this?

EirikFaerdin avatar Sep 13 '24 11:09 EirikFaerdin

the problem is this lib assets_audio_player_web, if you don't use environment web please remove, so you can fork it that was my solution

arthas1888 avatar Sep 13 '24 13:09 arthas1888

the problem is this lib assets_audio_player_web, if you don't use environment web please remove, so you can fork it that was my solution

Thanks for the tip. I have a local copy as I needed to add duck functionality in order to let my audio play in the foreground if e.g. music was already playing. I have tried to remove assets_audio_player_web, but have not been successful as it generates loads of errors I don't seem to be able to solve. Any quick suggestions on how to remove the web part?

EirikFaerdin avatar Sep 20 '24 04:09 EirikFaerdin

Seeing this issue as well

passsionforprogramming avatar Sep 25 '24 15:09 passsionforprogramming

I got this issue as well, hopefully it can fix soon, please.

gavnyx avatar Sep 27 '24 09:09 gavnyx

https://github.com/florent37/Flutter-AssetsAudioPlayer/issues/830

same issue here

gavnyx avatar Oct 02 '24 08:10 gavnyx

Facing the same issue indeed after project update.

FreelapResearch avatar Oct 02 '24 11:10 FreelapResearch

This method helped me. Add the following content to the assets_audio_player_web library

compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } image

wangya123456789 avatar Oct 30 '24 16:10 wangya123456789

his method helped me. Add the following content to the assets_audio_player_web library

Yes, that did it for me! Thank You!

rettet-die-stille avatar Nov 18 '24 19:11 rettet-die-stille

Note: This change will not work for Flutter web platforms.

Try changing the following in pubspec.yaml:

Before:

dependencies:
  assets_audio_player: ^3.1.1

After:

dependencies:
  assets_audio_player:
    git:
      url: https://github.com/Rupakpoddar/Flutter-AssetsAudioPlayer

Rupakpoddar avatar Dec 14 '24 03:12 Rupakpoddar

@Rupakpoddar the repo is 404

vasilich6107 avatar Apr 22 '25 17:04 vasilich6107

Hi @vasilich6107 -- The changes were merged to master. I deleted my fork.

Rupakpoddar avatar Apr 23 '25 14:04 Rupakpoddar