iOS pod update warrning

unity: 2019.4
Xcode: 13
mediation: unity, ironSource

podfile

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '12.0'

target 'UnityFramework' do
  pod 'Firebase/Analytics', '8.3.0'
  pod 'Firebase/Core', '8.3.0'
  pod 'Firebase/Crashlytics', '8.3.0'
  pod 'Protobuf'
  pod 'UnityMediationIronSourceAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
  pod 'UnityMediationSdk', '~> 0.4.0', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
  pod 'UnityMediationUnityAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
end
target 'Unity-iPhone' do
end
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?


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.

post_install do |installer|
     applicationTargets = [
         'Pods-Unity-iPhone',
     ]

     libraryTargets = [
         'Pods-UnityFramework',
     ]

     embedded_targets = installer.aggregate_targets.select { |aggregate_target|
         libraryTargets.include? aggregate_target.name
     }

     embedded_pod_targets = embedded_targets.flat_map { |embedded_target| embedded_target.pod_targets }
     host_targets = installer.aggregate_targets.select { |aggregate_target|
         applicationTargets.include? aggregate_target.name
     }

     # We only want to remove pods from Application targets, not libraries
     host_targets.each do |host_target|
         host_target.xcconfigs.each do |config_name, config_file|
             host_target.pod_targets.each do |pod_target|
                 if embedded_pod_targets.include? pod_target
                     pod_target.specs.each do |spec|
                         if spec.attributes_hash['ios'] != nil
                             frameworkPaths = spec.attributes_hash['ios']['vendored_frameworks']
                             else
                             frameworkPaths = spec.attributes_hash['vendored_frameworks']
                         end

                         if frameworkPaths != nil
                             frameworkNames = Array(frameworkPaths).map(&:to_s).map do |filename|
                                 extension = File.extname filename
                                 File.basename filename, extension
                             end
                             frameworkNames.each do |name|
                                 puts "Removing #{name} from OTHER_LDFLAGS of target #{host_target.name}"
                                 config_file.frameworks.delete(name)
                             end
                         end
                     end
                 end
             end

             xcconfig_path = host_target.xcconfig_path(config_name)
             config_file.save_as(xcconfig_path)

         end
     end
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 Likes

Thank you for telling me!
Option 3 is applied and below is the modified Podfile.

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '12.0'

target 'UnityFramework' do
  pod 'Firebase/Analytics', '8.3.0'
  pod 'Firebase/Core', '8.3.0'
  pod 'Firebase/Crashlytics', '8.3.0'
  pod 'Protobuf'
  pod 'UnityMediationIronSourceAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
  pod 'UnityMediationSdk', '~> 0.4.0', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
  pod 'UnityMediationUnityAdapter', :source => 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'
end

I tried iOS build today and I’m getting these errors:

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

Where can I find UnityMediationS2SService, UnityMediationInstantiationService, UnityMediationTrackingService?

Sorry, it was my mistake.
I forgot add “pod ‘Google-Mobile-Ads’”
iOS build is Successful!

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!

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.

Does it also for the Android build up? Thanks in advance.

Hello @sportifies , I’m not sure I follow, could you clarify your question further? This thread has been pretty iOS and Cocoapods specific.

Thanks