CS0115: `admob.AdmobListenerProxy.toString()' is marked as an override but no suitable method found

491 views
Skip to first unread message

Durgesh Kaushik

unread,
Jul 19, 2018, 3:22:07 AM7/19/18
to Google Mobile Ads SDK Developers
i m getting this error while trying to import admob plugin for unity

Assets/Plugins/AdmobAPI/AdmobListenerProxy.cs(18,26): error CS0115: `admob.AdmobListenerProxy.toString()' is marked as an override but no suitable method found to override

i have attached the file which is giving error
AdmobListenerProxy.cs

mobileadssdk-a...@google.com

unread,
Jul 19, 2018, 4:25:01 AM7/19/18
to Durgesh Kaushik, Google Mobile Ads SDK Developers
Hi Durgesh,

Looking at the error logs captured and the attached script file, it seems like you are using another Unity plugin instead of our official Google Mobile Ads Unity plugin. Please note that we can only assist you with code integration using our official Unity plugin because we have no visibility over the implementation of other plugins.

If possible, you might want to transition to using our official Unity plugin instead. You may refer to this guide and our sample app to help you get started. Then, we'll be here to assist you with any bumps you encounter while integrating with our official Unity plugin.

Regards,
Ivan Bautista
Mobile Ads SDK Team

Durgesh Kaushik

unread,
Jul 19, 2018, 11:18:03 AM7/19/18
to Google Mobile Ads SDK Developers
i apologizes for using the wrong unity plugin however when i was using the official one i m not able to build my apk after implementing ads 
here is a screenshot for that - 

 


i m getting this error -

1-  CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. 
C:\Program Files\Java\jdk1.8.0_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[

]
stdout[
Warning: [Temp\StagingArea\AndroidManifest-main.xml:12, J:\Unity Projects\Ball Breaker\Temp\StagingArea\android-libraries\android.arch.lifecycle.runtime-1.0.0\AndroidManifest.xml:3] Main manifest has <uses-sdk android:targetSdkVersion='25'> but library uses targetSdkVersion='26'
[Temp\StagingArea\AndroidManifest-main.xml, J:\Unity Projects\Ball Breaker\Temp\StagingArea\android-libraries\com.android.support.support-compat-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element.
[Temp\StagingArea\AndroidManifest-main.xml, J:\Unity Projects\Ball Breaker\Temp\StagingArea\android-libraries\com.android.support.support-core-ui-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element.
[Temp\StagingArea\AndroidManifest-main.xml, J:\Unity Projects\Ball Breaker\Temp\StagingArea\android-libraries\com.android.support.support-core-utils-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element.
[Temp\StagingArea\AndroidManifest-main.xml, J:\Unity Projects\Ball Breaker\Temp\StagingArea\android-libraries\com.android.support.support-fragment-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element.
[Temp\StagingArea\AndroidManifest-main.xml, J:\Unity Projects\Ball Breaker\Temp\StagingArea\android-libraries\com.android.support.support-media-compat-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element.
[Temp\StagingArea\AndroidManifest-main.xml, J:\Unity Projects\Ball Breaker\Temp\StagingArea\android-libraries\com.android.support.support-v4-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element.
]
exit code: 1
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.HostView:OnGUI()


2- Error building Player: 2 errors

and here is my android manifests code -





<?xml version="1.0" encoding="utf-8"?>
<!--
This Google Mobile Ads plugin library manifest will get merged with your
application's manifest, adding the necessary activity and permissions
required for displaying ads.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   
package="com.google.unity.ads"
   
android:versionName="1.0"
   
android:versionCode="1">
 
<uses-sdk android:minSdkVersion="14"
     
android:targetSdkVersion="19" />
   
<application>
     
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
   
android:label="@string/app_name">
   
<intent-filter>
     
<action android:name="android.intent.action.MAIN" />
     
<category android:name="android.intent.category.LAUNCHER" />
   
</intent-filter>
   
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
   
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik"
       
android:value="true" />
</activity>
 
</application>
</manifest>


and here is the code for the script  i m using to implement ads on it - 

using UnityEngine;
using System.Collections;
using GoogleMobileAds;
using GoogleMobileAds.Api;


public class LevelManager : MonoBehaviour {


 
public void LoadLevel(string name){
 
Debug.Log ("New Level load: " + name);
 
Brick.breakableCount = 0;
 
Application.LoadLevel (name);
 
}


 
public void QuitRequest(){
 
Debug.Log ("Quit requested");
 
Application.Quit ();
 
}
 
 
public void LoadNextLevel() {
 
Brick.breakableCount = 0;
 
Application.LoadLevel(Application.loadedLevel + 1);
 
}
 
 
public void BrickDestoyed() {
 
if (Brick.breakableCount <= 0) {
 
LoadNextLevel();
 
}
 
}
}


public class GoogleMobileAdsDemoScript : MonoBehaviour
{
 
private BannerView bannerView;
 
   
public void Start()
 
{
#if UNITY_ANDROID
 
string appId = "ca-app-pub-3940256099942544~3347511713";
#elif UNITY_IPHONE
           
string appId = "ca-app-pub-3940256099942544~1458002511";
#else
           
string appId = "unexpected_platform";
#endif


 
// Initialize the Google Mobile Ads SDK.
 
MobileAds.Initialize(appId);


 
this.RequestBanner();
 
}


 
private void RequestBanner()
 
{
#if UNITY_ANDROID
 
string adUnitId = "ca-app-pub-3940256099942544/6300978111";
#elif UNITY_IPHONE
           
string adUnitId = "ca-app-pub-3940256099942544/2934735716";
#else
           
string adUnitId = "unexpected_platform";
#endif


 
// Create a 320x50 banner at the top of the screen.


 
AdSize adSize = new AdSize(320, 100);
 bannerView
= new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);


 bannerView
.Destroy();


 
// Create an empty ad request.
 
AdRequest request = new AdRequest.Builder().Build();


 
// Load the banner with the request.
 bannerView
.LoadAd(request);
 
}


 
private void RequestInterstitial()
 
{
#if UNITY_ANDROID
 
string adUnitId = "ca-app-pub-3940256099942544/1033173712";
#elif UNITY_IPHONE
       
string adUnitId = "ca-app-pub-3940256099942544/4411468910";
#else
       
string adUnitId = "unexpected_platform";
#endif


 
// Initialize an InterstitialAd.
 
InterstitialAd interstitial = new InterstitialAd(adUnitId);


 
// Create an empty ad request.
 
AdRequest request = new AdRequest.Builder().Build();
 
// Load the interstitial with the request.
 interstitial
.LoadAd(request);
   
}
}

please solve this problem.

mobileadssdk-a...@google.com

unread,
Jul 20, 2018, 3:30:45 AM7/20/18
to Durgesh Kaushik, Google Mobile Ads SDK Developers
Hi Durgesh,

No worries. We are happy that you decided to shift into using the official Google Mobile Ads Unity plugin. That said, let's continue the discussion on this new thread you've created regarding your new issue.
Reply all
Reply to author
Forward
0 new messages