peercoin / coinlib

The most feature-complete *coin library in the entire Dart/Flutter ecosystem.
BSD 3-Clause "New" or "Revised" License
6 stars 11 forks source link

Build failed when use coinlib_flutter at Flutter #5

Open kanntim opened 1 year ago

kanntim commented 1 year ago

Hi! I am trying to use coinlib_flutter: ^1.0.0-cs.1 to Flutter, but I get the following error:

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':coinlib_flutter:buildCMakeDebug[arm64-v8a][moveAndroid]'.

    com.android.ide.common.process.ProcessException: ninja: Entering directory `C:\Users\kannt_im\AppData\Local\Pub\Cache\hosted\pub.dev\coinlib_flutter-1.0.0-rc.1\android.cxx\Debug\433u34h5\arm64-v8a' [1/8] Performing update step for 'secp256k1' [2/8] No patch step for 'secp256k1' [3/8] Performing configure step for 'secp256k1' -- Could NOT find Valgrind (missing: Valgrind_INCLUDE_DIR Valgrind_WORKS)

secp256k1 configure summary

Build artifacts: library type ........................ Shared Optional modules: ECDH ................................ ON ECDSA pubkey recovery ............... ON extrakeys ........................... ON schnorrsig .......................... ON Parameters: ecmult window size .................. 15 ecmult gen precision bits ........... 4 Optional features: assembly optimization ............... OFF external callbacks .................. OFF Optional binaries: benchmark ........................... OFF noverify_tests ...................... OFF tests ............................... OFF exhaustive tests .................... OFF ctime_tests ......................... OFF examples ............................ OFF

Cross compiling ....................... TRUE, for Android, aarch64 Valgrind .............................. OFF Preprocessor defined macros ........... ENABLE_MODULE_ECDH=1 ENABLE_MODULE_RECOVERY=1 ENABLE_MODULE_SCHNORRSIG=1 ENABLE_MODULE_EXTRAKEYS=1 ECMULT_WINDOW_SIZE=15 ECMULT_GEN_PREC_BITS=4 C compiler ............................ C:/Users/kannt_im/AppData/Local/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe CFLAGS ................................ -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O2 -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security Compile options ....................... -pedantic -Wall -Wcast-align -Wconditional-uninitialized -Wextra -Wnested-externs -Wno-long-long -Wno-overlength-strings -Wno-unused-function -Wshadow -Wstrict-prototypes -Wundef Build type:

  • CMAKE_BUILD_TYPE ................... Debug
  • CFLAGS ............................. -O0 -fno-limit-debug-info
  • LDFLAGS for executables ............
  • LDFLAGS for shared libraries .......

    -- Configuring done -- Generating done -- Build files have been written to: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/src/secp256k1-build [4/8] Performing build step for 'secp256k1' ninja: no work to do. [5/8] Performing install step for 'secp256k1' [0/1] Install the project... -- Install configuration: "Debug" -- Up-to-date: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/libsecp256k1.so -- Up-to-date: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/include/secp256k1.h -- Up-to-date: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/include/secp256k1_preallocated.h -- Up-to-date: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/include/secp256k1_ecdh.h -- Up-to-date: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/include/secp256k1_recovery.h -- Up-to-date: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/include/secp256k1_extrakeys.h -- Up-to-date: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/include/secp256k1_schnorrsig.h -- Up-to-date: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/cmake/libsecp256k1/libsecp256k1-targets.cmake -- Installing: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/cmake/libsecp256k1/libsecp256k1-targets-debug.cmake -- Up-to-date: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/cmake/libsecp256k1/libsecp256k1-config.cmake -- Up-to-date: C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/cmake/libsecp256k1/libsecp256k1-config-version.cmake [6/8] Completed 'secp256k1' [7/8] cmd.exe /C "cd /D C:\Users\kannt_im\AppData\Local\Pub\Cache\hosted\pub.dev\coinlib_flutter-1.0.0-rc.1\android.cxx\Debug\433u34h5\arm64-v8a && ( C:\Users\kannt_im\AppData\Local\Android\Sdk\cmake\3.18.1\bin\cmake.exe -E rename C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/libsecp256k1.so.2.0.2 C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/libsecp256k1.so || exit 0 )" Error renaming from "C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/libsecp256k1.so.2.0.2" to "C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/libsecp256k1.so": No error [8/8] cmd.exe /C "cd /D C:\Users\kannt_im\AppData\Local\Pub\Cache\hosted\pub.dev\coinlib_flutter-1.0.0-rc.1\android.cxx\Debug\433u34h5\arm64-v8a && mkdir -p C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/src/../android/src/main/jniLibs/arm64-v8a && C:\Users\kannt_im\AppData\Local\Android\Sdk\cmake\3.18.1\bin\cmake.exe -E rename C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/libsecp256k1.so C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/src/../android/src/main/jniLibs/arm64-v8a/libsecp256k1.so" FAILED: CMakeFiles/moveAndroid cmd.exe /C "cd /D C:\Users\kannt_im\AppData\Local\Pub\Cache\hosted\pub.dev\coinlib_flutter-1.0.0-rc.1\android.cxx\Debug\433u34h5\arm64-v8a && mkdir -p C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/src/../android/src/main/jniLibs/arm64-v8a && C:\Users\kannt_im\AppData\Local\Android\Sdk\cmake\3.18.1\bin\cmake.exe -E rename C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/android/.cxx/Debug/433u34h5/arm64-v8a/secp256k1/lib/libsecp256k1.so C:/Users/kannt_im/AppData/Local/Pub/Cache/hosted/pub.dev/coinlib_flutter-1.0.0-rc.1/src/../android/src/main/jniLibs/arm64-v8a/libsecp256k1.so" The syntax of the command is incorrect. ninja: build stopped: subcommand failed.

    C++ build system [build] failed while executing: @echo off "C:\Users\kannt_im\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe" ^ -C ^ "C:\Users\kannt_im\AppData\Local\Pub\Cache\hosted\pub.dev\coinlib_flutter-1.0.0-rc.1\android\.cxx\Debug\433u34h5\arm64-v8a" ^ moveAndroid from C:\Users\kannt_im\AppData\Local\Pub\Cache\hosted\pub.dev\coinlib_flutter-1.0.0-rc.1\android

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

Flutter doctor -v

PS D:\AndroidStudio_Projects\test_ln> Flutter doctor -v [√] Flutter (Channel stable, 3.13.2, on Microsoft Windows [Version 10.0.22621.2134], locale en-150) • Flutter version 3.13.2 on channel stable at C:\Users\kannt_im\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ff5b5b5fa6 (10 days ago), 2023-08-24 08:12:28 -0500 • Engine revision b20183e040 • Dart version 3.1.0 • DevTools version 2.25.0

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

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1) • Android SDK at C:\Users\kannt_im\AppData\Local\Android\Sdk • Platform android-33, build-tools 33.0.1 • Java binary at: C:\Users\kannt_im\AppData\Local\Programs\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231) • 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 Community 2022 17.4.3) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.4.33205.214 • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.3) • Android Studio at C:\Users\kannt_im\AppData\Local\Programs\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 • android-studio-dir = C:\Users\kannt_im\AppData\Local\Programs\Android Studio • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.81.0) • VS Code at C:\Users\kannt_im\AppData\Local\Programs\Microsoft VS Code • Flutter extension can be installed from: https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

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

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

I've tried Repair IDEA, Flutter clear, Flutter upgrade, Invalidate Cache, but none of it works

The following error also appears:

/C:/Users/kannt_im/flutter/packages/flutter/lib/src/foundation/binding.dart:9:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' as ui show Brightness, PlatformDispatcher, SingletonFlutterWindow, window; // ignore: deprecated_member_use ^ Context: The unavailable library 'dart:ui' is imported through these packages:

package:lnurl_tests => package:coinlib_flutter => package:flutter => dart:ui
...

Detailed import paths for (some of) the these imports:

package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => package:flutter/src/foundation/memory_allocations.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => package:flutter/src/foundation/memory_allocations.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => package:flutter/src/foundation/memory_allocations.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/key.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/memory_allocations.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/memory_allocations.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/foundation.dart => package:flutter/src/foundation/memory_allocations.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/rendering.dart => package:flutter/foundation.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/rendering.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/rendering.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/rendering.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:lnurl_tests/thoth_22.dart => package:coinlib_flutter/coinlib_flutter.dart => package:flutter/widgets.dart => package:flutter/rendering.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => dart:ui
...

/C:/Users/kannt_im/flutter/packages/flutter/lib/src/foundation/binding.dart:25:1: Error: Dart library 'dart:ui' is not available on this platform. export 'dart:ui' show PlatformDispatcher, SingletonFlutterWindow; // ignore: deprecated_member_use ^ /C:/Users/kannt_im/flutter/packages/flutter/lib/src/foundation/change_notifier.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' show VoidCallback; ^ /C:/Users/kannt_im/flutter/packages/flutter/lib/src/foundation/change_notifier.dart:13:1: Error: Dart library 'dart:ui' is not available on this platform. export 'dart:ui' show VoidCallback; ^ /C:/Users/kannt_im/flutter/packages/flutter/lib/src/foundation/debug.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' as ui show Brightness; ^ /C:/Users/kannt_im/flutter/packages/flutter/lib/src/foundation/debug.dart:11:1: Error: Dart library 'dart:ui' is not available on this platform. export 'dart:ui' show Brightness; ^ /C:/Users/kannt_im/flutter/packages/flutter/lib/src/foundation/memory_allocations.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' as ui; ^ /C:/Users/kannt_im/flutter/packages/flutter/lib/src/widgets/app.dart:35:1: Error: Dart library 'dart:ui' is not available on this platform. export 'dart:ui' show Locale; ^ /C:/Users/kannt_im/flutter/packages/flutter/lib/src/widgets/app_lifecycle_listener.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui';

MatthewLM commented 1 year ago

@kanntim Thank you for reporting this. I believe the problem with Windows is that mkdir -p is not supported. I will leave this issue open to be fixed in the future. However, for now, the library will only support Linux and macOS hosts.

It may be possible to run a build on Windows if using the WLS but I have not tried this.

sneurlax commented 10 months ago

@kanntim You might try the Windows code in this PR: https://github.com/peercoin/coinlib/pull/25

It may work for you!

sneurlax commented 6 months ago

Oh,

Error: Dart library 'dart:ui' is not available on this platform.
import 'dart:ui';

indicates you are trying to flutter run on the commandline... for the commandline. I also have this issue with Flutter plugins that don't support being run on the commandline--only on platforms. Basically: try flutter run -d windows @kanntim

also try version 2.0!