Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved iOS pod update warrning

Discussion in 'Unity Mediation' started by skfldao, Mar 8, 2022.

  1. skfldao

    skfldao

    Joined:
    Jul 28, 2019
    Posts:
    18
    unity: 2019.4
    Xcode: 13
    mediation: unity, ironSource

    podfile
    Code (CSharp):
    1. source 'https://github.com/CocoaPods/Specs.git'
    2. platform :ios, '12.0'
    3.  
    4. target 'UnityFramework' do
    5.   pod 'Firebase/Analytics', '8.3.0'
    6.   pod 'Firebase/Core', '8.3.0'
    7.   pod 'Firebase/Crashlytics', '8.3.0'
    8.   pod 'Protobuf'
    9.   pod 'UnityMediationIronSourceAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
    10.   pod 'UnityMediationSdk', '~> 0.4.0', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
    11.   pod 'UnityMediationUnityAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
    12. end
    13. target 'Unity-iPhone' do
    14. end
    15. use_frameworks!

    Warning messages are displayed after pod update in iterm.



    UnityMediationUnityAdapter and UnityMediationIronSourceAdapter have different values for EXCLUDED_ARCHS. Even if one side is modified, it is restored again when the pod update in iterm.

    Xcode > build setting > exclude_arch value is i386, x86_64.

    Can I ignore warnings from pod update?
    Or is there any way to solve it?
     

    Attached Files:

    Last edited: Mar 8, 2022
  2. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hi @skfldao,

    These warnings will most likely not cause you any issues. The excluded archs for the adapters are meant to mirror the underlying adapter's excluded archs. The next release will be changing these values for the UnityAdapter, so you will most likely see these warnings go away in that release.

    One thing I wanted to mention though after looking at your Podfile, is that there is a chance you might face some inconsistencies in application behaviour at runtime.

    If you see these warnings in your logs:
    Class [GivenClass] is implemented in both [Target] and [Target]/Frameworks/UnityFramework.framework/UnityFramework. One of the two will be used. Which one is undefined.

    (This is repeated for each given class in the list of doubly linked classes)


    This is a serious issue, and although this only shows as a warning in Xcode, it results with an app that will have inconsistent and erroneous behavior.

    This generally occurs when the Podfile has these values included:


    target 'Unity-iPhone' do

    end


    use_frameworks!


    These lines are added by default with newer versions of Play Services Resolver (EDM4U, v136 onwards). To avoid this issue, the options are:

    • Option 1: Use the Play Services Resolver/EDM4U included with Unity Mediation. Delete the currently installed PSR/EDM4U, upon relaunching the project, the Mediation package will request to install PSR/EDM4U. This version of PSR/EDM4U will generate the Podfile in a format without the lines quoted above by default.

    • Option 2: Include a script to your Podfile. This step is required after each build, so adding it as a post build script is recommended.
    Code (CSharp):
    1. post_install do |installer|
    2.      applicationTargets = [
    3.          'Pods-Unity-iPhone',
    4.      ]
    5.  
    6.      libraryTargets = [
    7.          'Pods-UnityFramework',
    8.      ]
    9.  
    10.      embedded_targets = installer.aggregate_targets.select { |aggregate_target|
    11.          libraryTargets.include? aggregate_target.name
    12.      }
    13.  
    14.      embedded_pod_targets = embedded_targets.flat_map { |embedded_target| embedded_target.pod_targets }
    15.      host_targets = installer.aggregate_targets.select { |aggregate_target|
    16.          applicationTargets.include? aggregate_target.name
    17.      }
    18.  
    19.      # We only want to remove pods from Application targets, not libraries
    20.      host_targets.each do |host_target|
    21.          host_target.xcconfigs.each do |config_name, config_file|
    22.              host_target.pod_targets.each do |pod_target|
    23.                  if embedded_pod_targets.include? pod_target
    24.                      pod_target.specs.each do |spec|
    25.                          if spec.attributes_hash['ios'] != nil
    26.                              frameworkPaths = spec.attributes_hash['ios']['vendored_frameworks']
    27.                              else
    28.                              frameworkPaths = spec.attributes_hash['vendored_frameworks']
    29.                          end
    30.  
    31.                          if frameworkPaths != nil
    32.                              frameworkNames = Array(frameworkPaths).map(&:to_s).map do |filename|
    33.                                  extension = File.extname filename
    34.                                  File.basename filename, extension
    35.                              end
    36.                              frameworkNames.each do |name|
    37.                                  puts "Removing #{name} from OTHER_LDFLAGS of target #{host_target.name}"
    38.                                  config_file.frameworks.delete(name)
    39.                              end
    40.                          end
    41.                      end
    42.                  end
    43.              end
    44.  
    45.              xcconfig_path = host_target.xcconfig_path(config_name)
    46.              config_file.save_as(xcconfig_path)
    47.  
    48.          end
    49.      end
    50. end
    • Option 3: Unset the default settings of the currently installed EDM4U/PSR. This involves unchecking two checkboxes under Assets > PlayServicesResolver > iOS Resolver > Settings and there uncheck the checkboxes Add use_frameworks! to Podfile and Always add the main target to Podfile, as shown in the image below.




    After executing one of the above steps, rebuild the iOS project and the warnings mentioned above should not show anymore.
     
  3. skfldao

    skfldao

    Joined:
    Jul 28, 2019
    Posts:
    18
    Thank you for telling me!
    Option 3 is applied and below is the modified Podfile.
    Code (CSharp):
    1. source 'https://github.com/CocoaPods/Specs.git'
    2. platform :ios, '12.0'
    3.  
    4. target 'UnityFramework' do
    5.   pod 'Firebase/Analytics', '8.3.0'
    6.   pod 'Firebase/Core', '8.3.0'
    7.   pod 'Firebase/Crashlytics', '8.3.0'
    8.   pod 'Protobuf'
    9.   pod 'UnityMediationIronSourceAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
    10.   pod 'UnityMediationSdk', '~> 0.4.0', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
    11.   pod 'UnityMediationUnityAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
    12. end
    I tried iOS build today and I'm getting these errors:
    upload_2022-3-17_12-40-16.png

    Adding UnityMediationSdk and UnityMediationUnityAdapter and UnityMediationIronSourceAdapter in Build Phases>Link Binary With Libraries gives the same error.

    Where can I find UnityMediationS2SService, UnityMediationInstantiationService, UnityMediationTrackingService?
     
    Last edited: Mar 17, 2022
  4. skfldao

    skfldao

    Joined:
    Jul 28, 2019
    Posts:
    18
    Sorry, it was my mistake.
    I forgot add "pod 'Google-Mobile-Ads'"
    iOS build is Successful!
     
    Last edited: Mar 17, 2022
  5. osdima1

    osdima1

    Joined:
    Nov 4, 2019
    Posts:
    12
    Hi @DeclanMcPartlin

    I am having the same error and in addition it says:"No storyboard was provided" and my app crashes.

    Why the lines are added by default?

    target 'Unity-iPhone' do

    end

    use_frameworks!
     
  6. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hi @osdima1,

    Can you confirm which version of EDM4U you are using? I assume this is not the recommended version that is provided with Unity Mediation.

    The solution for you is most likely the same as above, in this post, which is also documented in the troubleshooting guide.

    Thank you for sharing your issue, let us know what worked for you, thanks.
     
  7. sportifies

    sportifies

    Joined:
    Jul 7, 2022
    Posts:
    1
    Does it also for the Android build up? Thanks in advance.
     
  8. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hello @sportifies, I'm not sure I follow, could you clarify your question further? This thread has been pretty iOS and Cocoapods specific.

    Thanks