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

No iOS framework bundle produced for .NET library #787

Closed wizdaz2 closed 3 years ago

wizdaz2 commented 3 years ago

Embeddinator 0.4.0 for .NET library produced no iOS framework bundle, but only a static library (.a).

Also a question, how do you get a header file to use with static library? Is it supposed to be auto-generated or you have to create it by yourself?

Steps to Reproduce

  1. Run Embeddinator 0.4.0 for .NET library to create iOS framework

Expected Behavior

Complete iOS framework bundle

Actual Behavior

iOS framework bundle is empty, no binary, no header. Only static (.a) library was produced.

Environment

Embeddinator-4000 v0.1 (0.4: 7664197)

=== Visual Studio Community 2019 for Mac ===

Version 8.8.5 (build 18)
Installation UUID: cf9d8407-e621-4519-84a4-96c1f7fd7175
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

    Package version: 612000113

=== Mono Framework MDK ===

Runtime:
    Mono 6.12.0.113 (2020-02/4fdfb5b1fd5) (64-bit)
    Package version: 612000113

=== Roslyn (Language Service) ===

3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.102/Sdks
SDK Versions:
    5.0.102
    5.0.101
    3.1.405
    3.1.404
    3.1.200
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    5.0.2
    5.0.1
    3.1.11
    3.1.10
    3.1.2
    2.1.16

=== .NET Core 3.1 SDK ===

SDK: 3.1.405

=== Xamarin.Profiler ===

Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.3 (17715)
Build 12C33

=== Xamarin.Mac ===

Version: 7.2.0.3 (Visual Studio Community)
Hash: c51fabee8
Branch: xcode12.3
Build date: 2020-12-10 21:05:04-0500

=== Xamarin.iOS ===

Version: 14.2.0.12 (Visual Studio Community)
Hash: e0ce49680
Branch: xcode12.1
Build date: 2020-10-20 09:52:06-0400

=== Xamarin Designer ===

Version: 16.8.0.510
Hash: 44e3f3ce9
Branch: remotes/origin/d16-8
Build date: 2020-12-10 00:06:14 UTC

=== Xamarin.Android ===

Version: 11.1.0.26 (Visual Studio Community)
Commit: xamarin-android/d16-8/a36ce73
Android SDK: /Users/wizdaz/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        None installed

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 29.0.2

Build Information: 
Mono: 5e9cb6d
Java.Interop: xamarin/java.interop/d16-8@79d9533
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/wizdaz/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.8.0.32
Hash: 01a7774
Branch: remotes/origin/d16-8
Build date: 2020-12-10 00:32:24 UTC

=== Android Device Manager ===

Version: 16.8.0.46
Hash: 0a81419
Branch: remotes/origin/d16-8
Build date: 2020-12-10 00:32:44 UTC

=== Build Information ===

Release ID: 808050018
Git revision: e83d51ec050ffcdd573462fc1889b58cfe1a5ad5
Build date: 2021-01-07 14:45:50-05
Build branch: release-8.8
Xamarin extensions: e83d51ec050ffcdd573462fc1889b58cfe1a5ad5

=== Operating System ===

Mac OS X 10.15.7
Darwin 19.6.0 Darwin Kernel Version 19.6.0
    Thu Dec 10 20:07:16 PST 2020
    root:xnu-6153.141.13~1/RELEASE_X86_64 x86_64

Build Logs

% mono embeddinator-4000/0.4.0/tools/objcgen.exe DYMO.Mobile.SDK.IOS/bin/Debug/DYMO.Mobile.SDK.IOS.dll --target=framework --platform=iOS --outdir=output_IOS -c --debug          
Parsing assemblies...
    Parsed 'DYMO.Mobile.SDK.IOS/bin/Debug/DYMO.Mobile.SDK.IOS.dll'
Processing assemblies...
    1 types found
Generating binding code...
    Generated: output_IOS/bindings.h
    Generated: output_IOS/bindings-private.h
    Generated: output_IOS/bindings.m
    Generated: output_IOS/bindings.xml
    Generated: output_IOS/embeddinator.h
    Generated: output_IOS/glib.h
    Generated: output_IOS/mono_embeddinator.h
    Generated: output_IOS/mono-support.h
    Generated: output_IOS/objc-support.h
    Generated: output_IOS/glib.c
    Generated: output_IOS/mono_embeddinator.c
    Generated: output_IOS/objc-support.m
    Generated: output_IOS/Make.config
Compiling binding code...
Found Mono 6.12.0.113 (between 5.4.1.7 and 5.4.1.7)
Found Xamarin.iOS 14.2.0.12 (between 11.6.1.3 and 11.6.1.3)
    xcode-select -p
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/glib.c -o output_IOS/armv7/glib.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/mono_embeddinator.c -o output_IOS/armv7/mono_embeddinator.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/objc-support.m -o output_IOS/armv7/objc-support.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/bindings.m -o output_IOS/armv7/bindings.o 
    xcrun ar cru output_IOS/armv7/DYMO.Mobile.SDK.IOS.a output_IOS/armv7/glib.o output_IOS/armv7/mono_embeddinator.o output_IOS/armv7/objc-support.o output_IOS/armv7/bindings.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/glib.c -o output_IOS/armv7s/glib.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/mono_embeddinator.c -o output_IOS/armv7s/mono_embeddinator.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/objc-support.m -o output_IOS/armv7s/objc-support.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/bindings.m -o output_IOS/armv7s/bindings.o 
    xcrun ar cru output_IOS/armv7s/DYMO.Mobile.SDK.IOS.a output_IOS/armv7s/glib.o output_IOS/armv7s/mono_embeddinator.o output_IOS/armv7s/objc-support.o output_IOS/armv7s/bindings.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/glib.c -o output_IOS/arm64/glib.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/mono_embeddinator.c -o output_IOS/arm64/mono_embeddinator.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/objc-support.m -o output_IOS/arm64/objc-support.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output_IOS/bindings.m -o output_IOS/arm64/bindings.o 
    xcrun ar cru output_IOS/arm64/DYMO.Mobile.SDK.IOS.a output_IOS/arm64/glib.o output_IOS/arm64/mono_embeddinator.o output_IOS/arm64/objc-support.o output_IOS/arm64/bindings.o 
    xcrun lipo output_IOS/armv7/DYMO.Mobile.SDK.IOS.a output_IOS/armv7s/DYMO.Mobile.SDK.IOS.a output_IOS/arm64/DYMO.Mobile.SDK.IOS.a -create -output output_IOS/iPhoneOS/DYMO.Mobile.SDK.IOS.a
    xcrun --show-sdk-version --sdk iphoneos
    /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch --dev /Users/wizdaz/Desktop/dymo-connect/DYMOConnectMobileSDK/output_IOS/iPhoneOS/DYMO.Mobile.SDK.IOS --abi=armv7,armv7s,arm64 --sdkroot /Applications/Xcode.app --targetver 8.0 --dsym:false --msym:false --embeddinator /Users/wizdaz/Desktop/dymo-connect/DYMOConnectMobileSDK/DYMO.Mobile.SDK.IOS/bin/Debug/DYMO.Mobile.SDK.IOS.dll -r:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll --sdk 14.3 --linksdkonly --xml=output_IOS/bindings.xml --registrar:static --cache /Users/wizdaz/Desktop/dymo-connect/DYMOConnectMobileSDK/output_IOS/iPhoneOS/build-cache --debug --assembly-build-target=@all=framework=DYMO.Mobile.SDK.IOS.framework --target-framework Xamarin.iOS,v1.0 "--gcc_flags=-force_load /Users/wizdaz/Desktop/dymo-connect/DYMOConnectMobileSDK/output_IOS/iPhoneOS/DYMO.Mobile.SDK.IOS.a" 
Xamarin.iOS 14.2.0.12 (xcode12.1): e0ce49680 using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.3.sdk
warning MT0030: The executable name (DYMO.Mobile.SDK.IOS) and the app name (DYMO.Mobile.SDK.IOS) are different, this may prevent crash logs from getting symbolicated properly.

error MT2002: Failed to resolve assembly: 'System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

Done
spouliot commented 3 years ago

Your logs shows that the headers should be present

Generating binding code...
    Generated: output_IOS/bindings.h
    Generated: output_IOS/bindings-private.h
    Generated: output_IOS/bindings.m
    Generated: output_IOS/bindings.xml
    Generated: output_IOS/embeddinator.h
    Generated: output_IOS/glib.h
    Generated: output_IOS/mono_embeddinator.h
    Generated: output_IOS/mono-support.h
    Generated: output_IOS/objc-support.h
    Generated: output_IOS/glib.c
    Generated: output_IOS/mono_embeddinator.c
    Generated: output_IOS/objc-support.m
    Generated: output_IOS/Make.config

The MT2002 error (later) is because your assembly as a reference to System.Drawing.Common

This is something you should already have, e.g.

/Library/Frameworks/Xamarin.iOS.framework//Versions/14.6.0.15/lib/mono/Xamarin.iOS/Facades/System.Drawing.Common.dll

It might be that it's looking for a different version from what your assembly has referenced.

We'll need a test case to investigate the lack of headers.

rolfbjarne commented 3 years ago

We have not received the requested information.

If you are still experiencing this issue please provide all the requested information then click the Reopen Issue button.

Thanks!