1

I created an Android plugin for unity to handle some native jobs and it works fine on my device, until I wanted to add "WorkManager" class to handle some background jobs and I received following error:

java.Land.NoClassDefFoundError:
androidx.work.PeriodicWorkRequest$builder

I think the problem is that the androidx library does not exist at Runtime. my question is: How to add androidx support library to Unity3D?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Bardia
  • 155
  • 1
  • 2
  • 13

1 Answers1

0

Because using implementation , You can't use their Internal library's component.

Still You want to use, You need to manually import that library in Unity.

Download aar file from here. and import into unity project.

Abhay Koradiya
  • 2,068
  • 2
  • 15
  • 40
  • I'll give it a try... meanwhile how can I include runtime library directly into my plugin instead of importing another aar into my unity? – Bardia Aug 04 '18 at 10:54
  • I tried I. Now error changed to "java.Land.NoClassDefFoundError: androidx.work.impl.model.WorkSpec$1" – Bardia Aug 04 '18 at 11:05
  • ok remove that aar file and write `compile` instead of `implementation`. – Abhay Koradiya Aug 04 '18 at 11:07
  • I change it to compile and despite the "obsolete error" it gave, nothing happened. Is there any way to include runtime library into my final plugin file? – Bardia Aug 04 '18 at 11:21
  • "obsolete error" is not a error. Bro once you have to try it. – Abhay Koradiya Aug 04 '18 at 11:24
  • ;))). I tried it and I get the java.Land.NoClassDefFoundError: androidx.work.PeriodicWorkRequest$builder error again. – Bardia Aug 04 '18 at 11:30
  • I just tried but run into this: https://github.com/googlesamples/unity-jar-resolver/issues/145 – Gabor Aug 20 '18 at 21:12
  • @Gabor I used Jar resolver but It shows "Resolution Succeeded" but nothing happens – Bardia Aug 22 '18 at 12:22
  • What do you mean by nothing happens? Of course that's the case in general unless you do something. – Gabor Aug 22 '18 at 22:20
  • I mean the problem still exists, and Google's Jar resolver "Thinks" that "Resolution Succeeded" but it is not! – Bardia Aug 23 '18 at 08:36