Xamarin.Android Java.Lang.NoClassDefFoundError Failed resolution of: Lokio/Buffer;
I am trying create a Xamarin binding library of a native android library which has two dependency.
- Google services Vision
- Square okhttp3
After adding these 2 packages from Nuget packages, I found out that Google services vision
has an internal dependency on
Xamarin.AndroidX.Arch.Core.Runtime
and Square okhttp3
library has a dependency on square okio
library. My packages list looks like this.
Once the binding library is build library.dll
is generated, I used the library.dll
file as a reference in an android app.
After successfully running the app, the internal dependency package, square okio
library is not resolved where as the internal dependency package Xamarin.AndroidX.Arch.Core.Runtime
has resolved without any issues.
This is the error i am getting
A workaround i found to make it work is that, in the app if i add a reference of square okio
library and run the app, it works.
Since I am trying to release a library to nuget repository and I wouldn't want the client to add another reference other than my library. Is there a way to make this work without adding any reference in the app? It is okay to add the reference in the binding library but not in the app.