Description:
I followed @tessarolli's post https://github.com/polarofficial/polar-ble-sdk/issues/56 to get an android native lib into an Xamarin Forms solution. I seem to be able to get the binding to work, though when calling PolarBleApiDefaultImpl.DefaultImplementation(), it crashes with this exception:
Java.Lang.VerifyError: 'Verifier rejected class com.polar.androidcommunications.enpoints.ble.bluedroid.host.BDDeviceListenerImpl: io.reactivex.rxjava3.core.Observable com.polar.androidcommunications.enpoints.ble.bluedroid.host.BDDeviceListenerImpl.monitorDeviceSessionState() failed to verify: io.reactivex.rxjava3.core.Observable com.polar.androidcommunications.enpoints.ble.bluedroid.host.BDDeviceListenerImpl.monitorDeviceSessionState(): [0x2] can't resolve returned type 'Unresolved Reference: io.reactivex.rxjava3.core.Observable' or 'Unresolved Reference: io.reactivex.rxjava3.subjects.BehaviorSubject' (declaration of 'com.polar.androidcommunications.enpoints.ble.bluedroid.host.BDDeviceListenerImpl' appears in /data/app/~~-C7FxCvhIscj7dh0FY5LqQ==/com.companyname.hrm-czy1GKioidpyr_vjb12I-A==/base.apk)'
Anyone else run into this problem?
Should it matter, the Xamarin project references these two Naxam packages:
And I compiled the polar-ble-sdk-4.0.0 project, which has these two dependencies:
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'implementation 'io.reactivex.rxjava3:rxjava:3.1.5'
I think that the cause of that error is mismatch between RxJava versions. Try to replace Naxam.RxJava2.Droid with Naxam.RxJava3.Droid and update your code to use RxJava3 classes and methods.
Platform your question concerns:
Device:
Description: I followed @tessarolli's post https://github.com/polarofficial/polar-ble-sdk/issues/56 to get an android native lib into an Xamarin Forms solution. I seem to be able to get the binding to work, though when calling
PolarBleApiDefaultImpl.DefaultImplementation()
, it crashes with this exception:Java.Lang.VerifyError: 'Verifier rejected class com.polar.androidcommunications.enpoints.ble.bluedroid.host.BDDeviceListenerImpl: io.reactivex.rxjava3.core.Observable com.polar.androidcommunications.enpoints.ble.bluedroid.host.BDDeviceListenerImpl.monitorDeviceSessionState() failed to verify: io.reactivex.rxjava3.core.Observable com.polar.androidcommunications.enpoints.ble.bluedroid.host.BDDeviceListenerImpl.monitorDeviceSessionState(): [0x2] can't resolve returned type 'Unresolved Reference: io.reactivex.rxjava3.core.Observable' or 'Unresolved Reference: io.reactivex.rxjava3.subjects.BehaviorSubject' (declaration of 'com.polar.androidcommunications.enpoints.ble.bluedroid.host.BDDeviceListenerImpl' appears in /data/app/~~-C7FxCvhIscj7dh0FY5LqQ==/com.companyname.hrm-czy1GKioidpyr_vjb12I-A==/base.apk)'
Anyone else run into this problem?
Should it matter, the Xamarin project references these two Naxam packages:
<PackageReference Include="Naxam.RxJava2.Droid" Version="2.1.2" />
<PackageReference Include="Naxam.ReactiveStreams.Droid" Version="1.0.1" />
And I compiled the polar-ble-sdk-4.0.0 project, which has these two dependencies:
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'io.reactivex.rxjava3:rxjava:3.1.5'