codeX
codeX

Reputation: 5428

Android Ads are not clickable

I am trying to add my first advertisement to my android app. I followed a tutorial, and added the following code to my xml file

 <com.google.android.gms.ads.AdView
                android:id="@+id/adView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                ads:adSize="BANNER"
                ads:adUnitId="@string/banner_ad_unit_id"
                >
            </com.google.android.gms.ads.AdView>

It displays the ad in my emulator as well as in my real device . In my emulator, the ads like 'Install This App' are displaying and download symbol also visible. In my emulator , the ad is visible and refreshing clearly but click is not at all enabled. No response with a click.

I googled stack overflow questions but no apt answers were there. Any help will be appreciated.

ps: I didnt try clicking in my emulator due to the admob ban issues

Upvotes: 0

Views: 2436

Answers (4)

Hasan A Yousef
Hasan A Yousef

Reputation: 24988

In my case I was missing adding the ad-mob dependencies to the gradile, once done it worked fine.

Upvotes: 0

Ashish Gogna
Ashish Gogna

Reputation: 1

The way I solved such problem:

In Unity3D 4.XX in your current Assets folder open

Plugins > Android > AndroidManifest.xml

In the AndroidManifest.xml file under the

application > activity

you can find unityplayer.ForwardNativeEventsToDalvik property, which by default is false, like this:

<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />

so change it to true,

<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />

afterthat Save it and re-build.

Upvotes: 0

Thiago Elias
Thiago Elias

Reputation: 939

@arunprakashpj, Your AdView seems ok, but you need to check the parent layout to see if everything is ok.

You need to be sure this isn`t problem of the Ad itself. To prevent the admob ban issues you can set the emulator (or any device) as a Test Device, so you'll get Test banners that you may click without fear.

To see how to implement test banners, check this link (they have an example there): https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start#enjoy_a_freshly_loaded_ad

Please, let us know the click result when you're using the test banners. (If click works in test ads, it means that the problem probably will be the Ad itself and not your code).

Upvotes: 1

Kanishka
Kanishka

Reputation: 361

  1. Check Your Layout Arrangements. May be Some other Layouts overlaps the ad container.So when you click it clicks the overlapped layout components.
  2. Make sure the ad is active/ enabled in your admob account. As I remember it shows colour green when active.
  3. Try creating another ad unit and add the ad again.

Upvotes: 2

Related Questions