Search Unity

How to use Admob InterstitialAd in Unity3d?

Discussion in 'Android' started by gclsoft, Aug 23, 2014.

  1. gclsoft

    gclsoft

    Joined:
    Sep 20, 2013
    Posts:
    5
    Prime31 plugin is not for free, I'm too poor to buy it.

    https://github.com/guillermocalvo/admob-unity-plugin plugin is good for admob banner, but doesn't support InterstitialAd.

    https://github.com/googleads/googleads-mobile-plugins is google's official plugin, but crashes on Android:



    Code (CSharp):
    1.   void initAd()
    2.         {
    3.             // Initialize an InterstitialAd.
    4.             interstitial = new InterstitialAd("ca-app-pub-0243484158988577/4626472594");
    5.             // Create an empty ad request.
    6.             AdRequest request = new AdRequest.Builder().Build();
    7.             // Load the interstitial with the request.
    8.             interstitial.LoadAd(request);
    9.         }
    10.  
    11.  
    12.     ? 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2187) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2236) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.ActivityThread.access$800(ActivityThread.java:138) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.os.Handler.dispatchMessage(Handler.java:102) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.os.Looper.loop(Looper.java:136) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.ActivityThread.main(ActivityThread.java:5034) 08-23 17:22:52.264: E/AndroidRuntime(17984): at java.lang.reflect.Method.invokeNative(Native Method) 08-23 17:22:52.264: E/AndroidRuntime(17984): at java.lang.reflect.Method.invoke(Method.java:515) 08-23 17:22:52.264: E/AndroidRuntime(17984): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:805) 08-23 17:22:52.264: E/AndroidRuntime(17984): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:621) 08-23 17:22:52.264: E/AndroidRuntime(17984): at dalvik.system.NativeStart.main(Native Method) 08-23 17:22:52.264: E/AndroidRuntime(17984): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.admobtest/com.unity3d.player.UnityPlayerNativeActivity}; have you declared this activity in your AndroidManifest.xml? 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1628) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.Activity.startActivityForResult(Activity.java:3435) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.Activity.startActivityForResult(Activity.java:3396) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.Activity.startActivity(Activity.java:3638) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.Activity.startActivity(Activity.java:3606) 08-23 17:22:52.264: E/AndroidRuntime(17984): at com.unity3d.player.UnityPlayerProxyActivity.onCreate(Unknown Source) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.Activity.performCreate(Activity.java:5242) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 08-23 17:22:52.264: E/AndroidRuntime(17984): at com.lbe.security.service.core.client.b.x.callActivityOnCreate(Unknown Source) 08-23 17:22:52.264: E/AndroidRuntime(17984): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2151) 08-23 17:22:52.264: E/AndroidRuntime(17984): ... 11 more
    How can I use Admob InterstitialAd in Unity3d?
     
  2. johnyfoxter

    johnyfoxter

    Joined:
    Nov 3, 2013
    Posts:
    21