问题标签 [xamarin-binding]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
105 浏览

xamarin.ios - 用于 Xamarin 的 Sharpie 和 GVRSDK 绑定

我想将 GVRSDK.ios (GOOGLE Cardboard SDK) 库绑定到我的 Xamarin 项目中,但我遇到了一些问题。

当我尝试使用 Sharpie 创建绑定时,我只会得到“GoogleToolboxForMac”和“GTMSessionFetcher”来绑定;创建了 2 组属性和结构文件。

我想要的库是 GVRSDK,但是这个库没有被绑定。有人可以指导我正确的方向吗?这是我第一次绑定 ios。

使用的命令:

我阅读了网站上的文档,但我仍然无法理解它。那里的样本必须使用不适用于此的不依赖项的简单库。

0 投票
0 回答
378 浏览

xamarin.android - Xamarin Android 绑定多个 AAR 无法访问资源

我正在尝试制作一个 Android Xamarin 绑定库(用于Zendesk)。最初的问题是这个库是一个多 AAR 项目。标准问题是绑定库一次只能绑定到一个 AAR。如果有多个 AAR,那么绑定只会发生在其中一个上(根据我的经验添加的最新一个)。( AAR 上的BugzillaXamarin.Forums 以及许多其他内容都可以找到)。

请记住,按照我在下面所说的一切,有很多 Jar 文件需要作为 EmbeddedReferenceJars 添加。

我首先尝试将所有文​​件放到一个文件夹中(并从它们来自的文件夹中命名它们),然后将所有资源合并到一个文件夹中。Zendesk 平面文件夹结构 我将其压缩,将 zip 文件夹重命名为 AAR 并尝试绑定项目。在metadata.xml中做了一些事情之后,我成功地编译了带有警告的绑定项目,但是测试应用程序遇到了下面所述的问题。

从那里,我决定尝试看看如果我将每个 AAR 解压缩到这个文件夹中会发生什么,并查看结果(我必须将 classes.jar 放在主级别以尝试绑定)。Zendesk 树文件夹结构 我将其压缩,将其重命名为 AAR 并尝试绑定该项目。经过一些小的编辑后,我成功编译了带有警告的绑定项目,但测试应用程序遇到了以下问题。

接下来我尝试为每个 AAR 创建一个绑定项目,并在每个绑定项目中,将其他 AAR 的 classes.jar 文件作为 EmbeddedReferenceJar 文件,以便它可以构建。再次:我遇到了以下问题。

我一直遇到的问题是绑定中的 R 文件没有被编译,并且不允许测试应用程序编译。(即找不到字符串@string/contact_fragment_title,我可以确认它在values.xmlR.txt文件中)。我试图将字符串放入我在测试项目中的个人字符串文件中,或者只是完全删除对这些字符串的引用。当我这样做时,我可以编译测试应用程序,但我收到一条错误消息,指出com.zendesk.sdk.R$attr NoClassDefFoundError.

任何帮助将不胜感激。如果我需要澄清任何事情(我的写作很糟糕),请随时提问。

0 投票
0 回答
145 浏览

xamarin - 没有为 jar 库生成 Xamarin android C# 类

我正在尝试为此库Android POS Print SDK创建 xamarin android 绑定。除了这个 ESCPOSPrinter 之外,它可以很好地生成 C# 类。这是完成所有工作的主要课程。但它不会生成,尽管它存在于 api.xml 中。您能否建议可能是什么问题以及如何使其生成此类,以便我可以在 Xamarin App 中使用它?

提前致谢。

0 投票
1 回答
379 浏览

c# - Xamarin 中的 MVVM 绑定

一段时间以来,我一直在使用 Xamarin 中的绑定上下文遇到问题。

这是我的模型:

这是我的视图模型:

这是我的视图代码,我将我的 ViewModel 绑定到视图:

我的视图的代码:

这运行良好。现在我确定您会注意到{}每个条目的 text 属性的绑定标记中的 。是的,它通常不应该在那里,但是当我在没有 的情况下运行它时{},它不会像{}前面的那样显示绑定属性的值。我想知道是否有更好的编码方式。

0 投票
1 回答
145 浏览

c# - 错误 BI0000 意外错误 - Xamarin.IOS 绑定

尝试使用 AdyenCSE SDK 编译本机绑定项目时,出现以下错误:

/Volumes/DADOS/Empresa1/ios-auto-binding-tool/objc-automatic-master/bindings/AdyenCSE/BTOUCH:错误 BI0000:意外错误

此代码由此工具生成:https ://github.com/alexsorokoletov/objc-automatic

有什么错误吗?

0 投票
0 回答
962 浏览

xamarin - Native Binding 项目因 MTOUCH 失败:错误 MT5210:Native linking failed, undefined symbol

使用 Objective Sharpie 我为一个内部的 Objective C 库创建了一个绑定项目,该绑定项目包括三个 ios 框架源

在此处输入图像描述

绑定项目构建良好并按预期生成输出 dll,使用 iLSpy 检查输出 dll 确认本机引用包含在 dll 中。创建了一个演示应用程序来测试绑定,但问题是我无法编译演示应用程序,它失败了

架构 x86_64 的未定义符号:
“_IOS_DERIVED_CREDENTIALS”,引用自:_IOS_STORAGE in IdentosSDK(ios_storage.o) “_OPENSSL_DERIVED_CREDENTIALS”,引用自:_OPENSSL_STORAGE in IdentosSDK(openssl_storage.o) “_OPENSSL_EC”,引用自:
_oopenssl_with_type in IdentosSDK(ssl_identity.o) ) "_PENDING_REGISTRATION",引用自:
IdentosSDK(id_start_state.o) 中的_to_initialized_state

在最终失败之前

MTOUCH:错误 MT5210:本机链接失败,未定义符号:_IOS_DERIVED_CREDENTIALS。请确认所有必要的框架都已被引用并且本机库已正确链接。 MTOUCH:错误 MT5210:本机链接失败,未定义符号:_OPENSSL_DERIVED_CREDENTIALS。请确认所有必要的框架都已被引用,并且本地库已正确链接。

我尝试过gcc_flags传递给 mtouch,如下所示

在此处输入图像描述

我知道绑定项目中的框架支持适当的架构,因为运行 lipo -info libIdentosSDK.a 会产生:armv7 i386 x86_64 arm64

不知道还能做些什么来解决这个问题。任何帮助将不胜感激。完整的构建日志

0 投票
0 回答
137 浏览

c# - 将 Swift 库 ATInternet 绑定到 iOS 项目编译错误:Native linking failed

我正在尝试将新版本的 ATInternet 的ATTracker(现在用Swift制作)绑定到Xamarin.Forms项目。

我遵循本教程并从这个项目示例开始。我用 ATInternet 库替换了本机参考。然后,我在 Mac 上使用 Sharpie 生成了ApiDefinition.cs文件(并将其简化为最小版本,因此它只能初始化默认跟踪器)。我得到以下ApiDefinition.cs文件:

然后在我的 Xamarin.iOS 项目中像这样使用它:

但是每次我尝试编译项目时,都会出现以下错误:

我在这里把我的项目推到了github上

知道如何摆脱这个错误吗?

0 投票
1 回答
261 浏览

android - 使用本机库中的功能的 Xamarin 表单应用程序

我的应用程序中唯一特定于平台的代码来自本机库。所以我看到了两个选择:

1. iOS 和 Android 项目引用其适当的绑定。这将要求它们都处理需要这些平台相关库的 UI 事件。

2.创建一个共享项目,该项目将围绕绑定项目创建包装器以创建统一的 API,然后使用编译器指令选择适当的实现。

我不确定第一个选项是否可以实现:本机处理 UI 事件并将共享响应返回到跨平台 xamarin 表单项目以进行进一步处理。

我相信第二种选择,两个应用程序都将包含所有代码。如果我已经使用 .NET Standard 代码共享策略(因为 .NET 标准不支持编译器指令而需要),我也不知道是否可以使用共享项目。

0 投票
0 回答
210 浏览

xamarin - 客观 Sharpie 材料成分

我正在尝试为 Google 的iOS 材质组件创建 Xamarin 绑定, 但在使用 Objective Sharpie 时收到有关缺少标头的错误。

第一步:

结果:

第二步:

结果:

我试图将缺少的头文件从其他依赖库复制到 MaterialComponents.framework/Headers 文件夹中,但它仍然会导致最终失败。

当 MaterialComponents 片段引用其他库时,如何让 Objective Sharpie 创建绑定?

0 投票
0 回答
195 浏览

xamarin - Xamarin binding for AWS SDK

Summary

  • When binding a JAR/AAR built on top of aws-java-sdk, do you have to EmbeddedReferenceJar all the libraries below your JAR, down to and including the aws-java-sdk, when down at that low level the AWS SDK for .NET has the functionality.

  • Are there any Xamarin packages (Xamarin.Forms or Xamarin.Android) that give an out-of-the box authentication UI with Sign-In/Sign-Up buttons for AWS user pools, Google+, Facebook authentication providers ?

Context

I would like to use SignInUI from aws-android-sdk-auth-ui in a Xamarin.Android app, which gives you an out-of-the-box UI for authentication to AWS. I've got the AWS UserPool and AWS IdentityPool setup already.

Unfortunately, the AWS SDK for .NET does not expose the equivalent aws-android-sdk-auth-ui a java package built on top of aws-android-sdk-auth-core (also unavailable in .NET), which is built on top of aws-android-sdk-core and finally aws-java-sdk.

I thought about binding a java library. I would create a Xamarin binding project for aws-android-sdk-auth-ui.aar downloaded from maven Central. I followed the Binding an .AAR tutorial. It builds, but the generated aws-android-sdk-auth-ui.dll file is missing some classes. I opened the dll with Ildasm.exe and in the Com.Amazonaws.Mobile.Auth.UI namespace I only found AuthUIConfiguration and BuildConfig, clearly missing the SignInUI class.

Is it expected that when you build a binding project for an .aar file that references other .jar, the build succeeds but silently does not produce wrapper classes for java classes who reference missing jars? I would have guessed building would succeed AND would include a wrapper for all classes, but a failure would occur at runtime in codepaths that require the missing jar.

Alright, so I added aws-android-sdk-auth-core.jar, aws-android-sdk-core.jar to the bindings project, as EmbeddedReferencedJar. That did not help, the generated dll is also missing the same classes. The build output pasted below does point in the direction of misssing reference jars. See below.

How far do I need to go though, do I also need to embed all the way down to the 80MB aws-java-sdk.jar?

I have the following build output:

  • android/support/v7/app/AppCompatActivity indicates that com.android.support:appcompat isn't found. How are those supposed to bind? In Xamarin.Android these classes are in Xamarin.Android.Support.v7.AppCompat Nuget package. But the jar does not know it's running in Xamarin.Android. Does that mean I also need to EmbedReferenceJar all the native Android stuff as well? That's a deep rabbit hole...
  • com/amazonaws/mobile/auth/core/DefaultSignInResultHandler: that one should not error, I did embed aws-android-sdk-auth-core.jar with EmbbededRefenceJar

Update:

Someone referred me to Xamarin.GradleBindings. I haven't tested this yet, but thought I'd share in hopes this can be useful to other readers.