You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I apologise in advance if this is already implemented / documented somewhere, but having tried to minimally change the native_add_app example I haven't had much luck.
dart pub global activate --source path ./native_add_app
Run
native_add_app
Result:
$ native_add_app
Building package executable...
Built native_add_app:native_add_app.
Invoking a native function to calculate 1 + 2.
Unhandled exception:
Invalid argument(s): Couldn't resolve native function 'add' in 'package:native_add_library/native_add_library.dart' : No asset with id 'package:native_add_library/native_add_library.dart' found. No available native assets. Attempted to fallback to process lookup. /home/jackd/programs/flutter/bin/cache/dart-sdk/bin/dart: undefined symbol: add.
#0 Native._ffi_resolver.#ffiClosure0 (dart:ffi-patch/ffi_patch.dart)
#1 Native._ffi_resolver_function (dart:ffi-patch/ffi_patch.dart:1523:20)
#2 add (package:native_add_library/native_add_library.dart)
#3 main (file:///home/jackd/Development/dart/native/pkgs/native_assets_cli/example/build/native_add_app/bin/native_add_app.dart:9:18)
#4 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#5 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
The text was updated successfully, but these errors were encountered:
dart pub global run --enable-experiment=native-assets native_add_app:native_add_app
Not quite as convenient as native_add_app but I can't see any way to make the script pub makes at ~/.pub-cache/bin/native_add_app play nicely.
Having said that, it would be nice if the error message was a little more informative. If I dart run bin/native_add_app I get the much more helpful message:
Package(s) native_add_library require the native assets feature to be enabled. Enable native assets with `--enable-experiment=native-assets`.
I'm looking for a way to use native assets in a pub-configured executable.
I apologise in advance if this is already implemented / documented somewhere, but having tried to minimally change the native_add_app example I haven't had much luck.
Steps to reproduce:
dart pub get
in native_add_app and native_add_libraryResult:
The text was updated successfully, but these errors were encountered: