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

[Feature Request] ObjC Framework on Visual Studio in Windows Machine #756

Open Goldie13 opened 4 years ago

Goldie13 commented 4 years ago

Wrapper_iOSLib.zip Wrapper_NetStd.zip Wrapper.zip

Steps to Reproduce

  1. Create .net standard/.net framework/xamarin.ios project
  2. Install E4K nuget package
  3. I m trying E4K on Windows connected to Mac via Mac Agent.
  4. Add post build event command
  5. Just for info it was giving "mscorlib" not found error but I have added "" in .csproj file to fix it & set its copy to local property to "True"

Expected Behavior

It should create .framework

Actual Behavior

1>------ Rebuild All started: Project: Wrapper, Configuration: Debug Any CPU ------ 1> Wrapper -> C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\bin\Debug\Wrapper.dll 1> Parsing assemblies... 1> Parsed 'C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\bin\Debug\Wrapper.dll' 1> Processing assemblies... 1> Processing: 1 assemblies 1> Processing Assembly: Wrapper 1> Processing Type: Wrapper_ConnectivityWrapper 1> TypeMapper Register: System.Void .ctor() init 1> TypeMapper Register: System.Void StartBackend() startBackend 1> 1 types found 1> Generating binding code... 1> Begin Generator 1> Generating Assembly: Wrapper 1> Generating Type: Wrapper_ConnectivityWrapper 1> Generating Method: System.Void StartBackend() 1> Generating Method Impl: System.Void StartBackend() 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\bindings.h 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\bindings-private.h 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\bindings.m 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\bindings.xml 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\embeddinator.h 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\glib.h 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\mono_embeddinator.h 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\mono-support.h 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\objc-support.h 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\glib.c 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\mono_embeddinator.c 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\objc-support.m 1> Generated: C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output\Make.config 1> Compiling binding code... 1> EM0000: Unexpected error - Please fill a bug report at https://github.com/mono/Embeddinator-4000/issues 1> System.NullReferenceException: Object reference not set to an instance of an object. 1> at Embeddinator.ObjC.SystemCheck.VerifyMono() 1> at Embeddinator.ObjC.Embedder.VerifyDependencies() 1> at Embeddinator.ObjC.Embedder.Compile() 1> at Embeddinator.ObjC.Driver.Main2(String[] args) 1> at Embeddinator.ObjC.Driver.Main(String[] args) 1> Debug Log: 1> Processing: 1 assemblies 1> Processing Assembly: Wrapper 1> Processing Type: Wrapper_ConnectivityWrapper 1> TypeMapper Register: System.Void .ctor() init 1> TypeMapper Register: System.Void StartBackend() startBackend 1> Begin Generator 1> Generating Assembly: Wrapper 1> Generating Type: Wrapper_ConnectivityWrapper 1> Generating Method: System.Void StartBackend() 1> Generating Method Impl: System.Void StartBackend() 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5185,5): error MSB3073: The command ""C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\packages\Embeddinator-4000.0.4.0\tools\objcgen.exe" C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\bin\Debug\Wrapper.dll --target=framework --platform=iOS --outdir=C:\NTG7_BYOD\NTG6TVIntegration\MainSolution\InterfaceWrapper\Wrapper\Output -c -v" exited with code 1. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Environment

1. /Library/Frameworks/Xamarin.Embeddinator-4000.framework/Commands/objcgen -0.4.0

  1. VS environment
Microsoft Visual Studio Professional 2019 (3)
Version 16.4.5
VisualStudio.16.Release/16.4.5+29806.167
Microsoft .NET Framework
Version 4.8.03761

Installed Version: Professional

Azure App Service Tools v3.0.0   16.4.460.23317
Azure App Service Tools v3.0.0

C# Tools   3.4.1-beta4-19614-01+165046097562cfe65b09c2e9a9d8f7cd88526f2c
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Mono Debugging for Visual Studio   16.5.24 (1fafd7e)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   5.4.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Visual Basic Tools   3.4.1-beta4-19614-01+165046097562cfe65b09c2e9a9d8f7cd88526f2c
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6   16.4.0-beta.19556.5+e7597deb7042710a7142bdccabd6f92b0840d354
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Foo   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   16.4.000.311 (d16-4@ddfd842)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.4.0.475 (remotes/origin/d16-4@ac250f5aa)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.4.25 (579ee62)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   10.1.4.0 (d16-4/e44d1ae)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: fd9f379
    Java.Interop: xamarin/java.interop/d16-4@c4e569f
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.28.0@46204c4
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-5@9f4ed4b

Xamarin.iOS and Xamarin.Mac SDK   13.10.0.17 (5f802ef)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Build Logs

Example Projects

chamons commented 4 years ago

Generating an obj-c framework requires Xcode/clang/a mac, and today the Embeddinator-4000 does not support remote builds to my knowledge.

Goldie13 commented 4 years ago

Uploaded sample projects. Can you pls confirm whether E4K does not support on visual studio windows for iOS applications using Mac agent (remote build)?

chamons commented 4 years ago

Sorry I was not crystal clear: The "remote build host" support in VS Windows does not apply to Embeddinator-4000. Full stop.

If you want to build a macOS native library with an embedded .NET library, you'll need to do it on a macOS build machine.

I'm leaving this issue open as a feature request, but give the sheer scale of it seems unlikely to be implemented.