Failed Integration

163 views
Skip to first unread message

jvi...@gmail.com

unread,
May 7, 2019, 3:57:41 PM5/7/19
to Google Mobile Ads SDK Developers
Hello, I am integrating the following adapters: Unity Ads, AppLovin, ChartBoost and Vungle. After numerous problems with the last SDK, I took the previous one because it does not compile. After integrating all the adapters and getting no error, which is already difficult, only applovin works correctly and show me ads.

1) Applovin has a compilation problem, just like admob in its latest version when calling an ios library if you are on the Android platform. Please solve the problem.

2) The latest version of admob in an empty project gives manifest error.

3) How can I find out what is wrong, if nothing is wrong and everything is supposedly well configured? Both Unity Ads and ChartBoost and Vungle do not offer me ads, after several weeks of testing, however if you integrate unity ads without mediation they work right.

mobileadssdk...@google.com

unread,
May 8, 2019, 3:30:46 AM5/8/19
to jvi...@gmail.com, Google Mobile Ads SDK Developers
Hi,

Thank you for reaching out to us.

Please see my response on each of your concern.

1) Applovin has a compilation problem, just like admob in its latest version when calling an ios library if you are on the Android platform. Please solve the problem.

Could you please provide the runtime error that you are encountering?

2) The latest version of admob in an empty project gives manifest error.

Could you provide the manifest error that you encountered on your end?

3) How can I find out what is wrong, if nothing is wrong and everything is supposedly well configured? Both Unity Ads and ChartBoost and Vungle do not offer me ads, after several weeks of testing, however if you integrate unity ads without mediation they work right.

Could you please provide the following details so we could further check this concern?
    • Ad Unit IDs mediated to third-party ad network (Please share this via Reply private to author option as this is a sensitive information)
    • Error code when ads failed to load

 Also, if these concerns are reproducible on your end, could you please provide a test project so we could have a closer look?

Regards,
Teejay Pimentel
Mobile Ads SDK Team

Jordan Piera

unread,
May 8, 2019, 4:53:33 AM5/8/19
to Google Mobile Ads SDK Developers
I will be publishing each answer as I check them again. I will number each one.


FIRST ONE: I'm using unity 2018.2.14f1 and Google Mobile Ads Unity Plugin V3.16.I have only installed Google Mobile Ads Unity Plugin V3.16 in a empty proyect.
My proyect is configurated for Android Platform and you are using a IOS library.

First-Error.png

FirstSolution.png




After this error I installed the package GoogleMobileAdsAppLovinMediation-4.1.0. and got the same error in the file AppLovinPostProcessBuild.cs. I have fixed it as before.


Jordan Piera

unread,
May 8, 2019, 5:05:24 AM5/8/19
to google-adm...@googlegroups.com
SECOND ONE A:

After the last example, no code, no resources, nothing, I build the proyect only with Google Mobile Ads Unity Plugin V3.16.I and GoogleMobileAdsAppLovinMediation-4.1.0.

ManifestErrors.png


This is the error in Unity Console:


CommandInvokationFailure: Unable to merge android manifests. 

C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="D:/Jordan/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "I:\Unity2018\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -


stderr[


]

stdout[

[Temp\StagingArea\AndroidManifest-main.xml, I:\testmediacion2\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, I:\testmediacion2\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, I:\testmediacion2\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, I:\testmediacion2\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, I:\testmediacion2\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, I:\testmediacion2\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.

Warning: [Temp\StagingArea\AndroidManifest-main.xml:12, I:\testmediacion2\Temp\StagingArea\android-libraries\com.applovin.applovin-sdk-9.2.1\AndroidManifest.xml:3] Main manifest has <uses-sdk android:targetSdkVersion='27'> but library uses targetSdkVersion='28'

[Temp\StagingArea\AndroidManifest-main.xml, I:\testmediacion2\Temp\StagingArea\android-libraries\GoogleMobileAdsAppLovinMediation\AndroidManifest.xml:9] Skipping identical /manifest/application/activity[@name=com.applovin.adview.AppLovinInterstitialActivity] element.

[Temp\StagingArea\AndroidManifest-main.xml, I:\testmediacion2\Temp\StagingArea\android-libraries\GoogleMobileAdsAppLovinMediation\AndroidManifest.xml:11] Skipping identical /manifest/application/activity[@name=com.applovin.adview.AppLovinConfirmationActivity] element.

]

exit code: 1

UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)

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.RunCommand (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg, Int32 memoryMB)

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)



The latest available version of the api in my version of unity is Android 8.1 Oreo (api level 27). Then I decide to try a previous version of APPLOVIN Adapter.
Tip: Inform users of the compatibility of the APPLOVIN Adapter SDK with the unity versions.


SECOND ONE B:

I have downgrade APPLOVIN Adapter to  3.1.2. I build the solution and no errors appear. Perfect!, then I launch the unity apk in my device. I click on apk icon and the result is that App never start.Now I decide to downgrade Google Mobile Ads.


I start a new empty proyect. I download Admob V3.15 and I install applovin adapter 3.1.2. The applovin adapter fail with the compilation error and I fix it as last time. I build the solution, all is working. I press the app icon, and app start! Great!!! Now I can see my empty unity scene working.



Jordan Piera

unread,
May 8, 2019, 6:33:04 AM5/8/19
to google-adm...@googlegroups.com

3º) Now I create a scene with a simple button to load an advertisment. I attach the next code to the button that invoke the "ShowAd" method. I build the solution, then I start the app, I press the button and Applovin advertisment is shown.Perfect!

   Next Step: Remove App Lovin and test with unity ads.

#define USE_ADMOB
#define ADVERTISMENT
#define APP_LOVIN
//#define UNITY_ADS
//#define TEST_DEVICE
//#define VUNGLE_ACTIVE

using UnityEngine.Networking;
using UnityEngine;
using System;
using System.Collections;
#if ADVERTISMENT
#if APP_LOVIN
using GoogleMobileAds.Api.Mediation.AppLovin;
#endif

#if UNITY_ADS
using GoogleMobileAds.Api.Mediation.UnityAds;
#endif
using GoogleMobileAds.Api;
using UnityEngine.Advertisements;
#endif

public class UnityAdsTest : MonoBehaviour
{

#if ADVERTISMENT


        public static string androidGameId = "Insert your admob game id here";
        public static string androidRewarded = "Insert your admob rewarded placement code here";
        public static RewardBasedVideoAd rewardBasedVideo;


        protected string gameId;
#endif


    
    public static UnityAdsTest AdsInstance;
    /// <summary>
    /// 
    /// </summary>
    public void Awake()
    {
        AdsInstance = this;

    }

 
    /// <summary>
    /// 
    /// </summary>
    private void Start()
    {
        ADMOBInitAds();
    }

    /// <summary>
    /// 
    /// </summary>
    private void OnDestroy()
    {
        ADMOBDestroyAll();
    }

#if ADVERTISMENT

    /// <summary>
    /// 
    /// </summary>
    void ADMOBInitAds()
    {
#if UNITY_IOS // If build platform is set to iOS...
                                gameId = iosGameId;
#elif UNITY_ANDROID // Else if build platform is set to Android...
        gameId = androidGameId;
#endif

        MobileAds.SetiOSAppPauseOnBackground(true);
        MobileAds.Initialize(gameId);
#if APP_LOVIN
        AppLovin.Initialize();
       
#endif
      
        ADMOBPrepareRewarded();

    }

    /// <summary>
    /// 
    /// </summary>
    void ADMOBDestroyAll()
    {
        if (rewardBasedVideo != null)
        {
            rewardBasedVideo.OnAdLoaded -= ADMOBHandleRewardBasedVideoLoaded;
            // Called when an ad request failed to load.
            rewardBasedVideo.OnAdFailedToLoad -= ADMOBHandleRewardBasedVideoFailedToLoad;
            // Called when an ad is shown.
            rewardBasedVideo.OnAdOpening -= ADMOBHandleRewardBasedVideoOpened;
            // Called when the ad starts to play.
            rewardBasedVideo.OnAdStarted -= ADMOBHandleRewardBasedVideoStarted;
            // Called when the user should be rewarded for watching a video.
            rewardBasedVideo.OnAdRewarded -= ADMOBHandleRewardBasedVideoRewarded;
            // Called when the ad is closed.
            rewardBasedVideo.OnAdClosed -= ADMOBHandleRewardBasedVideoClosed;
            // Called when the ad click caused the user to leave the application.
            rewardBasedVideo.OnAdLeavingApplication -= ADMOBHandleRewardBasedVideoLeftApplication;


        }


    }

    /// <summary>
    /// 
    /// </summary>
    protected static void ADMOBPrepareRewarded()
    {
        rewardBasedVideo = RewardBasedVideoAd.Instance;
        rewardBasedVideo.OnAdLoaded += ADMOBHandleRewardBasedVideoLoaded;
        // Called when an ad request failed to load.
        rewardBasedVideo.OnAdFailedToLoad += ADMOBHandleRewardBasedVideoFailedToLoad;
        // Called when an ad is shown.
        rewardBasedVideo.OnAdOpening += ADMOBHandleRewardBasedVideoOpened;
        // Called when the ad starts to play.
        rewardBasedVideo.OnAdStarted += ADMOBHandleRewardBasedVideoStarted;
        // Called when the user should be rewarded for watching a video.
        rewardBasedVideo.OnAdRewarded += ADMOBHandleRewardBasedVideoRewarded;
        // Called when the ad is closed.
        rewardBasedVideo.OnAdClosed += ADMOBHandleRewardBasedVideoClosed;
        // Called when the ad click caused the user to leave the application.
        rewardBasedVideo.OnAdLeavingApplication += ADMOBHandleRewardBasedVideoLeftApplication;
    }

    /// <summary>
    /// 
    /// </summary>
    public void ShowAd()
    {
        StopAllCoroutines();
        ADMOBRequestRewardBasedVideo();
        StartCoroutine(WaitToShow());
    }

    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    IEnumerator WaitToShow()
    {
        while( rewardBasedVideo != null && !rewardBasedVideo.IsLoaded())
        {
            yield return null;
        }

        if( rewardBasedVideo != null && rewardBasedVideo.IsLoaded())
        {
            rewardBasedVideo.Show();
        }
    }
   
   

    /// <summary>
    /// 
    /// </summary>
    /// <param name="fail"></param>
    public static void ADMOBRequestRewardBasedVideo()
    {
#if UNITY_ANDROID
        string adUnitId = androidRewarded;
#elif UNITY_IPHONE
                    string adUnitId = iosRewarded;
#else
        string adUnitId = "unexpected_platform";
#endif

        // Create an empty ad request.



        AdRequest.Builder builder = null;
        // Create an empty ad request.

#if TEST_DEVICE
        builder = new AdRequest.Builder().AddTestDevice(@"Your device id");

#else
        builder = new AdRequest.Builder();
#endif
#if VUNGLE_ACTIVE
        VungleRewardedVideoMediationExtras extras = new VungleRewardedVideoMediationExtras();
#if UNITY_ANDROID
        extras.SetAllPlacements(new string[] { "ANDROID_PLACEMENT_1", "ANDROID_PLACEMENT_2" });
#elif UNITY_IPHONE
    extras.SetAllPlacements(new string[] { "IOS_PLACEMENT_1", "IOS_PLACEMENT_2" });
#endif

        builder = builder.AddMediationExtras(extras);
#endif


        Debug.Log("Loaded Rewarded");

        AdRequest request = builder.Build();
        //AdRequest request = new AdRequest.Builder().Build();
        // Load the rewarded video ad with the request.
        rewardBasedVideo.LoadAd(request, adUnitId);
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="args"></param>
    static public void ADMOBHandleRewardBasedVideoLoaded(object sender, EventArgs args)
    {
        Debug.Log("ADMOBHandleRewardBasedVideoLoaded");

    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="args"></param>
    static public void ADMOBHandleRewardBasedVideoFailedToLoad(object sender, AdFailedToLoadEventArgs args)
    {
        Debug.Log("HandleRewardBasedVideoOpened event fail to load + " + args.Message );
      
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="args"></param>
    static public void ADMOBHandleRewardBasedVideoOpened(object sender, EventArgs args)
    {
        Debug.Log("HandleRewardBasedVideoOpened event received");
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="args"></param>
    static public void ADMOBHandleRewardBasedVideoStarted(object sender, EventArgs args)
    {
        Debug.Log("HandleRewardBasedVideoStarted event received");
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="args"></param>
    static public void ADMOBHandleRewardBasedVideoClosed(object sender, EventArgs args)
    {
        Debug.Log("HandleRewardBasedVideoClosed event received");
  
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="args"></param>
    static public void ADMOBHandleRewardBasedVideoRewarded(object sender, Reward args)
    {

        Debug.Log("HandleRewardBasedVideoRewarded event");

    }



    static public void ADMOBHandleRewardBasedVideoLeftApplication(object sender, EventArgs args)
    {
 
        Debug.Log("HandleRewardBasedVideoLeftApplication event received");
    }


#endif
}


 

Steps:

 a ) I have removed the applovin code.
 b ) I install GoogleMobileAdsUnityAdsMediation-2.0.3.
 c ) I comment  the next line in my own code ; #define APP_LOVIN.

Results:

No Debug Logs on console.
No Ads on screen.



For some reason Debug.Log not work on callbacks. I have inserted a unity text and printed the error to the text. : "NO FILL".If I implement an example with unity ads without using admob Unity ads, always fill in my requests.

I await your answer, I have tried many times and I can not find the solution.

Thanks in advance.


mobileadssdk...@google.com

unread,
May 9, 2019, 2:27:13 AM5/9/19
to Jordan Piera, Google Mobile Ads SDK Developers
Hi Jordan,

Thank you for getting back to us and providing the details of your concern.

Please see my investigation findings below.

Issue#1 and Issue#2 - I created an empty project (unity 2018.2.14f1), imported Google Mobile Ads Unity Plugin V3.16 and I didn't encounter any issues and successfully build the apk. I also imported GoogleMobileAdsAppLovinMediation-4.1.0 and build the apk without any issues. With this, I wasn't able to reproduce the issue on my end. Could you share your test project where the issue is reproducible so we could have a closer look?

Issue#3 - Could you please provide with us the Ad Unit ID mediated to third-party ad network (using Reply private to author option) and the Error code when ads failed to load on your end.

Regards,
Teejay Pimentel
Mobile Ads SDK Team

Jordan Piera

unread,
May 9, 2019, 5:18:47 AM5/9/19
to google-adm...@googlegroups.com
Issue#1 and Issue#2:

That is not possible. I have tested in 2 versions of Unity (unity 2018.2.14f1, Unity 5.6.2f1 (64-bit) ). 
You can not call using UnityEditor.iOS.Xcode if you are not using the IOS platform in unity. Have you analyzed the code to see if it is the same as the one I sent you?
Maybe you have skipped a step? Is your project empty on the ANDROID platform? Have you downloaded the libraries of the public server and the links that facilitate the integration tutorials? Could you paste the code of your files to analyze because it does not give you errors: AppLovinPostProcessBuild.cs and PListProcessor.cs?Maybe you have a pro version of Unity( I am using the student version )?Are you sure that you have 2018.2.14f version of unity?


I'll give you the download links because the problem is not in my project. 

Issue#3:
NO FILL. 

What ID do you need exactly?? 
Rewarded AD ID Unity for ADMOB?

Thanks in advance.



Jordan Piera

unread,
May 10, 2019, 5:49:20 AM5/10/19
to Google Mobile Ads SDK Developers

After your last private message:

Hi,

Apologies for the back and forth.


With regard to issue#3, please note that the availability of the ad is not controlled by the Mobile Ads SDK.


Since you mentioned that your are having a problem displaying an ad from the Third-party network, I suggest to contact their respective support channel for further assistance.

Are you suggesting me to contact unity support? Using the Unity api I have no problems, Unity fills all my requests with their ads. The problem I have when integrating unity into your mediation system. Are you sure I have to contact Unity?

Thanks in advance

mobileadssdk...@google.com

unread,
May 10, 2019, 7:10:21 AM5/10/19
to Jordan Piera, Google Mobile Ads SDK Developers
Hi Jordan,

Please note that the Mobile Ads SDK requests an ad to the Third-party network and it doesn't control the availability of the ads. With this, you may contact the support channel of that Third-party network, or you may reach out to Product Support Team as they are more equipped in handling this kind of concern.

Regards,
Teejay Pimentel
Mobile Ads SDK Team 

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/1ee345e2-ce6c-437a-b7e1-7e3dbc11e2ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jordan Piera

unread,
May 10, 2019, 7:37:26 AM5/10/19
to Google Mobile Ads SDK Developers
So the Sdk does not have a system to detect if a Third-party network is available? Something like a "ping" to see if there is connection to UNITY ADS for example?

Could you give the email to contact with Product Support Team? I think that is not a Unity problem, perhaps a Admob setup problem or a SDK problem.

Thanks in advance.


Jordan Piera

unread,
May 13, 2019, 2:14:29 PM5/13/19
to google-adm...@googlegroups.com
Hello Teejay Pimentel,

Could you write me the email to contact with Product Support Team, please?

Thanks in advance.

mobileadssdk...@google.com

unread,
May 13, 2019, 10:24:53 PM5/13/19
to Jordan Piera, Google Mobile Ads SDK Developers
Hi Jordan,

You may reach out to AdMob Product Support Team through Google AdMob Help Community or via this troubleshooter.

Regards,
Teejay Pimentel
Mobile Ads SDK Team

On 05/14/19 02:14:29 jvi...@gmail.com wrote:
Hello Teejay Pimentel,

Could you give the email to contact with Product Support Team, please?

Thanks in advance.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages