Skip to content

jni plugin requires jdk to have awt. #1942

Closed
@bsutton

Description

@bsutton

I've just added the cronent_http package to my app which I'm testing on linux (ubuntu).

From my understanding cronet_http uses jni and I can see the generated_plugings.cmake file (under linux/flutter) has been updated to include 'jni' as a plugin.

list(APPEND FLUTTER_FFI_PLUGIN_LIST
  jni
  pdfrx
)

The problem is that when I do a linux build I'm getting the following error:

flutter build linux
Changing current working directory to: .../git/pigation2/pig_app

CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find JNI (missing: AWT)
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.28/Modules/FindJNI.cmake:589 (find_package_handle_standard_args)
  flutter/ephemeral/.plugin_symlinks/jni/src/CMakeLists.txt:32 (find_package)


Building Linux application...                                           
Unable to generate build files

I believe the problem is that I have openjdk-headless installed which doesn't included awt.

Given I can't imagine a scenario where someone would be trying to access awt via jni (would it even work) it would be good to remove the awt check from the make script.

Metadata

Metadata

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions