xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.45k stars 511 forks source link

Need help in compiling InputMethodKit by self. #16070

Open ShikiSuen opened 2 years ago

ShikiSuen commented 2 years ago

Steps to Reproduce

  1. Download and compile this repository with VS for mac 2022 (link provided below).

Expected Behavior

A successful compilation

Actual Behavior

  bgen: Missing '[Field (LibraryName=value)]' for InputMethodKit.IMKServer.ControllerClass (e.g."__Internal")

Environment

Version information ``` Visual Studio Community 2022 for Mac Version 17.0.6 (build 4) Installation UUID: 9a9fef16-a1eb-4016-b6c9-e1ee20e033cb Runtime .NET 6.0.5 (64-bit) Architecture: X64 Roslyn (Language Service) 4.1.0-3.22075.3+592501cbb9c9394072a245c15b3458ff88155d85 NuGet 版本: 6.0.0.262 .NET SDK (x64) SDK: /usr/local/share/dotnet/sdk/6.0.302/Sdks SDK 版本: 6.0.302 6.0.301 6.0.300 6.0.105 6.0.103 6.0.101 5.0.408 5.0.406 5.0.404 5.0.103 3.1.421 3.1.420 3.1.419 3.1.417 3.1.416 3.0.100 MSBuild SDK: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks .NET 執行階段 (x64) 執行階段: /usr/local/share/dotnet/dotnet 執行階段版本: 6.0.7 6.0.6 6.0.5 6.0.3 6.0.1 5.0.17 5.0.15 5.0.13 5.0.3 3.1.27 3.1.26 3.1.25 3.1.23 3.1.22 3.0.0 Xamarin.Profiler 版本: 1.8.0.19 位置: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler Updater 版本: 11 Apple Developer Tools Xcode 14.0 (21335) Build 14A309 Xamarin.Mac Version: 8.10.0.5 (Visual Studio Community) Hash: 96b3edb6d Branch: d17-2 Build date: 2022-05-18 07:32:06-0400 Xamarin.iOS Xamarin.iOS not installed. Can't find mtouch or the Version file at /Library/Frameworks/Xamarin.iOS.framework/Versions/Current. Xamarin Designer Version: 17.1.5.90 Hash: 53f47efde Branch: remotes/origin/d17-0-vsmac Build date: 2022-07-07 17:07:58 UTC Xamarin.Android 未安裝 Microsoft Build of OpenJDK Java SDK: 找不到 Eclipse Temurin JDK Java SDK: 找不到 Android SDK Manager Version: 17.2.0.37 Hash: 7f5a6ef Branch: remotes/origin/d17-2 Build date: 2022-07-07 17:08:03 UTC Android Device Manager Version: 0.0.0.1116 Hash: e47e6c8 Branch: remotes/origin/d17-2 Build date: 2022-07-07 17:08:03 UTC Build Information Release ID: 1700060004 Git revision: 056076d45137bf76b73f62f871524da8890deb05 Build date: 2022-07-07 17:06:08+00 Build branch: release-17.0 Build lane: release-17.0 Operating System Mac OS X 13.0.0 Darwin 22.1.0 Darwin Kernel Version 22.1.0 Mon Aug 29 20:09:50 PDT 2022 root:xnu-8792.40.74.0.1~20/RELEASE_X86_64 x86_64 ```

Build Logs

已經開始建置於 22/9/2022 13:20:01。
記錄詳細程度設定為: Normal。     1>節點 1 (build 目標) 上的專案 "/Users/shikisuen/Projects/InputMethodKit/InputMethodKit.csproj"。
     1>_GenerateBindings:
         /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin/bgen @/Users/shikisuen/Projects/InputMethodKit/obj/Debug/response-file.rsp 
     1>BTOUCH : error BI1042: bgen: Missing '[Field (LibraryName=value)]' for InputMethodKit.IMKServer.ControllerClass (e.g."__Internal")
     1>專案 "/Users/shikisuen/Projects/InputMethodKit/InputMethodKit.csproj" (build 目標) 建置完成 -- 失敗。

建置失敗。

       "/Users/shikisuen/Projects/InputMethodKit/InputMethodKit.csproj" (build 目標) (1) ->
       (_GenerateBindings 目標) -> 
         BTOUCH : error BI1042: bgen: Missing '[Field (LibraryName=value)]' for InputMethodKit.IMKServer.ControllerClass (e.g."__Internal")

    0 個警告
    1 個錯誤

經過時間 00:00:01.72

Example Project (If Possible)

https://github.com/ShikiSuen/InputMethodKit_CSharp

tj-devel709 commented 2 years ago

Hello @ShikiSuen. Our binding frameworks can possibly bind a system installed framework, but this isn't a supported use case. If you would like to work on the official binding, you may try getting assistance on the discord channel (https://aka.ms/dotnet-discord) and can consider looking into binding it in the main SDK if you are interested.

ShikiSuen commented 2 years ago

@tj-devel709 Thanks for your response.

this isn't a supported use case

May I confirm whether "this" indicates "bind any system installed framework" or specifically "InputMethodKit"?

ivanicin commented 2 years ago

@ShikiSuen macOS API is not 100% supported, so some not so frequently used system frameworks are not bound in Xamarin.Mac.

This is not the official answer as I am just a developer like you, but it is correct and you can find more info regarding that if you search on the internet.

ShikiSuen commented 1 year ago

@ivanicin "not so frequently used system frameworks"

I am afraid that the InputMethodKit is high-frequently used in CJK input method programming. Certain types of macOS built-in input methods are just terrible, and Apple never listen / improve in these years. This is why 3rd-party input methods must step in.