dart-lang / native

Dart packages related to FFI and native assets bundling.
BSD 3-Clause "New" or "Revised" License
147 stars 42 forks source link

Cannot run jnigen to generate bindings #1624

Closed Leylan24 closed 1 week ago

Leylan24 commented 1 week ago

When running jnigen i cannot generate the bindings:

PS D:\Github\Api\asmart_v2_api> dart run jnigen --config jnigen.yaml           
Following config values are required but not provided
Please provide these properties through YAML or use the command line switch -D<property_name>=<value>.
* c_root
* dart_root
* library_name

My yaml file looks like this:

android_sdk_config:
  add_gradle_deps: true
  add_gradle_sources: true

preamble: |
  // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
  // for details. All rights reserved. Use of this source code is governed by a
  // BSD-style license that can be found in the LICENSE file.

source_path:
  - 'android/src/main/java/za/co/scotchsoftware/asmart_v2_api/pay_api_driver/PayApiSystem.java'
classes:
  - 'za.co.scotchsoftware.asmart_v2_api.pay_api_driver.PayApiSystem'

output:
  c:
    library_name: asmart_v2_api
    path: src/asmart_v2_api/
  dart:
    path: 'lib/jni_generated.dart'
    ## Output to single file instead of recreating source's file structure.
    ## This will be useful to reduce clutter when binding a small number of
    ## classes.
    structure: 'single_file'
HosseinYousefi commented 1 week ago

What version of JNIgen are you using?

Leylan24 commented 1 week ago

Sorry i was using 0.1.1, due to a pinned dependency. It is running now, i do have other issues but will open separately. Thanks for your help.