yasirkula / UnityNativeShare

A Unity plugin to natively share files (images, videos, documents, etc.) and/or plain text on Android & iOS
MIT License
890 stars 131 forks source link

Android Build Failure: - Duplicate Class com.yasirkula.unity.NativeShare #158

Closed dginovker closed 1 year ago

dginovker commented 1 year ago

Description of the bug

When building with UnityNativeShare in the repo, either installed via .unitypackage or through the Package Manager, I get the following error:

> 1 exception was raised by workers:
  java.lang.RuntimeException: Duplicate class com.yasirkula.unity.NativeShare found in modules jetified-NativeShare-runtime.jar (:NativeShare:) and jetified-NativeShare.jar (NativeShare.jar)

I've searched my project for instances of com.yasirkula.unity.NativeShare, but the only instance is this one here: https://github.com/yasirkula/UnityNativeShare/blob/master/Plugins/NativeShare/NativeShare.cs#L22

I don't see jetified-NativeShare-runtime.jar or jetified-NativeShare.jar in my project, so I'm a bit confused where those come from.

Reproduction steps

For me, just rebuild the project for Android

Platform specs

dginovker commented 1 year ago

This is 100% user error, I had other NativeShare libraries in the code I somehow kept looking over.

Solution: