简体   繁体   English

在Xamarin Android名称中绑定.AAR不存在

[英]Binding an .AAR in Xamarin Android name does not exist

I'm trying to add this library to Xamarin project. 我正在尝试将此库添加到Xamarin项目。

I'm following Xamarin guide and going through binding an .AAR steps. 我正在遵循Xamarin指南并通过绑定.AAR步骤。 Now I'm stack on step accessing types . 现在,我正在逐步访问类型

I added binding library to project references and can see that 我将绑定库添加到项目引用中,可以看到

NamespaceMapping (Java = "com.antonyt.infiniteviewpager.library", Managed = "Com.Antonyt.Infiniteviewpager.Library")]

but when I use 但是当我使用

using Com.Antonyt.Infiniteviewpager.Library;

in one of my activities it still not recognise the name. 在我的一项活动中,它仍然无法识别名称。

Binding Library Build Action is LibraryProjectZip . 绑定库构建动作是LibraryProjectZip

What could cause this problem? 是什么导致此问题?

BuildAction for aar is LibraryProjectZip and this is OK. Aar的BuildAction是LibraryProjectZip,这是可以的。 Does your project compile? 您的项目可以编译吗? I assume yes, because you have not mentioned any errors. 我想是的,因为您没有提到任何错误。 Sometimes warnings might put some light on why some types are missing (java generics, obfuscated types etc). 有时,警告可能会阐明某些类型缺失的原因(Java泛型,混淆类型等)。

Without more info it will be difficult to help you. 没有更多信息,将很难为您提供帮助。

Few questions to start: 几个问题要开始:

  1. Is api.xml generated? 是否生成api.xml? Are your types you need there? 您需要那里的类型吗?
  2. Which version of java do you have? 您有哪个Java版本? Avoid 1.8. 避免1.8。 Use 1.7. 使用1.7。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM