0

After I added assets_audio_player package I started to get this error :

  • FAILURE: Build failed with an exception.

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

'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version. Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain On the other hand,This app can run on IOS simulator and real device. Really, I can't understand this error, how can I fix? Thanks.

  • After I searched similar errors, I updated assets_audio_player dependency as

assets_audio_player:
git:
url: https://github.com/florent37/Flutter-AssetsAudioPlayer
But it didn't work.

5
  • In your project's android/app/build.gradle file, try this code: ` compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = '11' }` Commented Sep 5 at 9:27
  • Can you share your pubspec.yaml file? What version of assets_audio_player are you using? Commented Sep 5 at 18:33
  • @rusty actually this code is already like you said : compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = '11' } Commented Sep 6 at 11:40
  • @tomerpacificas I mentioned in my question : assets_audio_player: git: url: github.com/florent37/Flutter-AssetsAudioPlayer Commented Sep 6 at 11:41
  • @TugbaOzkan - I am asking about the version being used, not the name of the package. Also, you did not add your pubspec.yaml. Commented Sep 6 at 14:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.