mono / Embeddinator-4000

Tools to turn .NET libraries into native libraries that can be consumed on Android, iOS, Mac, Linux and other platforms.
MIT License
758 stars 95 forks source link

error MT2001: Could not link assemblies, xamarin.ios lib based on Microsoft SignalR #706

Closed crash481 closed 5 years ago

crash481 commented 6 years ago

Embedinator return error "MT2001: Could not link assemblies" without any description while creating obj-c lib from xamarin.ios class library project(compiles in .dll) that uses Microsoft SignalR nuget package

Steps to Reproduce

  1. Create Xamarin.iOS class library project
  2. Add nugget package "Microsoft.AspNetCore.SignalR.Client" version "1.0.0-preview1-final"
  3. nuget.config produces error, so decided to delete it and use more stable ` 1.0.0-preview1-final

    ` inside .csproj file.

  4. In lib method use some code from SignalR package
  5. Compile project succesfuly, so we have .dll file
  6. Downloaded embedinator (from another project by nuget.config) and used as Embedinator-4000.0.4.0/tools/objcgen ../MySignalRCoreWrap.dll --target=framework --platform=iOS --output=output -c --debug
  7. This gives an error that cannot find references
  8. I review all errors after each try and find library names that project can not fint.
  9. I put all .dll files in root. I found .dll's by delete contents of ~/.nuget/packages/ and restore packages only for current project, so thare are dll versions only for my project.
  10. After all errors associated with library names finished there are new error apears error MT2001: Could not link assemblies. Reason: Error while processing references of 'SignalRCore, Version=1.0.6828.32368, Culture=neutral, PublicKeyToken=null'
  11. If remove code from step 4, so SignalR will not be used it is all okey

So I do not know what to do now, any suggestions?

Environment

Mac OS 10.13.3 Embeddinator-4000 v0.1 (0.4: 7664197)

Build Logs

Full log you can see in attached file: embedinator_full_log.txt

Sample project

SignalRCore.zip

rolfbjarne commented 6 years ago

Can you try running this command manually (this is from your log), and then add -v -v -v -v at the end to make the output more verbose?

/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch --dev /Users/morozov/Documents/qq/output/iPhoneOS/SignalRCore --abi=armv7,armv7s,arm64 --sdkroot /Applications/Xcode.app --targetver 8.0 --dsym:false --msym:false --embeddinator /Users/morozov/Documents/qq/SignalRCore.dll -r:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll --sdk 11.4 --linksdkonly --xml=output/bindings.xml --registrar:static --cache /Users/morozov/Documents/qq/output/iPhoneOS/build-cache --debug --assembly-build-target=@all=framework=SignalRCore.framework --target-framework Xamarin.iOS,v1.0 "--gcc_flags=-force_load /Users/morozov/Documents/qq/output/iPhoneOS/SignalRCore.a"  -v -v -v -v
crash481 commented 6 years ago

sorry, I am in vacation to 23 of September now, troubles with internet, thanks for help, I review and continue to find solution right after come back

VincentDondain commented 5 years ago

Hi @crash481,

Have you had a chance to try what Rolf asked in the previous comment: https://github.com/mono/Embeddinator-4000/issues/706#issuecomment-421059583?

crash481 commented 5 years ago

I could not find solution and use another lib, thanks