Skip to main content
edited tags
Link
deleted 25 characters in body
Source Link

I am trying to place ad in my game. i am using unity 5. trying to place admob in my game. in unity editor it displaying dummy message. tried to build the game in android phone after build completed game opened in the phone. in console it displays an error message.Error Message.

i am new to this concept. anybody please help

  1. Downloaded the plugin from admob website
  2. In SDK manager google repository, Google Play Service and Google Play Billing Library was installed
  3. AndroidMainfest.xml file is copied in the asset.

AndroidMainfest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.unity">
<!-- Google Mobile Ads Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Uncomment to add billing for in-app purchase ads -->
<uses-permission android:name="com.android.vending.BILLING" /> 
 <application
android:debuggable="false"
android:icon="@drawable/app_icon"
android:label="@string/app_name" >
   <activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="fullSensor" android:name="com.unity3d.player.UnityPlayerNativeActivity">
   <intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
   <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
 </activity>
<!-- AdMob Plugin -->
    <activity android:name="com.google.ads.AdActivity"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>

</manifest> 

In main Script i used

using GoogleMobileAds.Api;

public class GameScript : MonoBehaviour {
private BannerView bannerView;

Void Start(){
RequestBanner ();
}

private void RequestBanner()
{
    #if UNITY_ANDROID
    string adUnitId = "ca-app-pub-3940256099942544/6300978111";"unity test id";
    #elif UNITY_IPHONE
    string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
    #else
    string adUnitId = "unexpected_platform";
    #endif
    
    // Create a 320x50 banner at the top of the screen.
    bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
    // Create an empty ad request.
    AdRequest request = new AdRequest.Builder().Build();
    // Load the banner with the request.
    bannerView.LoadAd(request);
}

I am trying to place ad in my game. i am using unity 5. trying to place admob in my game. in unity editor it displaying dummy message. tried to build the game in android phone after build completed game opened in the phone. in console it displays an error message.Error Message.

i am new to this concept. anybody please help

  1. Downloaded the plugin from admob website
  2. In SDK manager google repository, Google Play Service and Google Play Billing Library was installed
  3. AndroidMainfest.xml file is copied in the asset.

AndroidMainfest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.unity">
<!-- Google Mobile Ads Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Uncomment to add billing for in-app purchase ads -->
<uses-permission android:name="com.android.vending.BILLING" /> 
 <application
android:debuggable="false"
android:icon="@drawable/app_icon"
android:label="@string/app_name" >
   <activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="fullSensor" android:name="com.unity3d.player.UnityPlayerNativeActivity">
   <intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
   <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
 </activity>
<!-- AdMob Plugin -->
    <activity android:name="com.google.ads.AdActivity"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>

</manifest> 

In main Script i used

using GoogleMobileAds.Api;

public class GameScript : MonoBehaviour {
private BannerView bannerView;

Void Start(){
RequestBanner ();
}

private void RequestBanner()
{
    #if UNITY_ANDROID
    string adUnitId = "ca-app-pub-3940256099942544/6300978111";
    #elif UNITY_IPHONE
    string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
    #else
    string adUnitId = "unexpected_platform";
    #endif
    
    // Create a 320x50 banner at the top of the screen.
    bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
    // Create an empty ad request.
    AdRequest request = new AdRequest.Builder().Build();
    // Load the banner with the request.
    bannerView.LoadAd(request);
}

I am trying to place ad in my game. i am using unity 5. trying to place admob in my game. in unity editor it displaying dummy message. tried to build the game in android phone after build completed game opened in the phone. in console it displays an error message.Error Message.

i am new to this concept. anybody please help

  1. Downloaded the plugin from admob website
  2. In SDK manager google repository, Google Play Service and Google Play Billing Library was installed
  3. AndroidMainfest.xml file is copied in the asset.

AndroidMainfest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.unity">
<!-- Google Mobile Ads Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Uncomment to add billing for in-app purchase ads -->
<uses-permission android:name="com.android.vending.BILLING" /> 
 <application
android:debuggable="false"
android:icon="@drawable/app_icon"
android:label="@string/app_name" >
   <activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="fullSensor" android:name="com.unity3d.player.UnityPlayerNativeActivity">
   <intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
   <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
 </activity>
<!-- AdMob Plugin -->
    <activity android:name="com.google.ads.AdActivity"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>

</manifest> 

In main Script i used

using GoogleMobileAds.Api;

public class GameScript : MonoBehaviour {
private BannerView bannerView;

Void Start(){
RequestBanner ();
}

private void RequestBanner()
{
    #if UNITY_ANDROID
    string adUnitId = "unity test id";
    #elif UNITY_IPHONE
    string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
    #else
    string adUnitId = "unexpected_platform";
    #endif
    
    // Create a 320x50 banner at the top of the screen.
    bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
    // Create an empty ad request.
    AdRequest request = new AdRequest.Builder().Build();
    // Load the banner with the request.
    bannerView.LoadAd(request);
}
added 50 characters in body
Source Link

ad is not working Problem in androidUnity ad

I am trying to place ad in my game. i am using unity 5. trying to place admob in my game. in unity editor it displaying dummy message. tried to build the game in android phone after build completed game opened in the phone. in console it displays an error message.Error Message.

i am new to this concept. anybody please help

  1. Downloaded the plugin from admob website
  2. In SDK manager google repository, Google Play Service and Google Play Billing Library was installed
  3. AndroidMainfest.xml file is copied in the asset.

AndroidMainfest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.unity">
<!-- Google Mobile Ads Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Uncomment to add billing for in-app purchase ads -->
<uses-permission android:name="com.android.vending.BILLING" /> 
 <application
android:debuggable="false"
android:icon="@drawable/app_icon"
android:label="@string/app_name" >
   <activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="fullSensor" android:name="com.unity3d.player.UnityPlayerNativeActivity">
   <intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
   <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
 </activity>
<!-- AdMob Plugin -->
    <activity android:name="com.google.ads.AdActivity"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>

</manifest> 

In main Script i used

using GoogleMobileAds.Api;

public class GameScript : MonoBehaviour {
private BannerView bannerView;

Void Start(){
RequestBanner ();
}

private void RequestBanner()
{
    #if UNITY_ANDROID
    string adUnitId = "ca-app-pub-3940256099942544/6300978111";
    #elif UNITY_IPHONE
    string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
    #else
    string adUnitId = "unexpected_platform";
    #endif
    
    // Create a 320x50 banner at the top of the screen.
    bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
    // Create an empty ad request.
    AdRequest request = new AdRequest.Builder().Build();
    // Load the banner with the request.
    bannerView.LoadAd(request);
}

ad is not working in android

I am trying to place ad in my game. i am using unity 5. trying to place admob in my game. in unity editor it displaying dummy message. tried to build the game in android phone after build completed game opened in the phone. in console it displays an error message.Error Message

  1. Downloaded the plugin from admob website
  2. In SDK manager google repository, Google Play Service and Google Play Billing Library was installed
  3. AndroidMainfest.xml file is copied in the asset.

AndroidMainfest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.unity">
<!-- Google Mobile Ads Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Uncomment to add billing for in-app purchase ads -->
<uses-permission android:name="com.android.vending.BILLING" /> 
 <application
android:debuggable="false"
android:icon="@drawable/app_icon"
android:label="@string/app_name" >
   <activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="fullSensor" android:name="com.unity3d.player.UnityPlayerNativeActivity">
   <intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
   <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
 </activity>
<!-- AdMob Plugin -->
    <activity android:name="com.google.ads.AdActivity"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>

</manifest> 

In main Script i used

using GoogleMobileAds.Api;

public class GameScript : MonoBehaviour {
private BannerView bannerView;

Void Start(){
RequestBanner ();
}

private void RequestBanner()
{
    #if UNITY_ANDROID
    string adUnitId = "ca-app-pub-3940256099942544/6300978111";
    #elif UNITY_IPHONE
    string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
    #else
    string adUnitId = "unexpected_platform";
    #endif
    
    // Create a 320x50 banner at the top of the screen.
    bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
    // Create an empty ad request.
    AdRequest request = new AdRequest.Builder().Build();
    // Load the banner with the request.
    bannerView.LoadAd(request);
}

Problem in Unity ad

I am trying to place ad in my game. i am using unity 5. trying to place admob in my game. in unity editor it displaying dummy message. tried to build the game in android phone after build completed game opened in the phone. in console it displays an error message.Error Message.

i am new to this concept. anybody please help

  1. Downloaded the plugin from admob website
  2. In SDK manager google repository, Google Play Service and Google Play Billing Library was installed
  3. AndroidMainfest.xml file is copied in the asset.

AndroidMainfest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.unity">
<!-- Google Mobile Ads Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Uncomment to add billing for in-app purchase ads -->
<uses-permission android:name="com.android.vending.BILLING" /> 
 <application
android:debuggable="false"
android:icon="@drawable/app_icon"
android:label="@string/app_name" >
   <activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="fullSensor" android:name="com.unity3d.player.UnityPlayerNativeActivity">
   <intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
   <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
 </activity>
<!-- AdMob Plugin -->
    <activity android:name="com.google.ads.AdActivity"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>

</manifest> 

In main Script i used

using GoogleMobileAds.Api;

public class GameScript : MonoBehaviour {
private BannerView bannerView;

Void Start(){
RequestBanner ();
}

private void RequestBanner()
{
    #if UNITY_ANDROID
    string adUnitId = "ca-app-pub-3940256099942544/6300978111";
    #elif UNITY_IPHONE
    string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
    #else
    string adUnitId = "unexpected_platform";
    #endif
    
    // Create a 320x50 banner at the top of the screen.
    bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
    // Create an empty ad request.
    AdRequest request = new AdRequest.Builder().Build();
    // Load the banner with the request.
    bannerView.LoadAd(request);
}
deleted 14 characters in body
Source Link
Loading
Source Link
Loading