-
Notifications
You must be signed in to change notification settings - Fork 32
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
Library not loaded error when adding binary Swift dependency #65
Comments
One thing to check is the native library reference in the binding project:
Also, in the MauiSample iOS project:
You could also add this to the
I hope some part of this helps! |
Thank you so much for your reply and suggestions. I have tried...
I get a new/different error:
I've also tried "AdyenPOS" (which is what shows in the xcode left drawer), "ADYPOSTEST" (what shows in targets when Obj-C compatible library is used), and "ADYPOSTEST.framework". |
Yw! Seem like the path may be off and may need to be more explicit about the location? The exact path should be in the File Inspector panel on the right when you click on AdyenPOS.framework.
May also need these in the binding project:
|
I performed a case-insensitive
I tried adding the IsCxx element, and the NoBindingEmbedding element as those were not present.
I'd like to note that I am able to use this library and call methods on it if I try this with a simple Xcode/Swift sample, in case that could be relevant. Again, thank you for your time. :) |
Of course! Looks like your grep results show that Xcode is actually building an xcframework named "AdyenPOSTest.xcframework" rather than a .framework file. You may trying adjusting the binding to match what's actually being produced.
There's a possibility you may also have to add this to the
|
It looks like it still isn't working with the same error message :( I overwrote the ItemGroup I had with the one you provided tried with either AdyenPOSTest.xcframework, and ADYPOSTest.xcframework. I also tried with the AllowUnsafeBlocks set to true. Here are the complete contents of my NewBinding.MaciOS.Binding.csproj file:
and here is the MauiSample.csproj file:
|
Hmm... What if you were to remove the NativeReference ItemGroup entirely (the one referencing AdyenPOSTest.xcframework)? Then, modify the NLIXcodeProjectReference to explicitly specify the framework.
The AdyenPOSTest target should be set as a dependency of theNewBinding target and the framework should be listed under the NewBinding target's "Frameworks, Libraries, and Embedded Content" section. |
I removed the NativeReference ItemGroup. If I look in the NewBinding target in Xcode under General > Frameworks and Libraries > AdyenPOSTEST is what shows there, is that what you mean? Here's the compiler output leading up to and including the error:
And here are the current .csproj files, NewBinding.MaciOS.Binding.csproj:
and MauiSample.csproj
also in case this helps, the AdyenPOS Package Dependency has a Package.swift file in it. |
That linker error may help. Can you make sure the framework is properly embedded? In Xcode, select the NewBinding target. Should be under General > Frameworks, Libraries, and Embedded Content. Make sure AdyenPOSTEST is set to "Embed & Sign". Then modify here to be the same as from Package.swift:
You could also try adding this to MauiSample.csproj inside the first
|
Also if I replace the the ItemGroup with NLIXcodeProjectReference in NewBinding...csproj with the block you provided, I get this new error:
If I add the RuntimeIdentifier to first property group in MauiSample.csproj I get the same error... |
How about this? In Xcode, add the framework embedding and then select the NewBinding target in the left panel. Change the binding project (NewBinding.MaciOS.Binding.csproj) to this:
Then add these to the binding project's PropertyGroup:
The key seem like making sure the framework is properly linked in Xcode first, since that may be the root of the linking problems. |
Yes, under Link Binary With Libraries, AdyenPOSTEST is marked required. I am getting this error:
|
The linker still can't find it. You could try finding it like this from a Terminal window in the project root:
Update NLIXcodeProjectReference to include the full path:
And in MauiSample.csproj add:
If you open the Package.swift file what does the binaryTarget declaration looks like for AdyenPOSTEST? |
The first find turns up no results.
In the package.swift it looks like the following, I have truncated the actual zip file locations and checksums.
I assume I need proper locations on disk before I can make the csproj changes selected. Also my intent is to do my best to respond throughout the rest of the day but I will be out starting tomorrow until the 26th, so if you don't hear from me until then after today, I expect to follow up after that. :) Thanks again for all your continued help. EDIT: PS the /path/to/asset.zip are all https / web links, they are not locations on disk, in case that helps |
Description
I am seeing an issue when attempting to add a
.binarytarget
swift package dependency to the MAUI slim binding template. In particular, I am attempting to use the Adyen POS Mobile SDK for iOS, with either the swift-only or Objective-C compatible packages.Thank you sincerely for any suggestions or advice you can provide.
Steps to Reproduce
Link to public reproduction project repository
No response
Environment
The text was updated successfully, but these errors were encountered: