java - 警告 BG8102 : has unknown base type android. app.IntentService。 (BG8102)。将 Java android 库绑定(bind)到 Xamarin 时

标签 java c# xamarin java-binding

我正在 Xamarin 上从事 BLE 项目。目前我正在研究无线设备固件升级 (OTA-DFU) 部分。我打算使用 native java Android DFU Library在 Xamarin 上。

我正在关注 documentation on binding Java library to Xamarin .

最后编译器显示 Warning BG8102: Class NO.Nordicsemi.Android.Dfu.DfuBaseService has unknown base type android.app.IntentService。 (BG8102) (AndroidDUFLibrary)。我能够在 Xamarin 中引用转换后的 java 库。但是缺少某些类,我无法引用它。

能否请您告诉我如何解决缺少类(class)的问题?

最佳答案

我找到了这个post .当我手动将 IntentService 源代码添加到我的项目时,缺少类的问题得到修复(创建新的 IntentService 文件并粘贴 IntentService 源代码)并在 IntentService 源代码中创建自定义包名称(例如 com.mynewpackage)。然后,我将项目中所有位置的 IntentService 替换为 com.mynewpackage.IntentService

这是一种丑陋的解决方案。我们必须在项目中为缺少的类一个一个地手动添加源代码文件。最好更改编译器中的一些配置以自动修复丢失类的问题。

关于java - 警告 BG8102 : has unknown base type android. app.IntentService。 (BG8102)。将 Java android 库绑定(bind)到 Xamarin 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32273321/

相关文章:

动态 Web 项目 (Eclipse) 中的 java.lang.UnsupportedClassVersionError

java - 启动时加载抛出 404

c# - 重构大型项目的 DI

xamarin - 如何显示远程iOS模拟器日志?

java - 如何设置<aui :input> tag's calendar date and locale in Liferay 6. 2 CE GA2?

java - 提取十六进制数的第三位

c# - 如何刷新挂起的 FileSystemWatcher 事件?

c# - 使用 Lambda 表达式将数据传递给线程

c# - 页面标题不显示在 Xamarin.Forms 项目中

c# - 在 Xamarin 中为 UITextField 正确设置背景图片