[英]Xamarin iOS objective c binding library Could not create an native instance of the type
我為 Xamarin iOS 創建了一個綁定項目。我成功地添加了本機庫,創建了 C# 綁定並解決了我發現的所有數百個錯誤,一旦我嘗試運行該庫(在 iPhone 模擬器上的應用程序中) ):
無法創建“MyNamespace.STPPaymentCardTextField”類型的本機實例:本機 class 尚未加載。
這是objective-c中接口的簽名:
@interface STPPaymentCardTextField : UIControl <UIKeyInput>
這是我在 C# iOS 綁定中得到的:
[BaseType(typeof(UIControl))]
[Protocol]
interface STPPaymentCardTextField : IUIKeyInput
我閱讀了這個 stackoverflow答案並檢查了構建我的庫的體系結構,這是體系結構,考慮到我在 iOS 模擬器上運行它:
是:i386 x86_64
這是我用來構建庫的腳本:
all: lib$(TARGET).a
lib$(TARGET)-i386.a:
$(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphonesimulator -configuration Release
clean build
-mv $(PROJECT_ROOT)/build/Release-iphonesimulator/lib$(TARGET).a $@
lib$(TARGET).a: lib$(TARGET)-i386.a
xcrun -sdk iphoneos lipo -create -output $@ $^
clean:
-rm -f *.a *.dll
請問我該如何解決這個錯誤?
你能確定你在框架下列出了“UIKit”嗎? “本機引用 ->”本機庫的屬性“ -> “框架:UIKit”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.