微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – 将.NET标准类库转换为本机aar / jar

目前,我们正在开发一个.NET标准类库,将由不同的Xamarin.*平台使用.

我想知道是否有一种方法可以在原生Android项目中使用共享代码(可能会生成AAR / JAR文件).

我需要这个功能的原因是因为我们的公司为我们的一个客户提供了一个AAR(由本机Android项目使用),我们希望保留一个代码而不是两个.

提前致谢!

解决方法:

更新:

名称已更改为“.NET嵌入”,此更新时位于v0.4.

> https://developer.xamarin.com/releases/dotnetembedding/dotnetembedding_0/dotnetembedding_0.4/

新说明:

> Installing .NET Embedding

原帖:

你可以使用Mono的Embeddinator-4000

It supports varIoUs language consumers, so it surfaces .NET code as idiomatic code in the target language. This is the list of supported languages at present:

> Objective-C:将.NET映射到惯用的Objective-C API.
> Java:将.NET映射到惯用Java API.
> C:将.NET映射到面向对象的C API.

Embeddinator-4000 is a tool that allows your existing .NET Code (C#, F# and others) to be consumed from other programming languages and in varIoUs different environments.

Java is currently in a preview state for macOS, Windows, and Android.

The platform is selected by passing the –platform= command-line argument to the embeddinator. Currently macOS, Windows, and Android are supported.

回复https://mono.github.io/Embeddinator-4000/

作为Android要求的一部分,您将需要Xamarin.Android 7.4.99和Android Studio 3(Java 1.8),但如果您使用Xamarin和Java构建Android应用程序,那么您将拥有这些应用程序.

注意:此工具处于预览状态,因此请查看未解决的问题并在需要时发布新问题.

回复https://github.com/mono/Embeddinator-4000/issues

注意:这不是反编译,而是将Mono的运行时嵌入到允许CIL代码,AOT(即iOS)或不在不同语言/运行时内运行的本机包中.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐