TigerEyeLabs / duckdb-dart

DuckDB Dart bindings.
MIT License
35 stars 1 forks source link

Build fails for duckdbexplorer project with "Could not resolve all files for configuration ':dart_duckdb:androidJdkImage'" #9

Open szarnyasg opened 3 days ago

szarnyasg commented 3 days ago

I am trying to build the example project duckdbexplorer on macOS 15.1 arm64. I upgraded the Gradle wrapper to Gradle 8.10 and tried two different Zulu JDKs installed via SDKMAN: 17 and 21.

java -version
openjdk version "17.0.13" 2024-10-15 LTS
-- nd
openjdk version "21.0.5" 2024-10-15 LTS

I ran the following build command:

flutter build appbundle

The result is the following:

Resolving dependencies...
Downloading packages...
  async 2.11.0 (2.12.0 available)
  boolean_selector 2.1.1 (2.1.2 available)
  characters 1.3.0 (1.3.1 available)
  clock 1.1.1 (1.1.2 available)
  collection 1.18.0 (1.19.1 available)
  crypto 3.0.5 (3.0.6 available)
> dart_duckdb 1.1.3 from path ../.. (was 1.1.0 from path ../..)
  fake_async 1.3.1 (1.3.2 available)
  file_picker 5.5.0 (8.1.4 available)
  fixnum 1.1.0 (1.1.1 available)
  flutter_lints 3.0.2 (5.0.0 available)
  flutter_plugin_android_lifecycle 2.0.22 (2.0.23 available)
  intl 0.19.0 (0.20.0 available)
> leak_tracker 10.0.5 (was 10.0.4) (10.0.8 available)
> leak_tracker_flutter_testing 3.0.5 (was 3.0.3) (3.0.9 available)
  lints 3.0.0 (5.1.0 available)
  matcher 0.12.16+1 (0.12.17 available)
> material_color_utilities 0.11.1 (was 0.8.0) (0.12.0 available)
> meta 1.15.0 (was 1.12.0) (1.16.0 available)
  path 1.9.0 (1.9.1 available)
  path_provider 2.1.4 (2.1.5 available)
  path_provider_android 2.2.10 (2.2.12 available)
  platform 3.1.5 (3.1.6 available)
  stack_trace 1.11.1 (1.12.0 available)
  string_scanner 1.2.0 (1.4.0 available)
> test_api 0.7.2 (was 0.7.0) (0.7.3 available)
  typed_data 1.3.2 (1.4.0 available)
> vm_service 14.2.5 (was 14.2.1) (14.3.1 available)
  win32 5.5.4 (5.8.0 available)
  xdg_directories 1.0.4 (1.1.0 available)
Changed 7 dependencies!
29 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.

Downloading https://github.com/TigerEyeLabs/duckdb-dart/releases/download/v1.1.3/libduckdb-android_arm64-v8a.zip
Extracting to /Users/szarnyasg/git/duckdb-dart/android/src/main/jniLibs/arm64-v8a
Downloading https://github.com/TigerEyeLabs/duckdb-dart/releases/download/v1.1.3/libduckdb-android_armeabi-v7a.zip
Extracting to /Users/szarnyasg/git/duckdb-dart/android/src/main/jniLibs/armeabi-v7a
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':dart_duckdb:compileReleaseJavaWithJavac'.
> Could not resolve all files for configuration ':dart_duckdb:androidJdkImage'.
   > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JdkImageTransform: /Users/szarnyasg/Library/Android/sdk/platforms/android-34/core-for-system-modules.jar.
         > Error while executing process /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/jlink with arguments {--module-path /Users/szarnyasg/.gradle/caches/8.10/transforms/01db6149cc76ca2c68d115330cd7399f-767e95d5-0a8d-4fec-9a01-7683b65fc53d/transformed/output/temp/jmod --add-modules java.base --output /Users/szarnyasg/.gradle/caches/8.10/transforms/01db6149cc76ca2c68d115330cd7399f-767e95d5-0a8d-4fec-9a01-7683b65fc53d/transformed/output/jdkImage --disable-plugin system-modules}

* 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 5s
Running Gradle task 'bundleRelease'...                              6.2s
Gradle task bundleRelease failed with exit code 1

Could you please advise on how to work around this issue?

szarnyasg commented 3 days ago

I managed to resolve this by configuring Flutter to use JDK 17:

flutter config --jdk-dir=/Users/szarnyasg/.sdkman/candidates/java/17.0.11.fx-zulu
aprock commented 15 hours ago

thanks, i've updated the instructions to include how to troubleshoot this issue

https://github.com/TigerEyeLabs/duckdb-dart/pull/11