Forum Xamarin.Android


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Xamarin Android Bindings that uses Android.WorkManager

We are making an app that needs to use Android's WorkManager library. The dependency .AAR file is compiled and tested working. I was able to build a DLL by binding the dependency AAR file using Visual Studio's Java Bindings Project.

However, when the Xamarin Android project uses the dependency library that uses the Android WorkManager, it throws an exception:

            Java.Lang.NoClassDefFoundError: Failed resolution of: Landroidx/work/WorkManager; ---> 
            Java.Lang.ClassNotFoundException: Didn't find class "" on path: 
            DexPathList[[zip file "/data/app/"],nativeLibraryDirectories=[/data/app/, /data/app/!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]

I also tried downloading the Android WorkManager AAR file, created its own Bindings Library project, compiled that, and added it to the main Xamarin Forms project, along with the dependency AAR. But I get this error:

error: CommandsCompletedListener is not public in SystemAlarmDispatcher; cannot be accessed from outside package

Is there something I should include or modify in the dependency Bindings project?

I already tried adding the WorkManager AAR to the dependency Bindings project and using that, but I still get the ClassNotFoundException. Has anyone tried using a Java dependency that uses the WorkManager for Xamarin Android?


Sign In or Register to comment.