0

I have a fragment VideoPlayerBaseFragment inside a library project. I am using this library inside my app using artifactory build implementation

"com.mindvalley.module_videoplayer:module_videoplayer:1.9.3.6"

When I am building my app it is throwing following error :

Default method desugaring of com.mindvalley.module_videoplayer.base.fragment.VideoPlayerBaseFragment failed because its super class androidx.fragment.app.Fragment is missing

My library module implements exoplayer library

api "com.google.android.exoplayer:exoplayer:2.10.5"

I am unable to find the reason for this. It works fine with other libraries I have created and they also have fragment in them.

Harsh
  • 599
  • 3
  • 20
  • It is hard to say, since this library is not public (therefore the issue can't be reproduced). It might be a bug in d8 - try to downgrade to dx using `android.enableD8=false` (in gradle.properties). If build passes with dx - consider to report this issue. – Alex Lipov Sep 24 '19 at 05:36

1 Answers1

0

I also encountered this issue. The solution in my case turned out to be rather simple. I had to disable desugaring with D8 in my project's gradle.properties file. This can be done with the 2 lines below:

android.enableD8=false
android.enableD8.desugaring=false

You can then sync the project files, clean your project and build a debug apk. I encountered this issue when trying to build a debug apk or run instrumentation tests on an emulator running API 16, I never had when building release apk.