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

Problems initializing dart native for ios #39

Open
relf108 opened this issue Nov 19, 2020 · 1 comment
Open

Problems initializing dart native for ios #39

relf108 opened this issue Nov 19, 2020 · 1 comment

Comments

@relf108
Copy link

relf108 commented Nov 19, 2020

We have the following unit test in example/test directory of a project:

import "package:test/test.dart";
import 'package:dart_native/dart_native.dart';
void main() {
  // Define the test
  test("Testing ffi implementation of AVAudioPlayer", () {
    runDartNative();
    // Arrange
    NSObject player = new NSObject(Class('NSObject'));
    // Asset
    expect(player.description, '');
  });
}

This is failing with the following error:

Connecting to VM Service at http://127.0.0.1:49354/kOZquTJPEHw=/ws
Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, RegisterDeallocCallback): symbol not found)
dart:ffi                                                      DynamicLibrary.lookup
package:dart_native/src/ios/common/callback_manager.dart      registerDeallocCallback
package:dart_native/…/common/callback_manager.dart:1
package:dart_native/src/ios/common/callback_manager.dart      registerDeallocCallback
package:dart_native/…/common/callback_manager.dart:1
runtimeLib
package:dart_native/…/common/library.dart:17
nativeGetClass
package:dart_native/…/runtime/native_runtime.dart:41
package:dart_native/src/ios/runtime/native_runtime.dart       nativeGetClass
package:dart_native/…/runtime/native_runtime.dart:1
_getClass
package:dart_native/…/runtime/class.dart:64
new Class
package:dart_native/…/runtime/class.dart:16
main.<fn>
test/avaudioplayer_test.dart:9

I should note I've added use_frameworks! to the podspec in the examples directory. Thanks in advance :)

@yulingtianxia
Copy link
Member

@relf108 There is a BIG problem about testing plugins in Flutter: Native app/framework is NOT launched by unit test. Although we can use stubs instead of native code, but it's the opposite of what DartNative is trying to do.

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