Skip to content

[Bug] iOS Build failure: Umbrella header 'FirebaseCoreInternal-umbrella.h' not found #952

@NawarRajab

Description

@NawarRajab

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2021.3.25f
  • Firebase Unity SDK version: 11.7
  • Source you installed the SDK: unitypackage (.unitypackage or Unity Package Manager)
  • Problematic Firebase Component: FirebaseCoreInternal(Auth, Database, etc.)
  • Other Firebase Components in use: Analytics (Auth, Database, etc.)
  • Additional SDKs you are using: AppsFlyer,Braze (Facebook, AdMob, etc.)
  • Platform you are using the Unity editor on: Win/Mac(Mac, Windows, or Linux)
  • Platform you are targeting: Mobile(iOS, Android, and/or desktop)
  • Scripting Runtime: IL2CPP(Mono, and/or IL2CPP)
  • Pre-built SDK from the website or open-source from this repo: Website

[REQUIRED] Please describe the issue here:

Firebase adds couple of pods to podfile. Here is our podfile:

use_frameworks! :linkage => :static

target 'Unity-iPhone' do
platform :ios, '12.0'
  pod 'InternalLibUnity', '0.0.1'
  pod 'InternalLibObjC', '0.0.1'
  pod 'InternalLibObjC2', '0.0.1'
  pod 'AppsFlyerFramework', '6.12.2'
end

target 'UnityFramework' do
platform :ios, '12.0'
	pod 'Firebase/Analytics', '10.20.0'
	pod 'Firebase/Core', '10.20.0'	
end

target 'NotificationService' do
platform :ios, '12.0'
  pod 'BrazeNotificationService', '~> 6.0.0'
end

post_install do |lib|
	lib.pods_project.targets.each do |target|
		if target.name.include? "UnityFramework"
			next
		end
		target.build_configurations.each do |config|
			config.build_settings['ARCHS'] = '$(ARCHS_STANDARD_64_BIT)'
			config.build_settings['BUILD_DIR'] = '../build/$(CONFIGURATION)'
			config.build_settings['PROJECT_TEMP_DIR'] = '$(BUILD_DIR)'
			config.build_settings['PODS_CONFIGURATION_BUILD_DIR'] = '$(BUILD_DIR)'
			config.build_settings['CONFIGURATION_BUILD_DIR'] = '$(BUILD_DIR)'
			config.build_settings['CONFIGURATION_TEMP_DIR'] = '$(BUILD_DIR)'
			config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
			config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
			config.build_settings['ENABLE_BITCODE'] = 'NO'
		end
	end
end

Firebase recommends using static linking for pods by adding use_frameworks! :linkage => :static. When we do so, we get the following build (xcode) errors:
Umbrella header 'FirebaseCoreInternal-umbrella.h' not found
and
'google/protobuf/Any.pbobjc.h' file not found

Removing use_frameworks! :linkage => :static results in an error in pod install:

[!] 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.

a workaround would be to add pod 'GoogleUtilities', :modular_headers => true. However, this results in the following build error:
'FirebaseCoreInternal.modulemap' not found

I did a comparison between our xcode project with and without Firebase integration and nothing jumped out as different. I also did that with a fresh Unity project + Fire SDK.. same result.
Firebase SDK for Unity has an iOSResolver component that does some operations on Unity post build. I replicated that for our build system. One thing that I don't know the purpose of is that Firebase adds a dummy swift file to UnityFramework target. I just replicated it.

Steps to reproduce:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? Yes
What's the issue repro rate? (eg 100%, 1/5 etc) 100%

What happened? How can we make the problem occur? It's hard to reproduce. It's related to Firebase requirements and our project configuration. I can't give build logs at this point. I'll try to, if needed.

Relevant Code:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions