Closed mrcsilva closed 11 months ago
Updated comment with project where the build process fails
Having the same issue with the latest versions
Yes had exactly the same issue, had to revert to previous version and lock it in pubspec
Yes had exactly the same issue, had to revert to previous version and lock it in pubspec
@kbudulski Can you paste here the version you're using? I tried that but got the same error
Sure, here are the versions: firebase_core: 2.7.1 firebase_crashlytics: 3.0.16 firebase_analytics: 10.1.5 firebase_messaging: 14.2.6
Remember not to use ^ symbol. When you run pod install, it should download 10.3.0 versions of dependencies :)
@mrcsilva and everyone facing this issue.
Since the error is Swift Compiler Error (Xcode): Include of non-modular header inside framework module
from the log you shared, does setting the same in Xcode -> Target -> Build Settings -> Allow Non-modular Includes in Framework Modules to Yes
help to resolve ?
@darshankawar Just retested and I face the same error when changing that to Yes
@mrcsilva Upon running the repo, I am getting below error:
Error (Xcode): Undefined symbol: _MDFInsetsFlippedHorizontally
Error (Xcode): Undefined symbol: _MDFRectFlippedHorizontally
Could not build the application for the simulator.
Error launching application on iPhone 13.
dhs@Dhss-MacBook-Pro crashlytics_error %
From the pubspec.yaml
, I see that you have other community packages, so in order to narrow down the original issue you reported, please try to have only flutterfire plugins, make sure they are on latest versions and then try to run the app again to see if you still get same error or not while building.
@darshankawar Updated the repo to only have flutterfire dependencies (they were already in the latest version). I still get the same error
@mrcsilva
So the error seems to be pointing to FirebaseSessions
pods. This file in particular FIRSESnanoPBHelpers.h
which seems to be coming from nanopb https://github.com/nanopb.
Also, this doesn't seem specific to firebase_crashlytics
I guess, because I commented the plugin in pubspec.yaml and ran the app again which gave me same error.
Maybe it is related to FirebaseSessions pod with firebase_crashlytics, so maybe check if this is useful.
@mrcsilva Right, it's not a problem with firebase_crashlytics
. However, that package along side with firebase_performance
include the respective Firebase<library>
pod.
Those pods have the FirebaseSessions pod as a dependency (check under ios/Podfile.lock
), that's why removing only the Crashlytics doesn't remove the error.
Since all the dependencies are automatically managed by Flutter and CocoaPods I don't see a way of using the link you provided to solve the error.
For now I'm using the firebase_core
package with a fixed version (2.7.1) in order to not fetch the SDK 10.6.0 that is causing the error.
Thanks for the feedback. I was able to replicate the reported error upon trying to compile the app.
Same here
I used the dependencies that you have in your project, @mrcsilva, but I used the latest versions:
dependencies:
firebase_analytics: ^10.2.0
firebase_core: ^2.9.0
firebase_crashlytics: ^3.1.0
firebase_performance: ^0.9.1
firebase_remote_config: ^4.0.0
flutter:
sdk: flutter
I was able to build successfully via flutter CLI and Xcode. Do you still experience the issue with the latest versions?
@russellwheatley I'm still getting the same error with the exact versions you mentioned.
I performed this before rebuilding to be sure no other versions were being used:
rm -rf Pods [15:41:26]
rm -rf Podfile.lock
rm -rf ../pubspec.lock
rm -rf ~/.pub-cache/hosted/pub.dartlang.org/
rm -rf ~/Library/Developer/Xcode/DerivedData
pod cache clean --all
pod deintegrate
flutter pub cache repair
flutter clean
flutter pub get
pod setup
pod install
pod repo update
Also having the same issue, using all of the absolute latest package versions:
Package Versions:
cloud_firestore: ^4.5.1
cloud_functions: ^4.1.0
firebase_analytics: ^10.2.0
firebase_auth: ^4.4.1
firebase_core: ^2.9.0
firebase_crashlytics: ^3.1.0
firebase_database: ^10.1.0
firebase_dynamic_links: ^5.1.0
firebase_messaging: ^14.4.0
firebase_storage: ^11.1.0
Swift Compiler Error:
Swift Compiler Error (Xcode): Include of non-modular header inside framework module
'FirebaseSessions.FIRSESNanoPBHelpers': './nanopb/pb.h'
.../app/flutter/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPB
Helpers.h:28:8
Swift Compiler Error (Xcode): Include of non-modular header inside framework module
'FirebaseSessions.FIRSESNanoPBHelpers': './nanopb/pb_decode.h'
.../app/flutter/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPB
Helpers.h:29:8
Swift Compiler Error (Xcode): Include of non-modular header inside framework module
'FirebaseSessions.FIRSESNanoPBHelpers': './nanopb/pb_encode.h'
.../app/flutter/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPB
Helpers.h:30:8
Swift Compiler Error (Xcode): Include of non-modular header inside framework module
'FirebaseSessions.sessions_nanopb': './nanopb/pb.h'
.../app/flutter/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/Protogen/nanopb/ses
sions.nanopb.h:21:9
Swift Compiler Error (Xcode): Could not build Objective-C module 'FirebaseSessions'
Encountered error while building for device.
I also ensured that full pod clean before each flutter build
. This is overkill, but wanted to make sure there were no lingering pod artifacts:
cd ios
rm -rf Podfile.lock
rm -rf Pods
rm -rf pubspec.lock
pod repo update
pod cache clean --all
pod deintegrate
pod setup
pod install --repo-update
Explicitly defining the following package versions (not ideal) prevents the compilation error. Some change in between these versions and the ones listed above is causing the compilation issue.
cloud_firestore: 4.4.3
cloud_functions: 4.0.11
firebase_analytics: 10.1.4
firebase_auth: 4.2.9
firebase_core: 2.7.0
firebase_crashlytics: 3.0.15
firebase_database: 10.0.14
firebase_dynamic_links: 5.0.15
firebase_messaging: 14.2.5
firebase_storage: 11.0.14
I just created a new Flutter project and added the dependencies you mentioned, @walsha2:
cloud_firestore: ^4.5.1
cloud_functions: ^4.1.0
firebase_analytics: ^10.2.0
firebase_auth: ^4.4.1
firebase_core: ^2.9.0
firebase_crashlytics: ^3.1.0
firebase_database: ^10.1.0
firebase_dynamic_links: ^5.1.0
firebase_messaging: ^14.4.0
firebase_storage: ^11.1.0
I was able to build and run the app successfully. Here is my Podfile.lock
:
I wonder if it is something to do with the nanopb
library π€
@russellwheatley Thanks for following up, I went head and did the same thing in a new Flutter project. I noticed that in the time I posted my comment and you tested, all the firebase packages were updated (today). Sadly, this did not fix the issue. It does seem to be nanopb
that is causing the Swift compiler to error.
Here were my steps. From a fresh flutter create
project:
flutter create nanopb_bug_app
Add the latest firebase dependencies (as of today, April 18, 2023):
cloud_firestore: ^4.5.2
cloud_functions: ^4.1.1
firebase_analytics: ^10.2.1
firebase_auth: ^4.4.2
firebase_core: ^2.10.0
firebase_crashlytics: ^3.1.1
firebase_database: ^10.1.1
firebase_dynamic_links: ^5.1.1
firebase_messaging: ^14.4.1
firebase_storage: ^11.1.1
Build the app
flutter build ios
Error:
Swift Compiler Error (Xcode): Include of non-modular header inside framework module
'FirebaseSessions.FIRSESNanoPBHelpers': './nanopb/pb.h'
/nanopb_bug_app/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPBH
elpers.h:28:8
...
I even tried to enable CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES
in Xcode and that did not work either, unfortunately.
Per the issue thread, @russellwheatley it looks like you have tried twice with various package versions and did not run into issues. However, @darshankawar was able to reproduce.
At this point it could be related to the development environment? This issue is tricky. Here are all of the relevant environment related details regarding hardware and software versions on my end. This seems to reliably reproduce the issue for me with any of the recent firebase package versions (versions after https://github.com/firebase/flutterfire/issues/10621#issuecomment-1509984049 - "Workaround").
# Mac (Apple MacBook Pro "M1 Pro")
>>> sysctl hw.model
hw.model: MacBookPro18,1
# MacOS version (Ventura)
>>> sw_vers -productVersion
13.3.1
# Xcode version
>>> xcodebuild -version
Xcode 14.3
Build version 14E222b
# CocoaPods version
>>> pod --version
1.12.0
# Flutter version
>>> flutter --version
Flutter 3.7.11 β’ channel stable β’ https://github.com/flutter/flutter.git
Framework β’ revision f72efea43c (7 days ago) β’ 2023-04-11 11:57:21 -0700
Engine β’ revision 1a65d409c7
Tools β’ Dart 2.19.6 β’ DevTools 2.20.1
My environment: Apple M1 Max macbook Flutter (Channel stable, 3.7.7, on macOS 12.5.1 21G83 darwin-arm64 Cocoapods: 1.11.3 Xcode: 14.2
It is worth checking the diff in your Podfile.lock
with mine to be sure they are the same.
It is worth checking the diff in your
Podfile.lock
with mine to be sure they are the same.
It was a little hard to actually run a diff
with your Podfile.lock
because the full file was not raw uploaded so the formatting was off. I did spot check and it looked like they were all the same versions. The PODFILE CHECKSUM
values were exactly the same.
Here is my Podfile.lock as a txt
file.
Hey @mrcsilva. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Same issue here, using these versions building on Codemagic:
firebase_core: ^2.9.0
firebase_analytics: ^10.2.0
firebase_crashlytics: ^3.1.0
firebase_performance: ^0.9.1
Log:
Running pod install... 42.9s
Upgrading Pods-Runner-frameworks.sh
Running Xcode build...
Xcode archive done. 23.6s
Failed to build iOS app
Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.FIRSESNanoPBHelpers': '/Users/builder/clone/ios/Pods/Headers/Public/nanopb/pb.h'
/Users/builder/clone/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPBHelpers.h:28:8
Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.FIRSESNanoPBHelpers': '/Users/builder/clone/ios/Pods/Headers/Public/nanopb/pb_decode.h'
/Users/builder/clone/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPBHelpers.h:29:8
Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.FIRSESNanoPBHelpers': '/Users/builder/clone/ios/Pods/Headers/Public/nanopb/pb_encode.h'
/Users/builder/clone/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPBHelpers.h:30:8
Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.sessions_nanopb': '/Users/builder/clone/ios/Pods/Headers/Public/nanopb/pb.h'
/Users/builder/clone/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/Protogen/nanopb/sessions.nanopb.h:21:9
Swift Compiler Error (Xcode): Could not build Objective-C module 'FirebaseSessions'
Encountered error while archiving for device.
Build failed :|
Failed to build for iOS
Current configuration: Flutter channel: stable Mode: release Xcode version: 14.3 Machine: Mac mini M1
Same issue here, using these versions building on Codemagic:
firebase_core: ^2.9.0 firebase_analytics: ^10.2.0 firebase_crashlytics: ^3.1.0 firebase_performance: ^0.9.1
Log:
Running pod install... 42.9s Upgrading Pods-Runner-frameworks.sh Running Xcode build... Xcode archive done. 23.6s Failed to build iOS app Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.FIRSESNanoPBHelpers': '/Users/builder/clone/ios/Pods/Headers/Public/nanopb/pb.h' /Users/builder/clone/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPBHelpers.h:28:8 Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.FIRSESNanoPBHelpers': '/Users/builder/clone/ios/Pods/Headers/Public/nanopb/pb_decode.h' /Users/builder/clone/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPBHelpers.h:29:8 Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.FIRSESNanoPBHelpers': '/Users/builder/clone/ios/Pods/Headers/Public/nanopb/pb_encode.h' /Users/builder/clone/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPBHelpers.h:30:8 Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.sessions_nanopb': '/Users/builder/clone/ios/Pods/Headers/Public/nanopb/pb.h' /Users/builder/clone/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/Protogen/nanopb/sessions.nanopb.h:21:9 Swift Compiler Error (Xcode): Could not build Objective-C module 'FirebaseSessions' Encountered error while archiving for device. Build failed :| Failed to build for iOS
Current configuration: Flutter channel: stable Mode: release Xcode version: 14.3 Machine: Mac mini M1
Commenting out the platform :ios, '11.0'
line in Podfile solved the issue:
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
Not sure why though.
@russellwheatley Still running into this same issue with the most recent package versions as of this comment.
Again, completely fresh repo: flutter create nanopb_bug_app
with only the following package dependencies (on top of what is in the pubspec.yaml
default)
cloud_firestore: ^4.6.0
cloud_functions: ^4.2.0
firebase_analytics: ^10.3.0
firebase_auth: ^4.5.0
firebase_core: ^2.11.0
firebase_crashlytics: ^3.2.0
firebase_database: ^10.1.2
firebase_dynamic_links: ^5.2.0
firebase_messaging: ^14.5.0
firebase_storage: ^11.1.2
Once those deps are added: flutter build ios
- the error is encountered during Xcode build step:
Swift Compiler Error (Xcode): Include of non-modular header inside framework module
'FirebaseSessions.FIRSESNanoPBHelpers': './nanopb/pb.h'
/Desktop/nanopb_bug_app/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoP
BHelpers.h:28:8
i'm able to build (osx M1)
firebase_core: ^2.11.0
firebase_auth: ^4.5.0
cloud_firestore: ^4.6.0
firebase_analytics: ^10.3.0
by adding.. ios/Podfile:L30
target 'Runner' do
+ pod 'Firebase', :modular_headers => true
+ pod 'FirebaseCore', :modular_headers => true
+ pod 'FirebaseCoreInternal', :modular_headers => true
+ pod 'GoogleUtilities', :modular_headers => true
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
Hey @mrcsilva. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Having the same issue with the latest Firebase versions π’ Please don't close this issue, @google-oss-bot π€
@mrcsilva does this solve your problem?
target 'Runner' do
+ pod 'Firebase', :modular_headers => true
+ pod 'FirebaseCore', :modular_headers => true
+ pod 'FirebaseCoreInternal', :modular_headers => true
+ pod 'GoogleUtilities', :modular_headers => true
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
same issue here, please help
@mrcsilva does this solve your problem?
target 'Runner' do + pod 'Firebase', :modular_headers => true + pod 'FirebaseCore', :modular_headers => true + pod 'FirebaseCoreInternal', :modular_headers => true + pod 'GoogleUtilities', :modular_headers => true flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end
not working for me
@russellwheatley
pod 'Firebase', :modular_headers => true + pod 'FirebaseCore', :modular_headers => true + pod 'FirebaseCoreInternal', :modular_headers => true + pod 'GoogleUtilities', :modular_headers => true
Added this to the podfile and updated the packages to the latest versions but I'm still having the same error when building
firebase_core: ^2.13.0
firebase_crashlytics: ^3.3.1
firebase_performance: ^0.9.2+1
firebase_analytics: ^10.4.1
firebase_remote_config: ^4.2.1
@russellwheatley just echoing what @mrcsilva said - have been tracking this Github issue for a while and with every new firebase release I hope that it resolves the issue, but no such luck.
To reiterate, this is easily reproducible for me from a fresh repo:
flutter create -i swift --platforms ios modular_headers
Then I incrementally added dependencies one by one (in the following order), until the Xcode build fails:
firebase_core: ^2.13.0
firebase_crashlytics: ^3.3.1
That's it... as soon as I added firebase_crashlytics
(any of the recent versions) the error crops up. Again, these are the only two dependencies in a fresh application, aside from whatever else is in the stock pubspec.yaml file
. No other changes were made to the stock flutter create
application aside from adding those two deps.
Swift Compiler Error (Xcode): Include of non-modular header inside framework module
'FirebaseSessions.FIRSESNanoPBHelpers': './nanopb/pb.h'
/Users/user/Desktop/modular_headers/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSE
SNanoPBHelpers.h:28:8
....
Swift Compiler Error (Xcode): Could not build Objective-C module 'FirebaseSessions'
FWIW, I dont actually think it is related to firebase_crashlytics
, that just happens to be a dependency that requires the FirebaseSessions
pod. Im sure some other firebase dependency may cause this as well since they likely require FirebaseSessions
. I did not have time to test all the permutations.
Since this is so easily reproducible and you have not been able to reproduce it @russellwheatley, is there some other MacOS or XCode thing we need to dig into? I know you and I shared our system config information prior but nothing looked like a smoking gun. Summarized again below, M1 Macbook Pro running MacOS 13.4:
>>> swift --version
swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
Target: arm64-apple-macosx13.0
>>> xcodebuild -version
Xcode 14.3
Build version 14E222b
>> pod --version
1.12.1
What could possibly be so different in your setup than mine or some of the other users who have come across this issue? Are there any global Swift build flags that you may have configured? Is there anything we can do to help this issue along? All of the solutions here have not worked and seem to be a little unrelated to the core issue.
I have done all of the extra clean operations like deleting DerivedData
, the pod
deintegrate and cache clean steps, dart
cache clean, full repo git clean
. Just to really make sure. Nothings seems to work and further points to an odd package problem not an isolated user configuration issue.
Also - it does look like @darshankawar was able to reproduce this (https://github.com/firebase/flutterfire/issues/10621#issuecomment-1477652908), but I dont think he has chimed in since.
Hi @walsha2 - your instructions to reproduce are different from your initial comment. It seems I have to run:
flutter create -i swift --platforms ios modular_headers
I'll circle back to this at some point, but maybe this is it
@russellwheatley same exact issue without -i swift
, I just tested (see below). I dont think the way the app was created is the problem. I was just trying to be very explicit in this recent example. It should be functionally the same as the initial comment.
flutter create --platforms ios modular_headers_basic
Also, per the Flutter docs, specifying -i swift
is the recommended setting. And --platforms ios
simply denotes to only build the ios
target related files.
-i, --ios-language The language to use for iOS-specific code, either Objective-C (legacy) or Swift
(recommended).
Thanks for looking into it!
I followed your steps, I could not recreate I'm afraid.
I do have different versions to yourself π€. Let me know if changing any of these makes a difference, we can narrow down the search to some specific tool that will possibly allow me to recreate the issue.
>>> swift --version
swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: arm64-apple-macosx12.0
>>> xcodebuild -version
Xcode 14.2
Build version 14C18
>> pod --version
1.11.3
@russellwheatley
Xcode 14.2 includes Swift 5.7 and SDKs for iOS 16.2, iPadOS 16.2, tvOS 16.1, watchOS 9.1, and macOS Ventura 13.1. The Xcode 14.2 release supports on-device debugging in iOS 11 and later, tvOS 11 and later, and watchOS 4 and later. Xcode 14.2 requires a Mac running macOS Monterey 12.5 or later. - Release Notes
I downloaded an alternate Xcode image and downgraded to Xcode 14.2
because that is the version you have and the one that is bundled with Swift 5.7
>>> sudo xcode-select --switch /Applications/Xcode14.2.app
>>> xcodebuild -version
Xcode 14.2
Build version 14C18
>>> swift --version
swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: arm64-apple-macosx13.0
I even changed the cocoapods version to match:
>>> pod --version
1.11.3
After I made these changes, I tried to rebuild using the same exact project. No luck, sadly. Same error.
Aside from downgrading my entire MacOS 13.4 version (which I am not going to do) to match your older version, I am not sure what else I can do to throughly address any user/machine inconsistencies.
I've just wasted hours on this error, very annoying. I was defining some pods manually like that :
pod 'GoogleMobileAdsMediationFacebook'
pod 'GoogleMobileAdsMediationAppLovin'
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
Moving the pods definition just before flutter_install_all_ios_pods solved the issue
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'GoogleMobileAdsMediationFacebook'
pod 'GoogleMobileAdsMediationAppLovin'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
I really hope it will help some of you :)
Hey @mrcsilva. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
pod file
The comments on this issue have really not progressed determining what is wrong and how to actually solve it. Seems like any "solution" is just some odd patch that gets it to work in that user's environment, but does not actually address the core issue with modular headers and the Firebase pods, chiefly from FirebaseSessions.FIRSESNanoPBHelpers
@mrcsilva have you been able to resolve this issue somehow or have you just pinned the Firebase package versions to some older state? Since the update to Dart 3 and latest Flutter stable versions I am now getting into dependency hell as the locked Firebase package versions are limiting me from updating other, unrelated, packages.
Plus battling the google-oss-bot from labeling this issue as stale every couple of weeks π
@walsha2 I haven't had to update my app for a while so I just kept a specific version. That will be a problem soon.
From time to time I use the sample app that I created for this issue to check if it solved or not.
I don't think that modifying podfiles is a solution. The Firebase packages alone should compile as is and not force the user to change the podfile.
We'll have to wait a little more I guess π
Even though I git clone
a same repository, it sometimes worked on some computer and sometimes didn't on other computer.
I got the similar error after adding pod 'nanopb'
on a computer which was working fine.
pod 'nanopb' # cause non-modular headers error
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
When it works, ios/Pods/Target Support Files/nanopb/
directory exists.
When it fails, ios/Pods/Target Support Files/nanopb-framework/
and ios/Pods/Target Support Files/nanopb-library/
exist instead of ios/Pods/Target Support Files/nanopb/
.
>>> ls -Rl ios/Pods/Target\ Support\ Files/nanopb*
ios/Pods/Target Support Files/nanopb-framework:
total 56
-rw-r--r-- 1 kzrnm staff 858 7 12 22:59 nanopb-framework-Info.plist
-rw-r--r-- 1 kzrnm staff 136 7 12 22:59 nanopb-framework-dummy.m
-rw-r--r-- 1 kzrnm staff 195 7 12 22:59 nanopb-framework-prefix.pch
-rw-r--r-- 1 kzrnm staff 503 7 12 22:59 nanopb-framework-umbrella.h
-rw-r--r-- 1 kzrnm staff 791 7 12 22:59 nanopb-framework.debug.xcconfig
-rw-r--r-- 1 kzrnm staff 112 7 12 22:59 nanopb-framework.modulemap
-rw-r--r-- 1 kzrnm staff 791 7 12 22:59 nanopb-framework.release.xcconfig
ios/Pods/Target Support Files/nanopb-library:
total 32
-rw-r--r-- 1 kzrnm staff 132 7 12 22:59 nanopb-library-dummy.m
-rw-r--r-- 1 kzrnm staff 195 7 12 22:59 nanopb-library-prefix.pch
-rw-r--r-- 1 kzrnm staff 895 7 12 22:59 nanopb-library.debug.xcconfig
-rw-r--r-- 1 kzrnm staff 895 7 12 22:59 nanopb-library.release.xcconfig
>>> ls -Rl ios/Pods/Target\ Support\ Files/nanopb*
total 56
-rw-r--r-- 1 kzrnm staff 858 7 12 19:51 nanopb-Info.plist
-rw-r--r-- 1 kzrnm staff 116 7 12 19:51 nanopb-dummy.m
-rw-r--r-- 1 kzrnm staff 195 7 12 19:51 nanopb-prefix.pch
-rw-r--r-- 1 kzrnm staff 503 7 12 19:51 nanopb-umbrella.h
-rw-r--r-- 1 kzrnm staff 716 7 12 19:51 nanopb.debug.xcconfig
-rw-r--r-- 1 kzrnm staff 102 7 12 19:51 nanopb.modulemap
-rw-r--r-- 1 kzrnm staff 716 7 12 19:51 nanopb.release.xcconfig
>>> ls -Rl ios/Pods/Target\ Support\ Files/nanopb*
drwxr-xr-x 9 kzrnm staff 288 7 12 19:51 ios/Pods/Target Support Files/nanopb/
Although it is a provisional method, I was able to build iOS project.
ios/nanopb
directory.ios/nanopb
.pod 'nanopb', :path => './nanopb'
to ios/Podfile
After all these months, finally some sort of build solution, albeit a workaround.
@kzrnm is spot on. The minimal changes in https://github.com/mrcsilva/crashlytics_error/pull/1/files (described in https://github.com/firebase/flutterfire/issues/10621#issuecomment-1634522430) do indeed get this to finally build.
Thank you for providing that workaround.
@kzrnm Thanks for the workaround. However, I'll stick to specifying old versions until Google fixes this. I hope they will soon
I decided to circle back to this issue. This comment was interesting to me, and indeed is the cause of the issue.
The quickest way to test whether nanopb dependency is installed correctly and can be located is by running
pod install --verbose
in the ios directory. If it was installed correctly, you would see this in your console:
- Installing target `nanopb` iOS 9.0
- Generating module map file at `Pods/Target Support Files/nanopb/nanopb.modulemap`
- Generating umbrella header at `Pods/Target Support Files/nanopb/nanopb-umbrella.h`
- Generating Info.plist file at `Pods/Target Support Files/nanopb/nanopb-Info.plist`
- Generating dummy source at `Pods/Target Support Files/nanopb/nanopb-dummy.m`
If it isn't installed as expected by the Firebase SDK, it would look like this:
- Installing target `nanopb-framework` iOS 9.0
- Generating module map file at `Pods/Target Support Files/nanopb-framework/nanopb-framework.modulemap`
- Generating umbrella header at `Pods/Target Support Files/nanopb-framework/nanopb-framework-umbrella.h`
- Generating Info.plist file at `Pods/Target Support Files/nanopb-framework/nanopb-framework-Info.plist`
- Generating dummy source at `Pods/Target Support Files/nanopb-framework/nanopb-framework-dummy.m`
- Installing target `nanopb-library` iOS 9.0
- Generating dummy source at `Pods/Target Support Files/nanopb-library/nanopb-library-dummy.m`
I found that if I commented out this line in your Podfile, @mrcsilva, it would install nanopb dependency on the correct path and the app would build correctly.
To check whether this was a result of the FlutterFire plugins, I removed them (all FlutterFire plugins) from the pubspec.yaml
, ran flutter clean
and added them as dependencies in the Podfile
:
pod 'Firebase/Core'
pod 'Firebase/Crashlytics'
I ran pod install --verbose
and got the same results when commenting/uncommenting out the global platform setting at the top of the Podfile. In fact, I completely cleared out the Podfile of all Flutter configuration and still got the same results. This leads me to believe it isn't a result of FlutterFire nor anything set in the Podfile.
I also created a Swift project from scratch and added the pods like above:
pod 'Firebase/Core'
pod 'Firebase/Crashlytics'
But got the correct nanopb installation no matter whether the global platform setting in the Podfile was commented out/uncommented.
I can only surmise that it is something set in the project.pbxproj
or Xcode that is making the difference. But not sure what could make cocoapods install it differently.
@russellwheatley Still hadn't time to test your findings. I'll try to do so this week
I found that if I commented out this line in your Podfile, @mrcsilva, it would install nanopb dependency on the correct path and the app would build correctly.
This is the critical line buried in my last comment. It is presumably the key to the solution I think.
I found that if I commented out this line in your Podfile, @mrcsilva, it would install nanopb dependency on the correct path and the app would build correctly.
This is the critical line buried in my last comment. It is presumably the key to the solution I think.
@russellwheatley That was it!
I don't remember why I needed to add that line. Removing it solved the problem and I was able to build the app without any problem.
Thanks to everyone that helped!
Closing this based on above comment as resolved.
Bug report
Describe the bug When trying to compile my app for iOS the build process fails with the following error:
Click To Expand
``` Could not build the precompiled application for the device. Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.FIRSESNanoPBHelpers': '/Users/mario/Desktop/ecoforest_control/ios/Pods/Headers/Public/nanopb/pb.h' /Users/mario/Desktop/ecoforest_control/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPBHelpers.h:28:8 Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.FIRSESNanoPBHelpers': '/Users/mario/Desktop/ecoforest_control/ios/Pods/Headers/Public/nanopb/pb_decode.h' /Users/mario/Desktop/ecoforest_control/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPBHelpers.h:29:8 Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.FIRSESNanoPBHelpers': '/Users/mario/Desktop/ecoforest_control/ios/Pods/Headers/Public/nanopb/pb_encode.h' /Users/mario/Desktop/ecoforest_control/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/NanoPB/FIRSESNanoPBHelpers.h:30:8 Swift Compiler Error (Xcode): Include of non-modular header inside framework module 'FirebaseSessions.sessions_nanopb': '/Users/mario/Desktop/ecoforest_control/ios/Pods/Headers/Public/nanopb/pb.h' /Users/mario/Desktop/ecoforest_control/ios/Pods/FirebaseSessions/FirebaseSessions/SourcesObjC/Protogen/nanopb/sessions.nanopb.h:21:9 Swift Compiler Error (Xcode): Could not build Objective-C module 'FirebaseSessions' Error launching application on iPhone. ```Expected behavior
Xcode should build the app.
Sample project
https://github.com/mrcsilva/crashlytics_error
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
``` Doctor summary (to see all details, run flutter doctor -v): [β] Flutter (Channel stable, 3.7.7, on macOS 12.6.2 21G320 darwin-x64, locale en-PT) [β] Android toolchain - develop for Android devices (Android SDK version 32.0.0-rc1) [β] Xcode - develop for iOS and macOS (Xcode 14.2) [β] Chrome - develop for the web [β] Android Studio (version 2021.3) [β] IntelliJ IDEA Community Edition (version 2022.3.3) [β] VS Code (version 1.71.2) [β] Connected device (3 available) ! Error: (null) needs to connect to determine its availability. Check the connection between the device and its companion iPhone, and the connection between the iPhone and Xcode. Both devices may also need to be restarted and unlocked. (code 1) [β] HTTP Host Availability β’ No issues found! ```Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
``` Dart SDK 2.19.4 Flutter SDK 3.7.7 ecoforest_control 2.3.7+58 dependencies: - app_tracking_transparency 2.0.3 [flutter] - collapsible 1.0.0 [flutter] - cupertino_icons 1.0.5 - device_info_plus 7.0.1 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32] - firebase_analytics 10.1.6 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_crashlytics 3.0.17 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_performance 0.9.0+16 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter] - firebase_remote_config 3.0.15 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter] - flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine] - flutter_localizations 0.0.0 [flutter intl characters clock collection js material_color_utilities meta path vector_math] - fluttericon 2.0.0 [flutter] - font_awesome_flutter 10.4.0 [flutter] - google_mobile_ads 2.3.0 [meta flutter visibility_detector] - http 0.13.5 [async http_parser meta path] - intl 0.17.0 [clock path] - ionicons 0.2.2 [flutter] - mediation_test 0.0.3 [flutter] - path 1.8.2 - provider 6.0.5 [collection flutter nested] - purchases_flutter 4.11.0 [flutter freezed_annotation json_annotation] - shared_preferences 2.0.18 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - sprintf 7.0.0 - sqflite 2.2.6 [flutter sqflite_common path] - url_launcher 6.1.10 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - weather_icons 3.0.0 [flutter] - webview_flutter 4.0.6 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview] - wifi_info_flutter 2.0.2 [flutter wifi_info_flutter_platform_interface] dev dependencies: - flutter_launcher_icons 0.12.0 [args checked_yaml cli_util image json_annotation path yaml] - flutter_lints 2.0.1 [lints] - intl_utils 2.8.2 [analyzer archive args dart_style http intl path petitparser yaml] transitive dependencies: - _fe_analyzer_shared 56.0.0 [meta] - _flutterfire_internals 1.0.18 [collection firebase_core firebase_core_platform_interface flutter meta] - analyzer 5.8.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - archive 3.3.6 [crypto path pointycastle] - args 2.4.0 - async 2.10.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - characters 1.2.1 - checked_yaml 2.0.2 [json_annotation source_span yaml] - cli_util 0.3.5 [meta path] - clock 1.1.1 - collection 1.17.0 - convert 3.1.1 [typed_data] - crypto 3.0.2 [typed_data] - dart_style 2.3.0 [analyzer args path pub_semver source_span] - device_info_plus_platform_interface 6.0.1 [flutter meta plugin_platform_interface] - fake_async 1.3.1 [clock collection] - ffi 2.0.1 - file 6.1.4 [meta path] - firebase_analytics_platform_interface 3.3.23 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.1+14 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_core 2.8.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_core_platform_interface 4.5.3 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.2.2 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.3.17 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_performance_platform_interface 0.1.1+35 [_flutterfire_internals firebase_core flutter plugin_platform_interface] - firebase_performance_web 0.1.1+24 [_flutterfire_internals firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js] - firebase_remote_config_platform_interface 1.1.35 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_remote_config_web 1.1.24 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection js matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - freezed_annotation 2.2.0 [collection json_annotation meta] - glob 2.1.1 [async collection file path string_scanner] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image 4.0.15 [archive meta xml] - js 0.6.5 [meta] - json_annotation 4.8.0 [meta] - lints 2.0.1 - matcher 0.12.13 [meta stack_trace] - material_color_utilities 0.2.0 - meta 1.8.0 - nested 1.0.0 [flutter] - package_config 2.1.0 [path] - path_provider_linux 2.1.10 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.0.6 [flutter platform plugin_platform_interface] - path_provider_windows 2.1.5 [ffi flutter path path_provider_platform_interface win32] - petitparser 5.1.0 [meta] - platform 3.1.0 - plugin_platform_interface 2.1.4 [meta] - pointycastle 3.7.0 [collection convert js] - process 4.2.4 [file path platform] - pub_semver 2.1.3 [collection meta] - shared_preferences_android 2.0.17 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.1.5 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.1.5 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.1.1 [flutter plugin_platform_interface] - shared_preferences_web 2.0.6 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.1.5 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - sky_engine 0.0.99 - source_span 1.9.1 [collection path term_glyph] - sqflite_common 2.4.3 [synchronized path meta] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - string_scanner 1.2.0 [source_span] - synchronized 3.0.1 - term_glyph 1.2.1 - test_api 0.4.16 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - typed_data 1.3.1 [collection] - url_launcher_android 6.0.25 [flutter url_launcher_platform_interface] - url_launcher_ios 6.1.2 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.4 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.4 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.2 [flutter plugin_platform_interface] - url_launcher_web 2.0.16 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.5 [flutter url_launcher_platform_interface] - vector_math 2.1.4 - visibility_detector 0.3.3 [flutter] - watcher 1.0.2 [async path] - webview_flutter_android 3.4.2 [flutter webview_flutter_platform_interface] - webview_flutter_platform_interface 2.1.0 [flutter meta plugin_platform_interface] - webview_flutter_wkwebview 3.2.1 [flutter path webview_flutter_platform_interface] - wifi_info_flutter_platform_interface 2.0.1 [plugin_platform_interface flutter] - win32 3.1.3 [ffi] - xdg_directories 1.0.0 [meta path process] - xml 6.2.2 [collection meta petitparser] - yaml 3.1.1 [collection source_span string_scanner] ```