我正在 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/