Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to disable/enable assemblies(for example Google AdMob) for specific platform

Discussion in 'Package Manager' started by DZZc0rd, May 12, 2023.

  1. DZZc0rd

    DZZc0rd

    Joined:
    Sep 4, 2021
    Posts:
    58
    Hello, I created a game for iOS and Android and I want to implement AdMob for Android only, but I don't want to create two project for iOS and Android
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    Select the assembly definition asset, and in inspector uncheck all platforms and select only the platform(s) you want to target. Add the dependent packages to the assembly definition as needed. Add any necessary scripts to the same folder or subfolders of the assembly definition.
     
    KyryloKuzyk likes this.
  3. DZZc0rd

    DZZc0rd

    Joined:
    Sep 4, 2021
    Posts:
    58
    I tried, but I looked into the Podfile and found this

    Code (CSharp):
    1. source 'https://github.com/CocoaPods/Specs'
    2. source 'https://cdn.cocoapods.org/'
    3.  
    4. platform :ios, '11.0'
    5.  
    6. target 'UnityFramework' do
    7.   pod 'Google-Mobile-Ads-SDK', '~> 10.4'
    8. end
    9. target 'Unity-iPhone' do
    10. end
    11. use_frameworks! :linkage => :static
    12.  
     
    Last edited: May 12, 2023