kineapps / flutter_archive

Flutter plugin for creating and extracting ZIP files.
https://pub.dev/packages/flutter_archive
BSD 3-Clause "New" or "Revised" License
59 stars 44 forks source link

Unable to build project for Android #74

Closed DEGoodmanWilson closed 1 year ago

DEGoodmanWilson commented 1 year ago

Howdy! I'm getting the following error that only started showing up once I added flutter_archive to my project:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_archive:compileReleaseKotlin'.
> 'compileReleaseJavaWithJavac' task (current target is 1.8) and 'compileReleaseKotlin' task (current target is 18) 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

Here is the output from flutter doctor -v (non-Android bits removed)

[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-x64, locale en-US)
    • Flutter version 3.10.6 on channel stable at /Users/dgoodman/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (5 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/dgoodman/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /usr/bin/java
    • Java version Java(TM) SE Runtime Environment (build 18.0.2.1+1-1)
    • All Android licenses accepted.

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] Network resources
    • All expected network resources are available.

Let me know what other information would be helpful!

DEGoodmanWilson commented 1 year ago

The issue was fixed by running from master, instead of 5.0.0. The changes to the SDK level in build.gradle seem to be the key to fixing my problem.