Search Unity

Admob Implementation "Apple Mach-O Linker (Id) Error

Discussion in 'iOS and tvOS' started by nandonandito, Feb 2, 2018.

  1. nandonandito

    nandonandito

    Joined:
    Nov 24, 2016
    Posts:
    43
    hi, i got the problem after build my game and added Admob.. after i add admob on my game, and test to build the game become xcode project.. i import GoogleMobileAds.framework to framework at xcode and then after try to build it at devices i got error like this screenshot



    theres some body got the same problem like me? im using Unity 2017.3.0p4 and the latest admob sdk version
     

    Attached Files:

    Last edited: Feb 2, 2018
  2. nandonandito

    nandonandito

    Joined:
    Nov 24, 2016
    Posts:
    43
    i have try to build new project with the latest admob plugin but i still get this problem to build on devices.. somebody have the same problem?
     
  3. nandonandito

    nandonandito

    Joined:
    Nov 24, 2016
    Posts:
    43
    today, im trying to downgrade my project to unity 5.6.1p4 but i still get the same problem.. theres any step i forgot to follow?
     
  4. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
  5. wuym67123

    wuym67123

    Joined:
    Jan 3, 2017
    Posts:
    11
    download the last plugin https://github.com/unity-plugins/Unity-Admob
    and follow the document.

    Admob Unity Plugin
    Admob Unity Plugin provides a way to integrate admob ads in Unity3D Game and u3d app. You can use it for Unity iOS and Android App with the same c# or js code.

    Admob Unity3d Plugin Readme Contents
    1. Admob Unity Plugin Description
    2. Unity Admob Plugin Features
    3. Downloads Admob Unity Plugin
    4. Installation Admob Unity
    5. Unity Plugin Wiki and Documentation
    6. Quick Start
    7. Unity Admob Demo Usage
    8. Important Tips
    9. Screenshots
    10. License
    Admob Unity Plugin Description
    The Google Mobile Ads SDK is the latest generation in Google mobile advertising featuring refined ad formats and streamlined APIs for access to mobile ad networks and advertising solutions. The SDK enables Unity mobile app developers to maximize their monetization in native mobile apps.

    This repository contains the source code for the Google Mobile Ads Unity plugin. This plugin enables Unity developers to easily serve Google Mobile Ads on Android and iOS apps without having to write Java or Objective-C code. The plugin provides a C# interface for requesting ads that is used by C# scripts in your Unity project.

    Unity Admob Plugin Features
    Platforms supported in one plugin :

    • Android, via SDK v11.0.4 (part of Google Play service platform)
    • iOS, via SDK v7.28.0
    • Support all native events
    • AdRequest targeting methods,such as children target,test mode
    • Not need change Android package name
    • Very simple API
    Ad Types:

    • Banner(All Banner Type and Custom banner sizes)
    • Interstitial (text, picture, video)
    • Rewarded Video
    • Advanced Native Ad
    Downloads Admob Unity Plugin
    AdmobPluginRes/GoogleMobileAds.framework and admob_unity_plugin.unitypackage is reqired
    Download those files from Admob Unity3d Plugin Project Home https://github.com/unity-plugins/Unity-Admob
    or Download all the Unity admob plugin project https://github.com/unity-plugins/Unity-Admob/archive/master.zip

    Installation Admob Unity
    1. Open your project in the Unity editor.
    2. Navigate to Assets -> Import Package -> Custom Package.
    3. Select the AdmobUnityPlugin.unitypackage file.
    4. Import all of the files for the plugins by selecting Import. Make sure to check for any conflicts with files.
    Unity Plugin Wiki and Documentation
    Quick Start
    1.Init Admob Unity Plugin
    Create A C# script ,drag the script to a object on scene , add the follow code in the script file

    using admob;
    Admob.Instance().initAdmob("admob banner id", "admob interstitial id");//admob id with format ca-app-pub-279xxxxxxxx/xxxxxxxx
    //Admob.Instance().initAdmob("ca-app-pub-3940256099942544/2934735716", "ca-app-pub-3940256099942544/4411468910");


    2.Add Admob Banner in Unity App
    Here is the minimal code needed to show admob banner.

    Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 0);


    The AdPosition class specifies where to place the banner. AdSize specifies witch size banner to show

    3.Remove Banner
    By default, banners are visible. To temporarily hide a banner, call:

    Admob.Instance().removeBanner();

    4.How to integrate Interstitial into Unity 3d app?
    Here is the minimal code to create an interstitial.

    Admob.Instance().loadInterstitial();

    Unlike banners, interstitials need to be explicitly shown. At an appropriate stopping point in your app, check that the interstitail is ready before showing it:

    if (Admob.Instance().isInterstitialReady()) {
    Admob.Instance().showInterstitial();
    }

    5.Custom Admob Banner Ad Sizes
    In addition to constants on AdSize, you can also create a custom size:

    //Create a 250x250 banner.
    AdSize adSize = new AdSize(250, 250);
    Admob.Instance().showBannerAbsolute(adSize,0,30);

    6.Admob test Ads and children app
    If you want to test the ads or the your app with children target,you can set with admob unity plugin easy

    Admob.Instance().setTesting(true);
    Admob.Instance().setForChildren(true);
    string[] keywords = { "game","crash","male game"};
    Admob.Instance().setKeywords(keywords);

    7.Ad Events
    Both Banner and Interstitial contain the same ad events that you can register for. Here we'll demonstrate setting ad events on a interstitial,and show interstitial when load success:

    Admob.Instance().interstitialEventHandler += onInterstitialEvent;
    void onInterstitialEvent(string eventName, string msg)
    {
    Debug.Log("handler onAdmobEvent---" + eventName + " " + msg);
    if (eventName == AdmobEvent.onAdLoaded)
    {
    Admob.Instance().showInterstitial();
    }
    }

    You only need to register for the events you care about.

    8.How to integrate Admob Rewarded Video to Unity3d app?
    Here is the minimal code to create an admob video.

    Admob.Instance().loadRewardedVideo("ca-app-pub-3940256099942544/1712485313");

    Simular with interstitial,video need to be explicitly shown at an appropriate stopping point in your app, check that the video is ready before showing it:

    if (Admob.Instance().isRewardedVideoReady()) {
    Admob.Instance().showRewardedVideo();
    }

    9.Show Admob Native Advanced Ad in IOS and Android App
    Here is the minimal code needed to show admob banner. This is implemented with Admob Native Advanced as AdMob announced stop the express format ads ,so you must update this sdk if you are using old native banner. Just update sdk and replace the admob Express Ad ID with Advanced Ad ID

    Admob.Instance().showNativeBannerRelative(new AdSize(360,100), AdPosition.BOTTOM_CENTER, 0,"ca-app-pub-3940256099942544/2934735716");


    Unity Admob Demo Usage
    1. import AdmobUnityPlugin.unitypackage to your Unity project
    2. copy admobdemo.cs from AdmobPluginRes to your unity project/assets dic
    3. attach admobdemo.cs to the main camera
    4. edit admob id in admobdemo.cs
    5. build and run this in your device
    Important Tips
    1. Add GoogleMobileAds.framework. to Xcode Project
    2. Add the following framework to Xcode project
    AdSupport.framework,EventKit.framework,EventKitUI.framework,CoreTelephony.framework,StoreKit.framework,MessageUI.framework

    1. Attach admob to Object on scene,init admob before call admob fun