有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

Xamarin Android绑定

我正在尝试为这里提供的安卓 sdk创建绑定https://www.nmi.com/sdks-and-apis#CDNA。绑定项目将生成,我可以将其添加到我的xamarin 安卓项目中,但一旦我包含它,就会出现以下错误/s

error: package com.creditcall.chipdnamobile does not exist com.creditcall.chipdnamobile.IApplicationSelectionListener ChipDnaSample.Android C:\Users\mikee\Documents\GitHub\ChipDna\ChipDnaSample\ChipDnaSample.Android\obj\Debug\90\安卓\src\mono\com\creditcall\chipdnamobile\IApplicationSelectionListenerImplementor.java 8

error: package com.creditcall.chipdnamobile does not exist private native void n_onAvailablePinPads (com.creditcall.chipdnamobile.Parameters p0); ChipDnaSample.Android C:\Users\mikee\Documents\GitHub\ChipDna\ChipDnaSample\ChipDnaSample.Android\obj\Debug\90\安卓\src\mono\com\creditcall\chipdnamobile\IAvailablePinPadsListenerImplementor.java 33

仅引用不同的类就有64个相同性质的错误。我已经把所有的代码放在GitHub上了here

如果我进入Obj/Release/generated/src,我可以找到iaapplicationselectionlistener,因此它创建了一些绑定,但实际上不起作用。有人能给我指出正确的方向,告诉我需要做些什么来纠正这些错误吗

谢谢


共 (1) 个答案

  1. # 1 楼答案

    您必须更改JAR的构建类型。java编译器找不到它,因为它在编译时不存在

    改变

    • InputJarEmbeddedInputJar用于芯片车。罐子
    • ^对于CardEaseXMLClient,{}到EmbeddedReferenceJar。罐子

    有关更多信息,请参阅:https://docs.microsoft.com/en-us/xamarin/android/platform/binding-java-library/binding-a-jar

    重要的句子:

    Typically, you use the EmbeddedJar build action so that the .JAR is automatically packaged into the bindings library. This is the simplest option – Java bytecode in the .JAR is converted into Dex bytecode and is embedded (along with the Managed Callable Wrappers) into your APK. If you want to keep the .JAR separate from the bindings library, you can use the InputJar option; however, you must ensure that the .JAR file is available on the device that runs your app.