How do i use iap 4.12.0

hello.
i recevied message from google.
By August 31, 2024, all new apps and updates to existing apps must use Payments Library version 6 or higher.

Unity 2022 2023 version 6 are all supported only up to 4.11.
How do I use it in 4.12?
I am inquiring as I believe version 6 of the payment library is supported in 4.12.

1 Like

As per info from another thread, Unity IAP team is currently working on 4.12 which covers the warning. You can poll [this page]( https://discussions.unity.com/t/632966 page-3) for any new updates.

I don’t have this update, Unity version 2022.3.22f1.

me too, i can see only 4.11.0~

Likewise, I only see 4.11.0.
Could it be that the Package Manager has not been updated?
Or is it some kind of bug?

Someone told me to edit the contents of the manifest.json file.
So I tried modifying the version of the “com.unity.purchasing”: “4.11.0” entry specified in manifest.json in the MyPrjoect/Packages folder.

However, only the name displayed in the package manager changed.

Unity IAP package 4.12.2 is now available page-3


You can download by setting the version directly from the package manager.

Go to the Package Manager, click on the + in the top-left corner, select Add package by name and add the name com.unity.purchasing and click Add. This should install 4.12.0

13 Likes

Thank you very much! Works perfect!

After install the package manager what should i do?. Do i need to change my code or something?

Nothing much!

  1. Do a force resolve via EDMU
  2. Make a build
  3. Push to store!
    Check this .
1 Like

using 2021.3.28f1
But after trying to build had gradle and duplicate dependencies issues. Any fix for this?

Share the error logs if you hit an issue. Without logs its difficult to find out what went wrong.

1 Like

sure i will share shortly.

Hello everyone, i just upgraded to the 4.12 and i tried also to build a bundle for Android and i got the duplicate dependencies issues. I did the force resolve with EDMU and also in my gradle properties file i have those options as true "
android.enableJetifier=true
android.useAndroidX=true
"
i have attached the build errors of duplicates, if anyone can help i would really much appreciate it!

9934923–1438083–DuplicateDependencies.txt (7.06 KB)

2 Likes

I am having the same problems. There is no way to have a build with using IAP 4.12.0. I’ve tried changing editor versions, using custom gradle files, custom external tools, etc etc…

When i go back to IAP 4.11.0 or lower there is no problem but i have to use 4.12.0 due to reason newer google billing library.

2 Likes

We have the same issue of duplicate classes. We are using Unity 2022.3.42f on Mac OS Ventura 13.5.1
We also have latest versions of Firebase, Google Mobile Ads and Google Play Games plug-ins. External Dependency Manager is version 1.2.181
It builds successfully with IAP 4.11 but not with 4.12.2

did you manage to solve this problem?

Share the complete error log guys!

IAP 4.12.2
android.enableJetifier=true
android.useAndroidX=true
Unity 2022.3.42f1

I tried everything suggested above


1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class android.support.v4.app.RemoteActionCompatParcelizer found in modules core-1.2.0-runtime (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.6.0-runtime (:androidx.core.core-1.6.0:)
     Duplicate class android.support.v4.graphics.drawable.IconCompatParcelizer found in modules core-1.2.0-runtime (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.6.0-runtime (:androidx.core.core-1.6.0:)
     Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.2.0-runtime (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.6.0-runtime (:androidx.core.core-1.6.0:)
     Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.2.0-runtime (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.6.0-runtime (:androidx.core.core-1.6.0:)
     Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.2.0-runtime (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.6.0-runtime (:androidx.core.core-1.6.0:)
     Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.2.0-runtime (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.6.0-runtime (:androidx.core.core-1.6.0:)
     Duplicate class androidx.activity.Cancellable found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.ComponentActivity found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.ComponentActivity$1 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.ComponentActivity$2 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.ComponentActivity$2$1 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.ComponentActivity$2$2 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.ComponentActivity$3 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.ComponentActivity$4 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.ComponentActivity$5 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.ComponentActivity$NonConfigurationInstances found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.ImmLeaksCleaner found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.OnBackPressedCallback found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.OnBackPressedDispatcher found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.OnBackPressedDispatcher$LifecycleOnBackPressedCancellable found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.OnBackPressedDispatcher$OnBackPressedCancellable found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.OnBackPressedDispatcherOwner found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.contextaware.ContextAware found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.contextaware.ContextAwareHelper found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.contextaware.OnContextAvailableListener found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResult found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResult$1 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResultCallback found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResultCaller found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResultLauncher found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResultRegistry found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResultRegistry$1 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResultRegistry$2 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResultRegistry$3 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResultRegistry$CallbackAndContract found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResultRegistry$LifecycleContainer found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.ActivityResultRegistryOwner found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.IntentSenderRequest found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.IntentSenderRequest$1 found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.IntentSenderRequest$Builder found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContract found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContract$SynchronousResult found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$CreateDocument found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$GetContent found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$GetMultipleContents found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$OpenDocument found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$OpenDocumentTree found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$OpenMultipleDocuments found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$PickContact found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$RequestMultiplePermissions found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$RequestPermission found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$StartActivityForResult found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$StartIntentSenderForResult found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$TakePicture found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$TakePicturePreview found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.activity.result.contract.ActivityResultContracts$TakeVideo found in modules jetified-activity-1.2.3-runtime (androidx.activity:activity:1.2.3) and jetified-androidx.activity.activity-1.2.0-runtime (:androidx.activity.activity-1.2.0:)
     Duplicate class androidx.annotation.AnimRes found in modules annotation-1.3.0 (androidx.annotation:annotation:1.3.0) and jetified-androidx.annotation.annotation-1.5.0 (androidx.annotation.annotation-1.5.0.jar)
     Duplicate class androidx.annotation.AnimatorRes found in modules annotation-1.3.0 (androidx.annotation:annotation:1.3.0) and jetified-androidx.annotation.annotation-1.5.0 (androidx.annotation.annotation-1.5.0.jar)
     Duplicate class androidx.annotation.AnyRes found in modules annotation-1.3.0 (androidx.annotation:annotation:1.3.0) and jetified-androidx.annotation.annotation-1.5.0 (androidx.annotation.annotation-1.5.0.jar)
     Duplicate class androidx.annotation.AnyThread found in modules annotation-1.3.0 (androidx.annotation:annotation:1.3.0) and jetified-androidx.annotation.annotation-1.5.0 (androidx.annotation.annotation-1.5.0.jar)
     Duplicate class androidx.annotation.ArrayRes found in modules annotation-1.3.0 (androidx.annotation:annotation:1.3.0) and jetified-androidx.annotation.annotation-1.5.0 (androidx.annotation.annotation-1.5.0.jar)
     Duplicate class androidx.annotation.AttrRes found in modules annotation-1.3.0 (androidx.annotation:annotation:1.3.0) and jetified-androidx.annotation.annotation-1.5.0 (androidx.annotation.annotation-1.5.0.jar)
     Duplicate class androidx.annotation.BinderThread found in modules annotation-1.3.0 (androidx.annotation:annotation:1.3.0) and jetified-androidx.annotation.annotation-1.5.0 (androidx.annotation.annotation-1.5.0.jar)
     Duplicate class androidx.annotation.BoolRes found in modules annotation-1.3.0 (androidx.annotation:annotation:1.3.0) and jetified-androidx.annotation.annotation-1.5.0 (andr<message truncated>

I finally managed to solve the problem. The solution that worked for me:

  1. Upgrade IAP to version 4.12.x (I used 4.12.2): Windows → Package Manager → Find “In App Purchasing” and upgrade it to 4.12.0 (or later)
    2. Delete everything under Assets/ExternalDependencyManager/Editor ← This is very important. This is the step that I missed and because of this I was not able to build the project
  2. Install the latest version of External Dependency Manager (I used 1.2.182)
  3. Restart Unity
  4. Delete Resolved libraries (probably not needed): Assets-> External Dependency Manager → Android Resolver → Delete Resolved Libraries
  5. Force Resolve: Assets-> External Dependency Manager → Android Resolver → Force Resolve
  6. Build
  7. Drink that well-deserved beer
6 Likes