javac#xamarinjava-binding

Warning BG8102: has unknown base type android.app.IntentService. (BG8102). When Binding a Java android Library to Xamarin


I am Working on BLE project on Xamarin. Currently I am working on the Over-The-Air Device Firmware Upgrade (OTA-DFU) part. I am planing to use the native java Android DFU Library on Xamarin.

I am following the documentation on binding Java library to Xamarin.

In the end the compiler displays Warning BG8102: Class NO.Nordicsemi.Android.Dfu.DfuBaseService has unknown base type android.app.IntentService. (BG8102) (AndroidDUFLibrary). I was enable to reference the converted java library in Xamarin. But some class are missing and I cannot reference it.

Could you please let me know how can I fix the missing class issues?


Solution

  • I have found this post. The missing class issue was fixed when I manually add the IntentService source code to my project (create new IntentService file and paste the IntentService source code) and made custom package name inside the IntentService source code (e.g. com.mynewpackage). Then I replace the IntentService as com.mynewpackage.IntentService everywhere in my project.

    It's kind of ugly solution. We have to manually add source code files for the missing classes one by one in the project. It would be better to change some configuration in the compiler to automatically fix the missing class issue.