espresso3389 / pdfrx

pdfrx is yet another PDF viewer implementation that built on the top of pdfium. The plugin currently supports Android, iOS, Windows, macOS, Linux, and Web.
MIT License
60 stars 36 forks source link

Execution failed for task ':pdfrx:configureCMakeRelWithDebInfo[arm64-v8a]' when building using GitHub Actions #118

Open PrimaelQuemerais opened 1 month ago

PrimaelQuemerais commented 1 month ago

I'm running into this error when trying to build using a GitHub Action. Building locally works fine.

Execution failed for task ':pdfrx:configureCMakeRelWithDebInfo[arm64-v8a]'.
> [CXX1405] error when building with cmake using /home/runner/.pub-cache/hosted/pub.dev/pdfrx-1.0.51/android/CMakeLists.txt: Build command failed.
  Error while executing process /usr/local/bin/cmake with arguments ***-H/home/runner/.pub-cache/hosted/pub.dev/pdfrx-1.0.51/android -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=19 -DANDROID_PLATFORM=android-19 -DANDROID_ABI=arm64-v8a -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_NDK=/usr/local/lib/android/sdk/ndk/21.4.7075529 -DCMAKE_ANDROID_NDK=/usr/local/lib/android/sdk/ndk/21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=/usr/local/lib/android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/runner/work/secureat/secureat/secureat/build/pdfrx/intermediates/cxx/RelWithDebInfo/165y4c3i/obj/arm64-v8a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/home/runner/work/secureat/secureat/secureat/build/pdfrx/intermediates/cxx/RelWithDebInfo/165y4c3i/obj/arm64-v8a -DCMAKE_BUILD_TYPE=RelWithDebInfo -B/home/runner/.pub-cache/hosted/pub.dev/pdfrx-1.0.51/android/.cxx/RelWithDebInfo/165y4c3i/arm64-v8a -GNinja***
  -- Configuring incomplete, errors occurred!

  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.

I tried :

I'm running out of ideas, any chance you would know how to fix it? Thank you for your help!

espresso3389 commented 2 weeks ago

Usually, NDK related toolchains such as ninja seems to be downloaded automatically during build process. I don't know why it does not work automatically. Did you accept all the NDK license terms?

pankokmu1 commented 1 week ago

I'm having a similar problem.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':pdfrx:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/libpdfium.so' from inputs:
      - /Users/leonardoferreira/Development/Gupy/educorp-app/build/pdfrx/intermediates/merged_jni_libs/debug/out/arm64-v8a/libpdfium.so
      - /Users/leonardoferreira/Development/Gupy/educorp-app/build/pdfrx/intermediates/cxx/Debug/1w6i36b2/obj/arm64-v8a/libpdfium.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

pdfrx version: pdfrx: ^0.4.51

Flutter doctor:

[✓] Flutter (Channel stable, 3.16.9, on macOS 14.4.1 23E224 darwin-arm64, locale pt-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.89.0)
[✓] Connected device (4 available)
[✓] Network resources