Documentation

Development

User Acquisition

Monetization

Industry

Unity Ads Monetization

SDK 4.19.0

Supported
​

Android API reference

Unity Ads Monetization

SDK 4.19.0

Supported
​

Android developer guides
​
​
Android developer guide
  • Introduction to the Android SDK
  • Integration requirements
  • Install the Unity Ads SDK for Android
  • Initialize the SDK in Android
  • Implement interstitial ads in Android
  • Implement rewarded ads in Android
  • Implement banner ads in Android
Troubleshoot your integration
  • Test your Unity Ads integration
  • Unity Ads SDK troubleshooting guide
  • Introduction to Unity Ads SDK error handling
  • Troubleshoot SDK initialization errors
  • Troubleshoot SDK load errors
  • Troubleshoot SDK show errors
  • Unity Ads SDK error codes reference
Android developer APIs
  • Android SDK API reference - Kotlin and Java
  • Unity Ads SDK API deprecation policy
  • Android deprecated classes
  1. Unity Ads SDK Android developer monetization
  2. Unity Ads SDK integration guide for Android developers
  3. Unity Ads troubleshooting guide

Introduction to Unity Ads error handling

Review how and where to see Unity Ads SDK error messages to begin troubleshooting your monetization setup.
Read time 1 minute
Last updated 3 months ago

The Unity Ads SDK provides structured error handling to help developers identify and debug issues that occur during initialization, ad loading, or ad showing. When an operation fails, the SDK returns a
UnityAdError
object that contains both an error code and an error message describing what went wrong.
By default, these errors are returned through the SDK’s public API, but aren’t automatically printed to your development environment’s console. If you want to see them in your logs, you can either use the Unity Ads SDK APIs or set up your own logging method.
Note
In production, the recommended best practice is to route Unity Ads SDK errors through your existing logging for easier monitoring and debugging.

How to display errors

There are a couple of ways to display Unity Ads SDK error messages during development and testing. You can set SDK-generated logs or log error callbacks manually.

Use the LogLevel API

With Unity Ads SDK version 4.18.0, you can set the SDK’s internal log level to control how much information displays in the console about an error. This lets you automatically surface warnings, errors, or verbose debug output from the Unity Ads SDK without adding custom print statements.
Review the LogLevel API reference and the different log verbosity levels you can set for your Kotlin and Java, Swift, or Objective-C project.

Set up your own logging method

You can also manually log SDK errors returned through callbacks using your preferred logging method by following these steps:
  1. Handle the SDK’s error callbacks.
  2. Retrieve the error code and error message from the returned object.
  3. Print or log the error using your own logging mechanism.

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • How to display errors

      • Use the LogLevel API

      • Set up your own logging method


Report a problem with this page
​
​