Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not build the precompiled application for the device. Error (Xcode): redefinition of module 'Firebase' #11010

Closed
Emaren opened this issue May 20, 2023 · 4 comments
Labels
resolution: solution-provided A solution has been provided in the issue.

Comments

@Emaren
Copy link

Emaren commented May 20, 2023

Description

Brand new flutter app, android runs ok, but ios does not build.

Reproducing the issue

No response

Firebase SDK Version

11.29.1

Xcode Version

14.3

Installation Method

CocoaPods

Firebase Product(s)

All

Targeted Platforms

iOS

Relevant Log Output

Launching lib/main.dart on Tony’s iPhone (3) in debug mode...
main.dart:1
Automatically signing iOS for device deployment using specified development team in Xcode project: 6XBF34DN79
Xcode build done.                                           48.1s
Failed to build iOS app
Could not build the precompiled application for the device.
Error (Xcode): redefinition of module 'Firebase'
/Users/tonyblum/VSProjects/illuminate_energy/ios/Pods/Firebase/CoreOnly/Sources/module.modulemap:0:7

Error (Xcode): could not build module 'ObjectiveC'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/os/object.h:113:8

Error (Xcode): could not build module 'os_object'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/dispatch/dispatch.h:62:9

Error (Xcode): could not build module 'os_object'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/os/workgroup_base.h:18:9

Error (Xcode): could not build module 'Dispatch'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:19:9

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:5:9

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:27:9

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:17:9

Error (Xcode): could not build module 'Foundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:7:8

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:11:9

Error (Xcode): could not build module 'CoreGraphics'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImageDefines.h:16:9

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h:29:9

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h:35:9

Error (Xcode): could not build module 'Foundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h:7:9

Error (Xcode): could not build module 'Foundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h:7:8

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h:15:9

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h:13:9

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h:15:9

Error (Xcode): could not build module 'Foundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h:7:8

Error (Xcode): could not build module 'Foundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/NSString UserNotifications.h:7:8

Error (Xcode): could not build module 'UIKit'
/Users/tonyblum/VSProjects/illuminate_energy/build/ios/Debug-iphoneos/Flutter.framework/Headers/FlutterAppDelegate.h:7:8

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBase.h:166:9

Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h:17:9

Error (Xcode): could not build module 'CoreAudioTypes'
/Applications/Xcode-14.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:3:9

Error (Xcode): could not build module 'Flutter'
/Users/tonyblum/VSProjects/illuminate_energy/ios/Runner/GeneratedPluginRegistrant.h:9:8

Error (Xcode): failed to emit precompiled header '/Users/tonyblum/Library/Developer/Xcode/DerivedData/Runner-erusibwxyejjdcfxgurkqzzmvvka/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_3CRHYMD5SY6KU-clang_125E95KHMCSJ2.pch' for bridging header '/Users/tonyblum/VSProjects/illuminate_energy/ios/Runner/Runner-Bridging-Header.h'


Error launching application on Tony’s iPhone (3).
Exited

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
PODS:
  - Firebase/CoreOnly (10.9.0):
    - FirebaseCore (= 10.9.0)
  - firebase_core (2.13.0):
    - Firebase/CoreOnly (= 10.9.0)
    - Flutter
  - FirebaseCore (10.9.0):
    - FirebaseCoreInternal (~> 10.0)
    - GoogleUtilities/Environment (~> 7.8)
    - GoogleUtilities/Logger (~> 7.8)
  - FirebaseCoreInternal (10.9.0):
    - "GoogleUtilities/NSData zlib (~> 7.8)"
  - Flutter (1.0.0)
  - GoogleUtilities/Environment (7.11.1):
    - PromisesObjC (< 3.0, >= 1.2)
  - GoogleUtilities/Logger (7.11.1):
    - GoogleUtilities/Environment
  - "GoogleUtilities/NSData zlib (7.11.1)"
  - PromisesObjC (2.2.0)

DEPENDENCIES:
  - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
  - Flutter (from `Flutter`)

SPEC REPOS:
  trunk:
    - Firebase
    - FirebaseCore
    - FirebaseCoreInternal
    - GoogleUtilities
    - PromisesObjC

EXTERNAL SOURCES:
  firebase_core:
    :path: ".symlinks/plugins/firebase_core/ios"
  Flutter:
    :path: Flutter

SPEC CHECKSUMS:
  Firebase: bd152f0f3d278c4060c5c71359db08ebcfd5a3e2
  firebase_core: fc68c0f9eec4e800b9418deff14a7e0a504016f3
  FirebaseCore: b68d3616526ec02e4d155166bbafb8eca64af557
  FirebaseCoreInternal: d2b4acb827908e72eca47a9fd896767c3053921e
  Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
  GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749
  PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef

PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d

COCOAPODS: 1.12.1

@paulb777 paulb777 transferred this issue from firebase/firebase-ios-sdk May 20, 2023
@darshankawar darshankawar added the triage Issue is currently being triaged. label May 22, 2023
@darshankawar
Copy link

@Emaren
Can you run in verbose mode and provide the entire log in a file and share it here ?

flutter run -v.

@darshankawar darshankawar added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label May 22, 2023
@Emaren
Copy link
Author

Emaren commented May 22, 2023

output.txt

@darshankawar
Copy link

Thanks for the log, but I don't see the same error log in it.

Can you try following and see if it helps ?

Quit Xcode.
Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData
Delete ProjectName.xcworkspace
Delete Podfile.lock file and Pods folder
Run pod install.
Open the newly created ProjectName.xcworkspace file and build.

@Emaren
Copy link
Author

Emaren commented May 25, 2023

I eventually had to delete the ios folder and 'flutter create .' and it worked. Thank you again for your time. 🙏

@Emaren Emaren closed this as completed May 25, 2023
@darshankawar darshankawar added resolution: solution-provided A solution has been provided in the issue. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. triage Issue is currently being triaged. labels May 26, 2023
@firebase firebase locked and limited conversation to collaborators Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: solution-provided A solution has been provided in the issue.
Projects
None yet
Development

No branches or pull requests

2 participants