invertase / invertase/react-native-google-mobile-ads
[🐛] Android: native ad clicks never fire on RN 0.85 + New Architecture — the SDK's own AdChoices is unresponsive too (iOS works on the same build)
- Dominant language
- TypeScript
- Stars
- 1k
- Forks
- 229
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 7
Description
## What happened?
On Android, **no click anywhere on a native ad does anything** — not the media, not the headline, not the call-to-action, and **not even the SDK's own AdChoices icon**. Ads load and render correctly and impressions are recorded. Only clicks are dead.
The same app build, same library version, same ad formats, serving real ads, works correctly on iOS.
I instrumented this on a physical device rather than guessing. Everything below was re-captured today against the current build.
### 1. The touch reaches the app
`adb logcat` while tapping the ad shows clean gestures arriving at the app's window — no scroll/drag ambiguity (`moveCount:0`):
```
MIUIInput: [MotionEvent] ViewRootImpl windowName 'com.prevly.app/com.prevly.app.MainActivity',
{ action=ACTION_DOWN, ... } moveCount:0
MIUIInput: [MotionEvent] ViewRootImpl windowName 'com.prevly.app/com.prevly.app.MainActivity',
{ action=ACTION_UP, ... } moveCount:0
```
21 such taps in one session across the media, the headline, the CTA and the AdChoices icon. Afterwards: nothing. No Activity start, no `ACTION_VIEW` intent, no browser or Play Store launch, no AdMob click log. The only `ActivityTaskManager START` in the whole capture is the app's own launch, ~84s before the first tap.
### 2. The view tree is correct and every asset is clickable
`adb shell uiautomator dump` while the ad is on screen:
```
FrameLayout clk=true [219,1218][531,1686] GADNativeAdView
FrameLayout clk=true [219,1218][414,1564] media
TextView clk=true "Google AI ve 400 GB depolama" HEADLINE
TextView clk=true "Kaydolun" CALL_TO_ACTION
RelativeLayout clk=true [482,1218][531,1267] AdChoices
```
Every registered asset is present, inside the ad view, and `clickable="true"`. Android does dispatch the touch into the SDK's own listeners — they simply never act on it.
### 3. The SDK considers the ad correctly displayed
With `setprop log.tag.Ads VERBOSE`, the SDK records impressions for these very ads:
```
D/Ads: Dispatching AFMA event: (...)('onSdkImpression',{});
```
So by the SDK's own judgement the ad is properly rendered and viewable — it just won't process a click on it.
### 4. The SDK's own AdChoices icon is dead too — which rules out my integration
This is the decisive part. AdChoices is drawn by the Mobile Ads SDK inside its own `GADNativeAdView`, with its click handler installed by the SDK. Per this library's own Android source it sits **outside** the `ReactViewGroup` holding the React children:
```kotlin
class ReactNativeGoogleMobileAdsNativeAdView(context: ReactContext) : FrameLayout(context) {
val viewGroup = ReactViewGroup(context) // React children live here
private val nativeAdView = NativeAdView(context)
init {
nativeAdView.addView(viewGroup)
addView(nativeAdView)
}
```
No layout, styling, gesture or asset-registration choice on my side can affect that icon. If it doesn't respond, **no click handler in that subtree is firing at all** — mine or the SDK's.
### 5. iOS, same build, works
| | Android | iOS |
|---|---|---|
| Build | current | current |
| Ads | real | real |
| Ads render | ✅ | ✅ |
| Impressions record | ✅ | ✅ |
| Assets `clickable=true` | ✅ | — |
| Touch reaches app window | ✅ | — |
| **Ad click works** | ❌ | ✅ |
| **SDK's own AdChoices works** | ❌ | ✅ |
## What I ruled out (so it needn't be re-tested)
Each of these was shipped to the real device and verified to change nothing:
1. **`overflow-hidden` ancestors around registered assets.** I had wrapping views applying rounded corners around `NativeAsset` / `NativeMediaView`. Removed them all (rounding moved onto the assets themselves). No change to clicks.
2. **A `GestureDetector` + `Gesture.Native()` wrapper** around `NativeAdView`, which I had added earlier for an unrelated touch-arbitration problem. Removed entirely for one round. No change to clicks. (Restored, since removing it helped nothing.)
3. **Asset layout.** One card variant genuinely did lay its headline/CTA outside the ad view, producing `Not all asset views lie inside the native ad view`. That is now fixed — the warning no longer appears at all, and the dump in §2 above is from that corrected build, with every asset present and clickable. Clicks were unchanged.
I could not isolate further with a synthetic tap: this device blocks `adb shell input tap` (`SecurityException: INJECT_EVENTS`).
## Possibly related
[#858](https://github.com/invertase/react-native-google-mobile-ads/issues/858) reported "CTA button is visible but not clickable" on Expo SDK 55/56, working on SDK 54. It was closed by an **iOS-only** patch released in 16.3.4; the Android side was never separately addressed. My environment matches that report's closely, and my iOS side now works — so this may be its unfixed Android half.
## Reproduction
Standard native ad integration: `NativeAd.createForAdRequest(...)` → `NativeAdView` with `NativeAsset` children for HEADLINE / CALL_TO_ACTION and a `NativeMediaView`. Ads load and display, impressions record, taps do nothing. No custom touch handling wraps the ad view.
Happy to run any diagnostic build or candidate patch on this device — I have `adb`/`uiautomator` access and can capture whatever would help.
## Platforms
Android. iOS works correctly with the same code.
### Environment
| | |
|---|---|
| `react-native-google-mobile-ads` | 16.5.0 (current latest) |
| React Native | 0.85.3 |
| React | 19.2.3 |
| Expo SDK | 56 (`expo` ~56.0.15) |
| New Architecture | enabled (Expo SDK 56 default; `newArchEnabled` not overridden) |
| `react-native-gesture-handler` | 2.31.1 |
| Google Mobile Ads Android SDK | `afma-sdk-a-v262180000` |
| Device | Xiaomi 2602BPC18G, Android 16 (API 36), HyperOS V816 |
| App | release build from the Play Store, targetSdk 36, minSdk 24 |
Contributor guide
Research direction
Start by locating the Android source for ReactNativeGoogleMobileAdsNativeAdView and tracing the NativeAdView hierarchy used by NativeAd.createForAdRequest. Reproduce the issue with the reported React Native, Expo, Android, and Google Mobile Ads versions, then verify that media, headline, CTA, and the SDK-owned AdChoices icon all dispatch clicks while impressions still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100