# Troubleshooting Start from what you see: no ad, no banner, a failed build, no reward. Every error code and detail, with its cause and fix, is on the Errors page of the reference. *NGA SDK 0.1.0 preview: you install 0.1.0 from Maven Central and NGA's public repositories. Every 0.x version is a preview under the NGA SDK License, and the API can change until 1.0. Questions: hi@nga.network. This page: https://nga.io/docs/sdk/troubleshooting/* ## No ad shows Read `error.code` and `error.detail` in your `onFailed` or `onShowFailed`, then: | You get | Check | | --- | --- | | `RENDER_NOT_AVAILABLE / render.absent` | `nga-sdk-render` (Android), the `NGASDKRender` product (iOS) or `network.nga.sdk-render` (Unity) is missing from the build. | | `RENDER_NOT_AVAILABLE / render.version_mismatch` | the two libraries are at different versions, or come from two builds of one version (two candidates, or the release and a candidate before 0.1.0-rc.6). Use one release for both. | | `NOT_INITIALIZED` | `initialize` was not called, or it failed. Look at what `onInitialized` reported. | | `INVALID_CONFIG / app_key.*` | the app key is mistyped, from another game, or the release build's package name or bundle id is not the one registered for the game in the portal. | | `INVALID_PLACEMENT` | the placement id is mistyped (`placement.format`), or it is not one of this game's placements in the portal (`placement.unknown`). | | `NO_FILL` | a normal answer: see [No fill while testing](https://nga.io/docs/sdk/testing/#no-fill-while-testing). `retryAfterMillis` says when to ask again. If a game that was served gets only `no_fill.decision` while your portal shows nothing switched off or stopped, NGA may have turned its ads off: ask NGA ([When NGA turns a game off](https://nga.io/docs/sdk/go-live/#when-nga-turns-a-game-off)). | | `DISABLED` | the app key is switched off, or this SDK version or build is retired. Loaded ads expire too. | | `ACTIVITY_NOT_RESUMED` | the screen you passed to `show` is not in front. Show from the screen in front; the ad stays ready. | | `ALREADY_SHOWING` | another NGA ad of the same kind is on screen. Wait for its `onClosed`, or close the banner first. | | `EXPIRED` | the ad was loaded more than 30 minutes ago. Load again. | | `INVALID_SHOW_TARGET` | the window is too small for the banner (`show.target.window_too_small`), or your banner yield's `hide` threw (`show.target.yield_failed`). The ad stays ready. | | `RENDER_FAILED` | the show ended in a failure inside the SDK (`render.crashed`, `render.input`, `render.exception`). Load again; if it repeats, send NGA the `DEBUG` log ([Asking NGA](#asking-nga)). | Every code and detail, with its cause and fix: [Errors](https://nga.io/docs/sdk/reference/errors/). Neither `onLoaded` nor `onFailed` called? Every load calls back exactly once per callback, so check that `loadAd` ran and that your callback object was not replaced. ## The banner does not appear, or appears in the wrong place - **No `onLoaded`.** See *No ad shows* above. Until NGA has first read your game's store listing, its native placements get no fill ([What the banner shows](https://nga.io/docs/sdk/native-cross-promo/#what-the-banner-shows)). - **`show` called, no banner, and `onShowFailed`.** The screen was not in front, another banner was up, or the window is too small. The ad stays ready; the causes, and when to show again, are in [Show lifecycle](https://nga.io/docs/sdk/native-cross-promo/#show-lifecycle). - **The banner covers your own banner ad.** Register the [banner yield](https://nga.io/docs/sdk/native-cross-promo/#your-own-banner-ad) once at start; without it, the first native show logs one `WARN`. With it registered, check that its `hide` reaches the view that is on screen (a banner ad created during a yield starts hidden in the examples). - **Your banner ad does not come back, or stops refreshing, after NGA's banner.** Your `restore` must show it again and resume its refresh whenever the banner is allowed now, not only when it was refreshing at `hide`; see the examples under [Your own banner ad](https://nga.io/docs/sdk/native-cross-promo/#your-own-banner-ad). - **The banner covers your own UI.** Show it only where nothing else is at the bottom of the screen, and call `close()` before you put anything there. The SDK has no position or offset for it. See [Where the banner may show](https://nga.io/docs/sdk/native-cross-promo/#where-the-banner-may-show). - **Unity: the banner stays across scenes.** This is expected. Call `Close()` when you leave the screen that showed it. - **Unity: the game covers the banner.** Turn off *Render Over Native UI*; the build check enforces it. - **`RENDER_FAILED / render.input`.** The banner could not draw what it received. The show ends; load another. - **The banner shows NGA's default colors, not your game's.** NGA could not read colors from your game's listing. Check the game's *Overview* in the portal, which shows what NGA read. ## The build fails - **Unity says `NGA SDK: this build cannot run the NGA SDK.`** Each line names a fix; see [Unity build checks](https://nga.io/docs/sdk/install/#unity-build-checks). - **Unity 2022.3: an Android build stops with `Unity 2022.3… builds this Android release build without minify`** (or `development build`). With 0.1.0-rc.2 or earlier, a release build fails later, at the dexing step, with `ERROR:D8: com.android.tools.r8.kotlin.H` (in `DexingWithClasspathTransform`) on `kotlin-stdlib` or the NGA libraries. Cause: *Minify* is off for that build type (Unity's default). Fix: turn on *Minify > Release*, and *Minify > Debug* for development builds, as in [Install](https://nga.io/docs/sdk/install/#add-the-sdk), step 3 for Unity. - **Unity 2022.3: the Android build fails at the dexing step** after you add MAX 13 or LevelPlay 9.6 or later. Fix: add R8 to `settingsTemplate.gradle`, as in [Install](https://nga.io/docs/sdk/install/#add-the-sdk), step 4 for Unity. - **Unity: the Package Manager cannot add the Git URL.** Cause: Git is not installed or not on the `PATH` Unity sees, or the URL or tag is mistyped. Both URLs end in `#v0.1.0`. - **Unity: `network.nga.sdk-render` fails to resolve `network.nga.sdk`.** Fix: add `network.nga.sdk` from its Git URL too, at the same tag; the render library needs it in your manifest. - **Android: `Could not find network.nga:nga-sdk`.** Cause: `mavenCentral()` is missing from your repositories, or the BOM line is missing: without `platform("network.nga:nga-bom:…")` the two libraries have no version. - **Android: a version conflict on `network.nga:nga-sdk`.** Cause: something pulls another version of the core library beside `nga-sdk-render`, which requires its own. Fix: name one version, through the BOM. - **Android: `NoClassDefFoundError` for a Kotlin, Install Referrer or App Set class at runtime.** Cause: a build rule excluded one of the SDK's dependencies. Fix: remove the exclusion. In Unity, run the External Dependency Manager's *Resolve*. - **Android: a version conflict on `kotlin-stdlib`.** Cause: your build forces a `kotlin-stdlib` older than 1.9. Fix: let Gradle resolve the newer one. - **iOS: Xcode resolves a version other than 0.1.0, or does not offer a release candidate.** Cause: the *Dependency Rule* is a range, which can pick a newer version and skips a release candidate (`-rc.N`, a pre-release). Fix: set the *Dependency Rule* to *Exact Version*. - **iOS: `No such module 'NGASDK'`.** Fix: add the product to the target that imports it. ## No reward - **`onRewardResult` with `granted` false.** The denial says why; see [Rewarded](https://nga.io/docs/sdk/backfill/#rewarded). Tell the player; give nothing. - **No `onRewardResult` at all.** The show ended before its impression counted (`onClosed` alone, or `onShowFailed`), so nothing was earned. Or the placement is an interstitial, which never gets one. - **The game was killed mid-ad.** `onAdClosedAfterRestart` is called at the next launch with the result; see [Rewarded](https://nga.io/docs/sdk/backfill/#rewarded). - **Unity on Android: the reward arrives after the ad closes.** Expected; see [Pause and resume](https://nga.io/docs/sdk/backfill/#pause-and-resume). ## Asking NGA First look at your test device's page in the portal (*Test devices*): its recent ad requests, the reason for each no-fill, and the ad errors it reported. Then write to [hi@nga.network](mailto:hi@nga.network) with your app key, the platform, the SDK version (`NGASDK.getSdkVersion()`), the `code` and `detail`, and the `DEBUG` log from launch to the problem.