Integrate

0. Latest ADX Unity SDK version

1. Requirements

  • Android

    • compileSdkVersion 35 or later.

    • minSdkVersion 23 or later.

  • iOS

    • iOS 13.0 or later

    • Xcode 16.0 or later.

    • CocoaPods

  • Unity Editor

    • Unity 2019.4 or later.

2. Add ADX Unity SDK

1) Download the ADX Unity SDK:

2) In Unity Editor, go to Assets > Import Package > Custom Package, locate the downloaded ADXUnityPackage.unitypackage file, and import it. Alternatively, you can double-click the ADXUnityPackage.unitypackage file to run the import process.

When updating to a new package, delete the following directories and files before importing ADXUnityPackage, and then proceed:

  • Assets/ADXLibrary folder

  • Assets/GoogleMobileAds folder

  • AdMob-related files in Assets/Plugins/Android

  • AdMob-related files in Assets/Plugins/iOS

3) Select all files and import.

4) If Unity Play Services Resolver is already included in your project, exclude ExternalDependencyManager from the ADXUnityPackage before importing it.

3. Project Setting

1) Android Setting

  • Open the mainTemplate.gradle file in the Assets/Plugins/Android directory, and add the compileOptions section under the android block.

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
  • To configure Play Services Resolver, follow these steps:

    1. Go to Assets > External Dependency Manager > Android Resolver > Settings.

    2. Check Use Jetifier.

    3. Click Force Resolve to run the resolver.

Make sure to enable this setting to support legacy AndroidX compatibility using Jetifier.

2) iOS Setting

  • Go to Assets > External Dependency Manager > iOS Resolver > Settings and make sure Add use_frameworks! to Podfile is checked.

  • If using Unity 2019.4 or later, also ensure Link frameworks statically is checked under the same settings menu.

  • After building in the Unity Editor, open the generated *.xcworkspace file (e.g., Unity-iPhone.xcworkspace) in Xcode.

    When building for iOS in Unity, CocoaPods is used, 
    so you must open the xcworkspace file in Xcode instead of the xcodeproj file.

  • In your project’s Build Settings, set Enable Bitcode to No.

<Build Settings - Enable Bitcode>
  • For Unity 2019.3 or later, set Enable Bitcode to No for both Unity-iPhone and UnityFramework targets.

<Build Settings - Enable Bitcode>
  • In Xcode, select the build target (UnityFramework) and go to Build Settings > Other Linker Flags. If you use the -all-load or -force_load flags, symbol duplication errors may occur. In this case, replace them with the -ObjC flag.

    <Build Settings - Other Linker Flags>
  • Make sure $(inherited) is added in the following build target settings. If it is not added, build errors may occur indicating that related libraries cannot be found.

    - Xcode > select build target (Unity-iPhone) > Build Settings > Other Linker Flags - Xcode > select build target (UnityFramework) > Build Settings > Framework Search Paths

    <Build Settings - Other Linker Flags>

    <Build Settings - Framework Search Paths>

  • If you encounter a build error such as "Cannot use '@try' with Objective-C exceptions disabled", change the following setting from No to Yes: - Xcode > select build target (UnityFramework) > Enable Objective-C Exceptions

<Build Settings - Enable Objective-C Exceptions>
  • When uploading to App Store Connect (Xcode > Product > Archive), set Always Embed Swift Standard Libraries for each build target as shown in the figure below. Incorrect settings may cause the upload to App Store Connect to fail.

4. Supporting iOS 14+

If your app supports iOS 14 or later, you must implement the ATT (App Tracking Transparency) framework to obtain the IDFA (Identifier for Advertisers). For detailed instructions, please refer to the link below.

App Tracking Transparency

5. Notice

1) Android Gradle Version (Check Unity Engine Version)

  • If a Gradle version lower than the recommended version is used, the AdMob Unity plugin may produce the error: “This feature requires ASM7”. This can be resolved using one of the following methods:

    • Update the Gradle and Gradle Plugin to a supported version (recommended)

    • Update the Unity Engine to a newer version

2) AdMob App ID Initialization Issue

  • If the App ID entered in GoogleMobileAdsSettings is removed, go to Unity > Assets > Google Mobile Ads > Settings and toggle Delay App Measurement: first check it, then uncheck it.

Last updated

Was this helpful?