googlesamples / googlesamples/unity-jar-resolver

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

Open
#664 0 comments 3 reactions 0 assignees View on GitHub
type: feature request
Dominant language
C#
Stars
1.5k
Forks
371
Avg merge
14h 21m
Merged PRs (30d)
3

Description

### Feature proposal

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

### Component & SDKs info

* EDM4U Component: iOS Resolver.
* Unity editor version: 2022.3.1f1.
* External Dependency Manager version: 1.2.176.
* Plugins SDK in use: Firebase, AppLovin SDK + Adapters (Admob, Facebook, Vungle, etc.).
* Platform you are using the Unity editor on: Mac.

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.