1

Lets say there exists a library x.y.z-1.0, x.y.z-2.0, x.y.z-3.0 that uses a.b.c-1.0, a.b.c-2.0, a.b.c-3.0 respectively.

I am currently writing another library (com.mysdk) that uses x.y.z-2.0. But I have not check the compatability of my library with x.y.z-1.0 and x.y.z-3.0. Thus I am going to shade x.y.z-2.0 to com.mylibrary.shaded.x.y.z-2.0. However, after investigation, a.b.c-2.0 will not be shaded. So the situation looks like the picture underneath. enter image description here My question comes in when the user of com.mysdk is also using a.b.c-1.0 at the same time. I could not make the project to use the specified a.b.c-1.0, instead it is using the a.b.c-2.0 in the sdk.

Man-Kit Yau
  • 149
  • 1
  • 10
  • The situation you are describing is exactly the reason why you should never shade other libraries. This will prevent the user from overwriting the dependency(if needed). And yes it could happen that the user will not be able to use your library but you have written your library with version 2.X in mind (functionality etc.) ... and yes it will not be possible to use the version version 1.X cause the version 2.X has been shaded.... – khmarbaise Dec 03 '19 at 19:28

0 Answers0