flutter_camera_processing icon indicating copy to clipboard operation
flutter_camera_processing copied to clipboard

Compilation issues

Open DannyFilo opened this issue 2 years ago • 1 comments

Hi, I have issue compiling the whole package in VSCode.

Running .\init_windows.ps1 went fine Downloading all scripts as well I double checked and Clang, CMake are installed in the system

When trying to compile example/lib/main.dart in VSCode I got the below errors


Launching lib\main.dart on SM G780G in debug mode... Checking the license for package NDK (Side by side) 23.1.7779620 in C:\Users\danny\AppData\Local\Android\sdk\licenses License for package NDK (Side by side) 23.1.7779620 accepted. Preparing "Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)". "Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" ready. Installing NDK (Side by side) 23.1.7779620 in C:\Users\danny\AppData\Local\Android\sdk\ndk\23.1.7779620 "Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" complete. "Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" finished. Checking the license for package CMake 3.22.1 in C:\Users\danny\AppData\Local\Android\sdk\licenses License for package CMake 3.22.1 accepted. Preparing "Install CMake 3.22.1 (revision: 3.22.1)". "Install CMake 3.22.1 (revision: 3.22.1)" ready. Installing CMake 3.22.1 in C:\Users\danny\AppData\Local\Android\sdk\cmake\3.22.1 "Install CMake 3.22.1 (revision: 3.22.1)" complete. "Install CMake 3.22.1 (revision: 3.22.1)" finished.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':flutter_camera_processing:configureCMakeDebug[arm64-v8a]'.

[CXX1429] error when building with cmake using C:\z_dev\testy_dhi\cameralnie\flutter_opnecv_camera_processing-master\flutter_camera_processing-master\src\CMakeLists.txt: -- Android: Targeting API '21' with architecture 'arm64', ABI 'arm64-v8a', and processor 'aarch64' -- Android: Selected unified Clang toolchain -- The C compiler identification is Clang 12.0.8 -- The CXX compiler identification is Clang 12.0.8 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Users/danny/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Users/danny/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring incomplete, errors occurred! See also "C:/z_dev/testy_dhi/cameralnie/flutter_opnecv_camera_processing-master/flutter_camera_processing-master/android/.cxx/Debug/2b425n5e/arm64-v8a/CMakeFiles/CMakeOutput.log".

C++ build system [configure] failed while executing: @echo off "C:\Users\danny\AppData\Local\Android\sdk\cmake\3.22.1\bin\cmake.exe" ^ "-HC:\z_dev\testy_dhi\cameralnie\flutter_opnecv_camera_processing-master\flutter_camera_processing-master\src" ^ "-DCMAKE_SYSTEM_NAME=Android" ^ "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^ "-DCMAKE_SYSTEM_VERSION=21" ^ "-DANDROID_PLATFORM=android-21" ^ "-DANDROID_ABI=arm64-v8a" ^ "-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" ^ "-DANDROID_NDK=C:\Users\danny\AppData\Local\Android\sdk\ndk\23.1.7779620" ^ "-DCMAKE_ANDROID_NDK=C:\Users\danny\AppData\Local\Android\sdk\ndk\23.1.7779620" ^ "-DCMAKE_TOOLCHAIN_FILE=C:\Users\danny\AppData\Local\Android\sdk\ndk\23.1.7779620\build\cmake\android.toolchain.cmake" ^ "-DCMAKE_MAKE_PROGRAM=C:\Users\danny\AppData\Local\Android\sdk\cmake\3.22.1\bin\ninja.exe" ^ "-DCMAKE_CXX_FLAGS=-frtti -fexceptions -std=c++2a" ^ "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\z_dev\testy_dhi\cameralnie\flutter_opnecv_camera_processing-master\flutter_camera_processing-master\example\build\flutter_camera_processing\intermediates\cxx\Debug\2b425n5e\obj\arm64-v8a" ^ "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=C:\z_dev\testy_dhi\cameralnie\flutter_opnecv_camera_processing-master\flutter_camera_processing-master\example\build\flutter_camera_processing\intermediates\cxx\Debug\2b425n5e\obj\arm64-v8a" ^ "-DCMAKE_BUILD_TYPE=Debug" ^ "-BC:\z_dev\testy_dhi\cameralnie\flutter_opnecv_camera_processing-master\flutter_camera_processing-master\android\.cxx\Debug\2b425n5e\arm64-v8a" ^ -GNinja ^ "-DANDROID_STL=c++_shared" from C:\z_dev\testy_dhi\cameralnie\flutter_opnecv_camera_processing-master\flutter_camera_processing-master\android CMake Error at CMakeLists.txt:19 (add_subdirectory): add_subdirectory given source "zxing/core" which is not an existing directory.

  • 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 5m 52s Exception: Gradle task assembleDebug failed with exit code 1

Exited (1).

DannyFilo avatar Oct 18 '23 23:10 DannyFilo

@DannyFilo

https://github.com/khoren93/flutter_camera_processing/pull/2/files Please refer this PR for correction in cmake file.

${CMAKE_CURRENT_SOURCE_DIR}/../cpp

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../cpp/zxing/core zxing)

Please change path with current directory. It will solve the error.

mukunthan007 avatar Oct 19 '23 15:10 mukunthan007