Skip to content

πŸ› [firebase_messaging] iOS build error - fatal error: could not build module 'nanopb'Β #3840

@seanmc86

Description

@seanmc86

Bug report

Describe the bug
Using the latest firebase_messaging (7.0.3) in my Flutter project. On building:

Failed to build iOS app

Error output from Xcode build:
↳
** BUILD FAILED **

Xcode's output:
↳
While building module 'nanopb' imported from /Users/sean/Projects/drag_test/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22:
In file included from :1:
/Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:13:9: error: double-quoted include "pb.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#import "pb.h"
^~~~~~
<pb.h>
/Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:14:9: error: double-quoted include "pb_common.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#import "pb_common.h"
^~~~~~~~~~~~~
<pb_common.h>
While building module 'nanopb' imported from /Users/sean/Projects/drag_test/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22:
In file included from :1:
In file included from /Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:14:
/Users/sean/Projects/drag_test/ios/Pods/nanopb/pb_common.h:8:10: error: double-quoted include "pb.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#include "pb.h"
^~~~~~
<pb.h>
While building module 'nanopb' imported from /Users/sean/Projects/drag_test/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22:
In file included from :1:
/Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:15:9: error: double-quoted include "pb_decode.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#import "pb_decode.h"
^~~~~~~~~~~~~
<pb_decode.h>
While building module 'nanopb' imported from /Users/sean/Projects/drag_test/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22:
In file included from :1:
In file included from /Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:15:
/Users/sean/Projects/drag_test/ios/Pods/nanopb/pb_decode.h:9:10: error: double-quoted include "pb.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#include "pb.h"
^~~~~~
<pb.h>
While building module 'nanopb' imported from /Users/sean/Projects/drag_test/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22:
In file included from :1:
/Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:16:9: error: double-quoted include "pb_encode.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#import "pb_encode.h"
^~~~~~~~~~~~~
<pb_encode.h>
While building module 'nanopb' imported from /Users/sean/Projects/drag_test/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22:
In file included from :1:
In file included from /Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:16:
/Users/sean/Projects/drag_test/ios/Pods/nanopb/pb_encode.h:9:10: error: double-quoted include "pb.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#include "pb.h"
^~~~~~
<pb.h>
While building module 'nanopb' imported from /Users/sean/Projects/drag_test/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22:
In file included from :1:
/Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:17:9: error: double-quoted include "pb.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#import "pb.h"
^~~~~~
<pb.h>
/Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:18:9: error: double-quoted include "pb_decode.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#import "pb_decode.h"
^~~~~~~~~~~~~
<pb_decode.h>
/Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:19:9: error: double-quoted include "pb_common.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#import "pb_common.h"
^~~~~~~~~~~~~
<pb_common.h>
/Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:20:9: error: double-quoted include "pb.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#import "pb.h"
^~~~~~
<pb.h>
/Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:21:9: error: double-quoted include "pb_encode.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#import "pb_encode.h"
^~~~~~~~~~~~~
<pb_encode.h>
/Users/sean/Projects/drag_test/ios/Pods/Target Support Files/nanopb/nanopb-umbrella.h:22:9: error: double-quoted include "pb_common.h" in framework header, expected angle-bracketed instead [-Werror,-Wquoted-include-in-framework-header]
#import "pb_common.h"
^~~~~~~~~~~~~
<pb_common.h>
13 errors generated.
In file included from /Users/sean/Projects/drag_test/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.c:20:
/Users/sean/Projects/drag_test/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22:10: fatal error: could not build module 'nanopb'
#include <nanopb/pb.h>
~~~~~~~~^
14 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

Could not build the application for the simulator.

Steps to reproduce

Steps to reproduce the behavior:

  1. Add firebase_messaging: 7.0.3 to pubspec.yaml
  2. Add the following to the main.dart file prior to runApp:
    await Firebase.initializeApp();
  3. Build yields the above error

Upon inspecting the files mentioned in the error, many imports have been duplicated.


Additional context

Tried the following:

  1. Clean Xcode derived data, flutter clean & remove pods & podfile.lock
  2. Delete iOS folder entirely
  3. Try earlier firebase_messaging versions such as 7.0.0.

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, 1.22.1, on Mac OS X 10.15.7 19H2, locale en-GB)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[βœ“] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[βœ“] Android Studio (version 4.0)
[βœ“] IntelliJ IDEA Community Edition (version 2020.2.3)
[βœ“] VS Code (version 1.50.0)
[βœ“] Connected device (1 available)

β€’ No issues found!

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.10.1
Flutter SDK 1.22.1
drag_test 1.0.0+1

dependencies:
- cupertino_icons 1.0.0
- firebase_messaging 7.0.3 [meta flutter firebase_core]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]

dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]

transitive dependencies:
- async 2.5.0-nullsafety.1 [collection]
- boolean_selector 2.1.0-nullsafety.1 [source_span string_scanner]
- characters 1.1.0-nullsafety.3
- charcode 1.2.0-nullsafety.1
- clock 1.1.0-nullsafety.1
- collection 1.15.0-nullsafety.3
- fake_async 1.2.0-nullsafety.1 [clock collection]
- firebase 7.3.0 [http http_parser js]
- firebase_core 0.5.0+1 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.0 [firebase firebase_core_platform_interface flutter flutter_web_plugins meta js]
- flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math]
- http 0.12.2 [http_parser path pedantic]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- js 0.6.2
- matcher 0.12.10-nullsafety.1 [stack_trace]
- meta 1.3.0-nullsafety.3
- path 1.8.0-nullsafety.1
- pedantic 1.9.2 [meta]
- plugin_platform_interface 1.0.3 [meta]
- quiver 2.1.3 [matcher meta]
- sky_engine 0.0.99
- source_span 1.8.0-nullsafety.2 [charcode collection path term_glyph]
- stack_trace 1.10.0-nullsafety.1 [path]
- stream_channel 2.1.0-nullsafety.1 [async]
- string_scanner 1.1.0-nullsafety.1 [charcode source_span]
- term_glyph 1.2.0-nullsafety.1
- test_api 0.2.19-nullsafety.2 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.3.0-nullsafety.3 [collection]
- vector_math 2.1.0-nullsafety.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact: crowdAffects many people, though not necessarily a specific customer with an assigned label. (P2)platform: iosIssues / PRs which are specifically for iOS.plugin: messagingtype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions