-
Notifications
You must be signed in to change notification settings - Fork 53
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
Invalid argument(s): Failed to load dynamic library 'cpp_library.dylib': dlopen failed: library "cpp_library.dylib" not found #489
Comments
@Okladnoj nice to meet you! Please use Side note: does this issue have anything to do with package:ffigen? Or is this a general dart:ffi issue? |
using template is too cumbersome. to be honest, I don’t know what the problem is, like the library (cpp_library.dylib) was able to be generated, but it doesn’t work |
You are building on mac, in a mac format ( Android libraries are in So, just use template. |
somehow not a very convenient solution ... it turns out that you cannot add a library in C ++ to an existing project |
@dcharkes |
In Flutter, the bundling of the C source code in the template is done automatically. If you have a prebuilt dylib, you'll need to modify the build files. For MacOS and iOS it's the MacOS: #
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint mylib_dylib.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'mylib_dylib'
s.version = '0.0.1'
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
A new flutter plugin project.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'FlutterMacOS'
s.platform = :osx, '10.11'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.vendored_libraries = 'Frameworks/libmylib_dylib.dylib', 'Frameworks/libmylib_dylib_dependency.dylib'
s.swift_version = '5.0'
end |
@dcharkes Does modifying the build files mean adding a .dylib file to the example app using Xcode? Also, where should the .dylib file to be placed when configuring with the <package_name>.podspec file ? |
Not the example app, but the plugin. It should be placed in the Frameworks/ folder e.g. |
@dcharkes I tried adding the 'my_dylib.dylib' file to the
|
i have the same problem |
same here! @Jos-Sea, how did you get around the issue? |
I face the same issue. |
I make library:
MR from repo:
https://github.com/Okladnoj/vote_race/pull/1/files
Use
adb shell getprop ro.product.cpu.abi
arm64-v8a
uname -m
arm64
The text was updated successfully, but these errors were encountered: