googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.21k stars 336 forks source link

[FR] Add a new option on iOS Resolver Settings to include a "use_modular_headers!" flag on the Podfile #664

Open nanddo opened 5 months ago

nanddo commented 5 months ago

Feature proposal

Add an option on iOS Resolver Settings to enable use_modular_headers! flag on the Podfile.

Component & SDKs info

Issue faced

After adding AppLovin SDK to my Unity project that already had Firebase SDK, I got the following error when trying to build for iOS:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `FirebaseCoreInternal` depends upon `GoogleUtilities`, which does not define modules.
To opt into those targets generating module maps (which is necessary to import them from Swift
when building as static libraries), you may set `use_modular_headers!` globally in your Podfile,
or specify `:modular_headers => true` for particular dependencies.

The Swift pod `FirebaseSessions` depends upon `FirebaseCore`, `FirebaseCoreExtension`, `FirebaseInstallations`,
`GoogleDataTransport`, `GoogleUtilities`, and `nanopb`, which do not define modules.

When I manually added the use_modular_headers! globally in my Podfile and archived directly on XCode, the process worked correctly. However, the Podfile will be overwritten once I do a new CI build.

Important: the error above only happens on branches with AppLovin SDK. If I use a branch without it, there's no need for such a flag.

Here's how my Podfile looks like (note that the flag was added manually).

source 'https://cdn.cocoapods.org/'

platform :ios, '13.0'

use_modular_headers! # NOTE: this was added manually to make the XCode build work!

target 'UnityFramework' do
  pod 'AppLovinMediationFacebookAdapter', '6.14.0.1'
  pod 'AppLovinMediationGoogleAdapter', '10.14.0.1'
  pod 'AppLovinMediationUnityAdsAdapter', '4.9.2.1'
  pod 'AppLovinMediationVungleAdapter', '7.2.0.0'
  pod 'AppLovinSDK', '12.1.0'
  pod 'AppsFlyer-AdRevenue', '6.9.1'
  pod 'AppsFlyerFramework', '6.12.1'
  pod 'FBSDKCoreKit', '~> 16.0'
  pod 'FBSDKCoreKit_Basics', '~> 16.0'
  pod 'FBSDKGamingServicesKit', '~> 16.0'
  pod 'FBSDKLoginKit', '~> 16.0'
  pod 'FBSDKShareKit', '~> 16.0'
  pod 'Firebase/Analytics', '10.12.0'
  pod 'Firebase/Core', '10.12.0'
  pod 'Firebase/Crashlytics', '10.12.0'
  pod 'Firebase/Messaging', '10.12.0'
  pod 'Firebase/RemoteConfig', '10.12.0'
  pod 'GoogleUserMessagingPlatform', '2.1.0'
end
target 'Unity-iPhone' do
end

Additional information

There's an open pull request with such addition available here: https://github.com/googlesamples/unity-jar-resolver/pull/632