Arm64 windows use opencv_core:1.4.3 build error, about opencv path config
Describe the bug
- OS: Windows 11 Arm 64
- flutter version: 3.35.3
- use
opencv_core:1.4.3, and build target is windows,it will throw error:
CMake Warning at C:/Users/xxxx/Desktop/xxxx/xxxx/example/build/windows/x64/_deps/libopencv-src/OpenCVConfig.cmake:190 (message):
Found OpenCV Windows Pack but it has no binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
C:/Users/xxxx/Desktop/xxxx/xxxx/example/build/windows/x64/_deps/libdartcv-src/CMakeLists.txt:60 (find_package)
CMake Error at C:/Users/xxxx/Desktop/xxxx/xxxx/example/build/windows/x64/_deps/libdartcv-src/CMakeLists.txt:60 (find_package):
Found package configuration file:
C:/Users/xxxx/Desktop/xxxx/xxxx/example/build/windows/x64/_deps/libopencv-src/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
There is a related issue with the opencv path in the log information, but everything works normally when using it on a Mac and building for Android or iOS, and no additional opencv path settings have been made. Are there any extra configuration parameters needed on Windows?
To Reproduce None
Expected behavior Build success
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Windows 11 24H2 Arm64
Smartphone (please complete the following information): None
Additional context
flutter doctor result:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.35.3, on Microsoft Windows [Version 10.0.26100.6584],
locale zh-CN)
[√] Windows Version (Windows 11 or higher, 24H2, 2009)
[X] Android toolchain - develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/to/windows-android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.15
(September 2025))
[!] Android Studio (not installed)
[√] VS Code (version 1.104.1)
[!] Proxy Configuration
! NO_PROXY is not set
[√] Connected device (3 available)
[√] Network resources
! Doctor found issues in 3 categories.
@zhponng Hi.
It's strange that x64 architecture is selected on arm64 windows, but I need a Windows arm64 machine or VM to debug it, also I am kind of busy recently, so unfortunately, I'm afraid it can't be resolved quickly.
Try to build under x64 windows if possible for now.
Also, it will be helpful if you could attach the detailed logs of flutter build -v
@rainyl Thank you for your response.
I am using a Mac with an M1 chip, and then I created a Windows virtual machine using VMware.
It's indeed very strange. The log identified the arm64 architecture, but the chosen OpenCV architecture is x64. Below are the detailed logs. Additionally, is there a way to specify using the locally installed OpenCV? Would this force the use of the correct architecture OpenCV?
Thank you again for your help.
C:\Users\ponng\fvm\versions\3.35.3\bin\cache\dart-sdk\bin\dart pub
--suppress-analytics --color --directory . get --example
Resolving dependencies... (1.2s)
Downloading packages...
characters 1.4.0 (1.4.1 available)
dartcv4 1.1.6 (1.1.8 available)
flutter_lints 5.0.0 (6.0.0 available)
lints 5.1.1 (6.0.0 available)
material_color_utilities 0.11.1 (0.13.0 available)
meta 1.16.0 (1.17.0 available)
test_api 0.7.6 (0.7.7 available)
Got dependencies!
7 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
[+2522 ms] Found plugin integration_test at
C:\Users\ponng\fvm\versions\3.35.3\packages\integration_test\
[ +192 ms] Found plugin xxxx at
C:\Users\ponng\Desktop\xxxx\xxxx\
[ +27 ms] Found plugin opencv_core at
C:\Users\ponng\AppData\Local\Pub\Cache\hosted\pub.dev\opencv_core-1.4.3\
[ +110 ms] Found plugin integration_test at
C:\Users\ponng\fvm\versions\3.35.3\packages\integration_test\
[ +117 ms] Found plugin xxxx at
C:\Users\ponng\Desktop\xxxx\xxxx\
[ +18 ms] Found plugin opencv_core at
C:\Users\ponng\AppData\Local\Pub\Cache\hosted\pub.dev\opencv_core-1.4.3\
[ +72 ms] Skipping generating generated_plugin_registrant.h because it is
up-to-date.
[ +30 ms] Skipping generating generated_plugin_registrant.cc because it is
up-to-date.
[ +8 ms] Skipping generating generated_plugins.cmake because it is up-to-date.
[ +196 ms] executing: C:\Program Files (x86)\Microsoft Visual
Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version 16
-requires Microsoft.VisualStudio.Workload.NativeDesktop
Microsoft.VisualStudio.Component.VC.Tools.x86.x64
Microsoft.VisualStudio.Component.VC.CMake.Project
[ +128 ms] Exit code 0 from: C:\Program Files (x86)\Microsoft Visual
Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version 16
-requires Microsoft.VisualStudio.Workload.NativeDesktop
Microsoft.VisualStudio.Component.VC.Tools.x86.x64
Microsoft.VisualStudio.Component.VC.CMake.Project
[ +2 ms] [
{
"instanceId": "20634810",
"installDate": "2025-09-17T09:19:47Z",
"installationName": "VisualStudio/17.14.16+36518.9",
"installationPath": "C:\\Program Files\\Microsoft Visual
Studio\\2022\\Community",
"installationVersion": "17.14.36518.9",
"productId": "Microsoft.VisualStudio.Product.Community",
"productPath": "C:\\Program Files\\Microsoft Visual
Studio\\2022\\Community\\Common7\\IDE\\devenv.exe",
"state": 4294967295,
"isComplete": true,
"isLaunchable": true,
"isPrerelease": false,
"isRebootRequired": false,
"displayName": "Visual Studio Community 2022",
"description": "功能强大的 IDE,供学生、开放源代码参与者和个人免费 使用",
"channelId": "VisualStudio.17.Release",
"channelUri": "https://aka.ms/vs/17/release/channel",
"enginePath": "C:\\Program Files (x86)\\Microsoft Visual
Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.
VisualStudio.Setup.Service",
"installedChannelId": "VisualStudio.17.Release",
"installedChannelUri": "https://aka.ms/vs/17/release/channel",
"releaseNotes":
"https://docs.microsoft.com/en-us/visualstudio/releases/2022/releas
e-notes-v17.14#17.14.16",
"resolvedInstallationPath": "C:\\Program Files\\Microsoft Visual
Studio\\2022\\Community",
"thirdPartyNotices":
"https://go.microsoft.com/fwlink/?LinkId=661288",
"updateDate": "2025-09-24T03:41:15.2223884Z",
"catalog": {
"buildBranch": "d17.14",
"buildVersion": "17.14.36518.9",
"id": "VisualStudio/17.14.16+36518.9",
"localBuild": "build-lab",
"manifestName": "VisualStudio",
"manifestType": "installer",
"productDisplayVersion": "17.14.16",
"productLine": "Dev17",
"productLineVersion": "2022",
"productMilestone": "RTW",
"productMilestoneIsPreRelease": "False",
"productName": "Visual Studio",
"productPatchVersion": "16",
"productPreReleaseMilestoneSuffix": "1.0",
"productSemanticVersion": "17.14.16+36518.9",
"requiredEngineVersion": "3.14.2086.54749"
},
"properties": {
"campaignId": "2030:2625d9c726e74b0e858d1413d3d855a9",
"channelManifestId": "VisualStudio.17.Release/17.14.16+36518.9",
"includeRecommended": "1",
"nickname": "",
"setupEngineFilePath": "C:\\Program Files (x86)\\Microsoft Visual
Studio\\Installer\\setup.exe"
}
}
]
[ +21 ms] Building Windows application...
[ +75 ms] executing: C:\Program Files\Microsoft Visual
Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake
.exe -S C:\Users\ponng\Desktop\xxx\xxxx\example\windows -B
C:\Users\ponng\Desktop\xxxx\xxxx\example\build\windows\x64
-G Visual Studio 17 2022 -A x64 -DFLUTTER_TARGET_PLATFORM=windows-x64
[+2198 ms] -- The CXX compiler identification is MSVC 19.44.35217.0
[ +186 ms] -- Detecting CXX compiler ABI info
[+1203 ms] -- Detecting CXX compiler ABI info - done
[ +69 ms] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual
Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostarm64/x64/cl.exe - skipped
[ +18 ms] -- Detecting CXX compile features
[ +18 ms] -- Detecting CXX compile features - done
[+5491 ms] CMake Deprecation Warning at
C:/Users/ponng/Desktop/xxxx/xxxx/example/build/windows/x64/_
deps/googletest-src/CMakeLists.txt:4 (cmake_minimum_required):
[ +9 ms] Compatibility with CMake < 3.10 will be removed from a future version
of
[ +1 ms] CMake.
[ ] Update the VERSION argument <min> value. Or, use the <min>...<max>
syntax
[ ] to tell CMake that the project requires at least <min> but has been
updated
[ +1 ms] to work with policies introduced by <max> or earlier.
[ +937 ms] -- The C compiler identification is MSVC 19.44.35217.0
[ +59 ms] -- Detecting C compiler ABI info
[ +876 ms] -- Detecting C compiler ABI info - done
[ +65 ms] -- Check for working C compiler: C:/Program Files/Microsoft Visual
Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostarm64/x64/cl.exe - skipped
[ +2 ms] -- Detecting C compile features
[ ] -- Detecting C compile features - done
[ +34 ms] CMake Deprecation Warning at
C:/Users/ponng/Desktop/xxxx/xxxx/example/build/windows/x64/_
deps/googletest-src/googlemock/CMakeLists.txt:45 (cmake_minimum_required):
[ +1 ms] Compatibility with CMake < 3.10 will be removed from a future version
of
[ +2 ms] CMake.
[ ] Update the VERSION argument <min> value. Or, use the <min>...<max>
syntax
[ +11 ms] to tell CMake that the project requires at least <min> but has been
updated
[ +4 ms] to work with policies introduced by <max> or earlier.
[ +1 ms] CMake Deprecation Warning at
C:/Users/ponng/Desktop/xxxx/xxxx/example/build/windows/x64/_
deps/googletest-src/googletest/CMakeLists.txt:56 (cmake_minimum_required):
[ +1 ms] Compatibility with CMake < 3.10 will be removed from a future version
of
[ +5 ms] CMake.
[ ] Update the VERSION argument <min> value. Or, use the <min>...<max>
syntax
[ +1 ms] to tell CMake that the project requires at least <min> but has been
updated
[ ] to work with policies introduced by <max> or earlier.
[ +670 ms] -- Found Python: C:/Program Files/Python313-arm64/python.exe (found
version "3.13.7") found components: Interpreter
[ +8 ms] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
[+1056 ms] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
[ +2 ms] -- Looking for pthread_create in pthreads
[ +745 ms] -- Looking for pthread_create in pthreads - not found
[ +1 ms] -- Looking for pthread_create in pthread
[ +732 ms] -- Looking for pthread_create in pthread - not found
[ +2 ms] -- Found Threads: TRUE
[ +21 ms] -- Project Version: 1.4.3
[ ] -- OpenCV Version: 4.12.0.0
[ ] -- DartCv Version: 4.12.0.0
[ ] -- Dart SDK found: C:/Users/ponng/fvm/versions/3.35.3/bin/dart.bat
[ ] -- CMAKE_LIBRARY_OUTPUT_DIRECTORY:
[ ] -- WORKING_DIR:
C:/Users/ponng/Desktop/xxxx/xxxx/example/build/windows
[ ] -- Final WORKING_DIR:
C:/Users/ponng/Desktop/xxxx/xxxx/example
[+4107 ms] -- Generate command output:
[ +1 ms] Generating cmake vars from
C:\Users\ponng\Desktop\xxxx\xxxx\example\pubspec.yaml
[ ] parse error
[ ] ###DARTCV_GEN_CMAKE_VAR_BEGIN###
[ ] CALIB3D=ON
[ ] CONTRIB=ON
[ ] DNN=ON
[ ] FEATURES2D=ON
[ ] FLANN=ON
[ ] HIGHGUI=OFF
[ ] IMGPROC=ON
[ ] IMGCODECS=ON
[ ] OBJDETECT=ON
[ ] PHOTO=ON
[ ] STITCHING=ON
[ ] VIDEO=ON
[ ] VIDEOIO=ON
[ ] ###DARTCV_GEN_CMAKE_VAR_END###
[ +1 ms] -- Enabled modules:
core;calib3d;contrib;dnn;features2d;imgproc;objdetect;photo;stitching;video;videoi
o
[ +1 ms] -- Disabled modules: highgui
[+6343 ms] -- Download OpenCV: enabled
[ ] -- Detected processor: arm64
[ ] -- os: windows, arch: arm64
[ ] -- FETCHCONTENT_BASE_DIR:
C:/Users/ponng/Desktop/xxxx/xxxx/example/build/windows/x64/_
deps
[+12389 ms] -- OpenCV_DIR:
C:/Users/ponng/Desktop/xxxx/xxxx/example/build/windows/x64/_
deps/libopencv-src
[ +5 ms] -- OpenCV ARCH: x64
[ ] CMake Warning at
C:/Users/ponng/Desktop/xxxx/xxxx/example/build/windows/x64/_
deps/libopencv-src/OpenCVConfig.cmake:190 (message):
[ +1 ms] -- OpenCV RUNTIME: vc14
[ +4 ms] -- OpenCV STATIC: ON
[ +1 ms] -- Configuring incomplete, errors occurred!
[ ] Found OpenCV Windows Pack but it has no binaries compatible with your
[ ] configuration.
[ +1 ms] You should manually point CMake variable OpenCV_DIR to your build of
OpenCV
[ +6 ms] library.
[ +1 ms] Call Stack (most recent call first):
[ +9 ms]
C:/Users/ponng/Desktop/xxxx/xxxx/example/build/windows/x64/_
deps/libdartcv-src/CMakeLists.txt:60 (find_package)
[ +2 ms] CMake Error at
C:/Users/ponng/Desktop/xxxx/xxxx/example/build/windows/x64/_
deps/libdartcv-src/CMakeLists.txt:60 (find_package):
[ +9 ms] Found package configuration file:
[ +8 ms]
C:/Users/ponng/Desktop/xxxx/xxxx/example/build/windows/x64/_
deps/libopencv-src/OpenCVConfig.cmake
[ +4 ms] but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to
be
[ ] NOT FOUND.
[ +77 ms] Building Windows application... (completed in 37.5s)
[ +16 ms] "flutter windows" took 41,316ms.
[ +299 ms] Unable to generate build files
[ +3 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:34:3)
#1 _runCmakeGeneration
(package:flutter_tools/src/windows/build_windows.dart:205:5)
<asynchronous suspension>
#2 buildWindows
(package:flutter_tools/src/windows/build_windows.dart:104:5)
<asynchronous suspension>
#3 BuildWindowsCommand.runCommand
(package:flutter_tools/src/commands/build_windows.dart:66:5)
<asynchronous suspension>
#4 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1581:27)
<asynchronous suspension>
#5 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#6 CommandRunner.runCommand
(package:args/command_runner.dart:212:13)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:503:9)
<asynchronous suspension>
#8 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#9 FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:438:5)
<asynchronous suspension>
#10 run.<anonymous closure>.<anonymous closure>
(package:flutter_tools/runner.dart:98:11)
<asynchronous suspension>
#11 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#12 main (package:flutter_tools/executable.dart:101:3)
<asynchronous suspension>
[ +3 ms] Running 1 shutdown hook
[ +9 ms] Shutdown hooks complete
[ +284 ms] exiting with code 1
Okay, will try to fix it.
Additionally, is there a way to specify using the locally installed OpenCV? Would this force the use of the correct architecture OpenCV?
Try to set DARTCV_CACHE_DIR env variable, e.g., set DARTCV_CACHE_DIR to C:\tmp\dartcv_cache and opencv sdk should be downloaded and placed at C:\tmp\dartcv_cache\windows\ARM64
Note: you should restart your IDE/terminal after that.
Try to set DARTCV_CACHE_DIR env variable, e.g., set DARTCV_CACHE_DIR to C:\tmp\dartcv_cache and opencv sdk should be downloaded and placed at C:\tmp\dartcv_cache\windows\ARM64
Thank you, I will give it a try.
Try to build under x64 windows if possible for now.
I just tried running the project on an AMD64 architecture Windows, and it worked without any issues.
executing: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake .exe -S C:\Users\ponng\Desktop\xxx\xxxx\example\windows -B C:\Users\ponng\Desktop\xxxx\xxxx\example\build\windows\x64
-G Visual Studio 17 2022 -A x64 -DFLUTTER_TARGET_PLATFORM=windows-x64
I just created a windows arm64 VM and tried to compile a demo project depends on opencv_dart and find that flutter actually doesn't build windows arm64 apps, and windows-x64 is always specified.
However, the cmake project do will download arm64 variant sdk of opencv, causing an incompatible issue.
But flutter will support windows-arm64 in the future (https://github.com/flutter/flutter/issues/62597) so we will not change the logic in cmake file, if you do want to build windows-x64 app under windows arm64, you can manually download the x64 version of opencv sdk from https://github.com/rainyl/opencv.full/releases and explicitly set DARTCV_DISABLE_DOWNLOAD_OPENCV to ON and OpenCV_DIR to the directory containing OpenCVConfig.cmake to disable automatic downloading.