Search Unity

Question Excluding a .jar from the build

Discussion in 'Android' started by ltomov, Feb 3, 2023.

  1. ltomov

    ltomov

    Joined:
    Aug 3, 2017
    Posts:
    96
    I'm using Unity's IAP plugin, but with a custom Amazon implementation that also includes Amazon's SDK. So I get the following error when building the apk:
    Code (Boo):
    1.   java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.amazon.device.iap.PurchasingListener found in modules AmazonAppStore-runtime.jar (:AmazonAppStore:) and in-app-purchasing-2.0.76.jar (in-app-purchasing-2.0.76.jar)
    So I'd like to remove AmazonAppStore-runtime.jar that comes with Unity's IAP plugin from the build, but I can't figure out how to do it.
    I guess I need to use custom gradle templates, but I cannot figure out the proper syntax.

    I'm using the External Dependency manager if that makes a difference.

    I tried things like
    Code (Boo):
    1. configurations.all {
    2.     exclude group:"com.amazon.device.iap", module: "AmazonAppStore-runtime"
    3.     }
    But it doesn't exclude it.

    Any help will be appreciated, thanks!