Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge no. of errors running code gen on AVFoundation #44

Open
bsutton opened this issue Oct 15, 2020 · 2 comments
Open

Huge no. of errors running code gen on AVFoundation #44

bsutton opened this issue Oct 15, 2020 · 2 comments

Comments

@bsutton
Copy link

bsutton commented Oct 15, 2020

I'm trying to generate the dart_native dart code for the ios AVFoundation framework.

When I run code gen it appears to be generating all of the files however it is generating a large no of errors (attached file).

As I'm writing this I'm also waiting for it to complete. It appears to have generated all of the files but is now sitting churning cpu and not doing much (15+ minutes)

The errors and generated code.

error.zip

code.zip

@yulingtianxia
Copy link
Member

Codegen is a tool for generating dart bindings for native APIs. You can use codegen with file or folder path. But it's still under development and may have errors when processing complicated grammar. We are working hard on it.

You can also use dart_native without codegen. For example:

Here is OC code:

@interface RuntimeStub : NSObject
- (BOOL)fooBOOL:(BOOL)b;
@end

You can write your dart binding code instead of using codegen:

class RuntimeStub extends NSObject {
  RuntimeStub([Class isa]) : super(isa ?? Class('RuntimeStub'));

  RuntimeStub.fromPointer(Pointer<Void> ptr) : super.fromPointer(ptr);

  bool fooBOOL(bool b) {
    return perform(SEL('fooBOOL:'), args: [b]);
  }
}

Last, call native API using Dart:

RuntimeStub stub = RuntimeStub();
bool resultBool = stub.fooBOOL(false);
print('fooBool result:$resultBool');

@yulingtianxia yulingtianxia transferred this issue from dart-native/dart_native Oct 19, 2020
@yulingtianxia
Copy link
Member

We had fixed the performance issue since 1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants