Legacy Java Support (JDK 11)
While our main Unity Billing SDK is optimized for modern environments (JDK 17+), we recognize that some projects are tied to JDK 11 due to specific build pipelines or engine constraints.
As of release 3.3.0, JDK 11 is supported directly through MavenCentral, so manually importing AAR files is no longer required. We recommend migrating to the latest version and using the standard MavenCentral integration.
The manual AAR-based flow described below is only needed if you stay on an older release. If you keep the manual integration, make sure no old files remain under Assets/Plugins/Android and that you import the correct AAR files from the JDK 11 branch.
To support projects that remain on the manual flow, we have maintained a dedicated branch that reverts the distribution flow from MavenCentral to a manual AAR-based integration.
Prerequisites & Compatibility
Requirement | Value |
|---|---|
Java Version | JDK 11 |
Distribution | Manual AAR importing + UPM Branch |
Unity Versions | Unity 2022.3 LTS |
Branch URL |
|
Integration Steps
Follow these steps to integrate the Aptoide Unity Billing SDK supporting JDK 11.
1. Import the SDK via UPM
Instead of the main branch, you must target the specific #support-jdk-11 tag in the Unity Package Manager.
- Open your Unity project.
- Navigate to Window > Package Manager.
- Click the + icon and select Add package from git URL...
- Paste the following URL:
https://github.com/Aptoide/aptoide-unity-billing-sdk.git#support-jdk-11
2. Manual AAR Deployment
Because this version does not pull the Native SDK from MavenCentral (to maintain JDK 11 compatibility), you must move the Android binaries manually.
- In your Unity Project window, navigate to the Aptoide Package folder:
Packages/Aptoide Unity Billing SDK/Runtime/Plugins/Android - Copy all
.aarfiles found in that directory. - Paste them into your project's local folder:
Assets/Plugins/Android
Note: If the
Assets/Plugins/Androidfolder does not exist, create it manually.
3. Modify mainTemplate.gradle
To avoid version conflicts and ensure all logic is handled by the local AARs, you must adjust your Gradle configuration.
- Open your
mainTemplate.gradle(usually located inAssets/Plugins/Android). - Remove any existing
implementationimports for the Aptoide Native Billing SDK. - Add the manual dependencies required by the Native SDK. These are necessary because manual AARs do not "self-resolve" transitive dependencies like MavenCentral does. Ensure you include the standard AndroidX and Material libraries required for the SDK to function.
4. Configuration
Once the AARs and Gradle are set up, follow the standard Unity SDK Configuration Guide to initialize the billing client and define your products.
Troubleshooting JDK 11 Issues
- Duplicate Class Errors: If you see "Duplicate Class" errors during build, ensure you have removed the
implementationline for the Aptoide SDK from your Gradle files, as the SDK is now being provided locally by the AAR in yourPluginsfolder. Also, ensure that you've removed thePluginfolder from the Aptoide Unity Billing SDK folder and its.metafile. - Missing Dependencies: If the build fails with "Symbol not found" errors, double-check that you have manually added the necessary AndroidX and Material dependencies to your
mainTemplate.gradle.