cfug/dio

[native_dio_adapter] Windows build breaks when adding package

Closed this issue · 1 comments

Package

native_dio_adapter

Version

1.3.0

Operating-System

Windows

Adapter

NativeAdapter

Output of flutter doctor -v

[√] Flutter (Channel stable, 3.19.0, on Microsoft Windows [Version 10.0.19045.4291], locale en-CA)
    • Flutter version 3.19.0 on channel stable at F:\Dev\tools\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision bae5e49bc2 (2 months ago), 2024-02-13 17:46:18 -0800
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\Hakim\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = C:\Users\Hakim\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.7.4)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
    • Visual Studio Build Tools 2022 version 17.7.34031.279
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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.7+0-b2043.56-10550314)

[√] VS Code (version 1.88.1)
    • VS Code at C:\Users\Hakim\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.86.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.4291]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 124.0.6367.62
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 122.0.2365.80

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

• No issues found!

Dart Version

3.3.0

Steps to Reproduce

  1. Create a flutter app
  2. Add native_dio_adapter
  3. Try to build for Windows

Expected Result

It should build properly

Actual Result

Building for Windows is broken for me, even though we don't want to use native_dio_adapter on Windows (we only need it for Android and iOS). Building for Android from the same Windows machine works.

This seems to be a probelm from the jni dependency. I've posted an issue here .

The only workaround I have found until now is to disable the Windows plugin for jni with a fork (since we don't need it). But would appreciate any other ways to prevent this issue.

CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 AWT)
Call Stack (most recent call first):
  C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/FindJNI.cmake:569 (find_package_handle_standard_args)
  flutter/ephemeral/.plugin_symlinks/jni/src/CMakeLists.txt:32 (find_package)


Error: Unable to generate build files

Thank you!

This is unlikely to be solved from our side. Please follow up on the issue you've created with the dart/native.