Firebase-ios-sdk: Compilation error for armv7 in nanopb/firebasecore.nanopb.c

Created on 8 May 2020  Â·  13Comments  Â·  Source: firebase/firebase-ios-sdk

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 11.4.1 and 11.5 (beta 2)
  • Firebase SDK version: 6.24.0
  • Firebase Component: CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c
  • Component version: "1.30905.0"
  • Installation method: `CocoaPods'

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

Compile the app for 32-bit architecture armv7 (e.g. for iOS 10, iPhone 5)

Get the error:

Compiling firebasecore.nanopb.c
1849
    ✗ Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c:[42,5] use of undeclared identifier 'PB_LTYPE_BOOL'
1850
    »     PB_FIELD( 25, BOOL    , OPTIONAL, STATIC  , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, use_default_app, min_supported_ios_version, 0),
1851
    »     ^
1852
    âš  Pods/nanopb/pb.h:[534,9] expanded from macro 'PB_FIELD'
1853
    »         PB_LTYPE_MAP_ ## type, ptr)
1854
    »         ^
1855
    âš  Pods/nanopb/pb.h:[495,41] expanded from macro 'PB_LTYPE_MAP_BOOL'
1856
    » #define PB_LTYPE_MAP_BOOL               PB_LTYPE_BOOL
1857
    »                                         ^
1858
    ✗ Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c:[43,5] use of undeclared identifier 'PB_LTYPE_BOOL'
1859
    »     PB_FIELD( 26, BOOL    , OPTIONAL, STATIC  , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, deployed_in_app_store, use_default_app, 0),
1860
    »     ^
1861
    âš  Pods/nanopb/pb.h:[534,9] expanded from macro 'PB_FIELD'
1862
    »         PB_LTYPE_MAP_ ## type, ptr)
1863
    »         ^
1864
    âš  Pods/nanopb/pb.h:[495,41] expanded from macro 'PB_LTYPE_MAP_BOOL'
1865
    » #define PB_LTYPE_MAP_BOOL               PB_LTYPE_BOOL
1866
    »                                         ^
1867
    ✗ Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c:[46,5] use of undeclared identifier 'PB_LTYPE_BOOL'
1868
    »     PB_FIELD( 29, BOOL    , OPTIONAL, STATIC  , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, using_zip_file, apple_framework_version, 0),
1869
    »     ^
1870
    âš  Pods/nanopb/pb.h:[534,9] expanded from macro 'PB_FIELD'
1871
    »         PB_LTYPE_MAP_ ## type, ptr)
1872
    »         ^
1873
    âš  Pods/nanopb/pb.h:[495,41] expanded from macro 'PB_LTYPE_MAP_BOOL'
1874
    » #define PB_LTYPE_MAP_BOOL               PB_LTYPE_BOOL
1875
    »                                         ^
1876
    ✗ Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c:[49,5] use of undeclared identifier 'PB_LTYPE_BOOL'
1877
    »     PB_FIELD( 33, BOOL    , OPTIONAL, STATIC  , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, swizzling_enabled, platform_info, 0),
1878
    »     ^
1879
    âš  Pods/nanopb/pb.h:[534,9] expanded from macro 'PB_FIELD'
1880
    »         PB_LTYPE_MAP_ ## type, ptr)
1881
    »         ^
1882
    âš  Pods/nanopb/pb.h:[495,41] expanded from macro 'PB_LTYPE_MAP_BOOL'
1883
    » #define PB_LTYPE_MAP_BOOL               PB_LTYPE_BOOL
1884
    »                                         ^
1885
    ✗ Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c:[50,5] use of undeclared identifier 'PB_LTYPE_BOOL'
1886
    »     PB_FIELD( 36, BOOL    , OPTIONAL, STATIC  , OTHER, logs_proto_mobilesdk_ios_ICoreConfiguration, using_gdt, swizzling_enabled, 0),
1887
    »     ^
1888
    âš  Pods/nanopb/pb.h:[534,9] expanded from macro 'PB_FIELD'
1889
    »         PB_LTYPE_MAP_ ## type, ptr)
1890
    »         ^
1891
    âš  Pods/nanopb/pb.h:[495,41] expanded from macro 'PB_LTYPE_MAP_BOOL'
1892
    » #define PB_LTYPE_MAP_BOOL               PB_LTYPE_BOOL
1893
    »                                         ^
1894
    â–¸ Compiling FirebaseCoreDiagnostics_vers.c
1895
    â–¸ Compiling FirebaseCoreDiagnostics-dummy.m
1896
    âš  Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'FirebaseCoreDiagnostics' from project 'Pods')
The following build commands failed:
/Pods.build/Staging-iphoneos/FirebaseCoreDiagnostics.build/Objects-normal/armv7/firebasecore.nanopb.o Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c normal armv7 c com.apple.compilers.llvm.clang.1_0.compiler

More details

I compiled locally and remotely (using buddybuild) on both Xcode v.11.4.1 and Xcode 11.5 (beta 2).

The error happens only after installation of Firebase 6.24.0 (nanopb 1.30905.0), on 6.23.0 (nanopb 0.3.9011) it compiles without the error in both Xcode versions.

core

Most helpful comment

@paulb777
Found the resolution of the issue.

I did:

pod deintegrate
pod update

Maybe some kind of an issue with cocoapods.

All 13 comments

@Ariandr Thanks for the report. I'm not able to reproduce.

I suspect that you somehow have the 0.3.9011 version of pb.h in your environment that's overriding the 1.30905.0 version.

PB_LTYPE_BOOL was added in the latest version and based on the symptoms, it looks like your build is still using the old version.

Hi @paulb777
Thanks for the quick response.

The problem is that I cleaned up my local environment before the compilation, I reinstalled the pods, I tried different things. But the error is pretty consistent.

And also, we are using buddybuild, it doesn't have any cache with our settings. It reinstalls all the pods from scratch for all builds and the only pod we manually specify is Firebase/Analytics. But even in this way we get the same error.

What might be the issue? Is there a way to ensure there is the needed nanopb version?

find . | grep pb.h might provide some clues.

You could also grep your project for #define PB_LTYPE_VARINT. It should have a value of 1 with the current release.

$ find . | grep pb.h
./new-Pods/GoogleDataTransportCCTSupport/GoogleDataTransportCCTSupport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h
./new-Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h
./new-Pods/nanopb/pb.h
./Pods/GoogleDataTransportCCTSupport/GoogleDataTransportCCTSupport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h
./Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h
./Pods/nanopb/pb.h

$ grep -r "#define PB_LTYPE_VARINT" *
Pods/nanopb/pb.h:#define PB_LTYPE_VARINT  0x00 /* int32, int64, enum, bool */
new-Pods/nanopb/pb.h:#define PB_LTYPE_VARINT  0x01 /* int32, int64, enum, bool */

I am too facing the same error

I have the same error. I was running in simulator.

Screen Shot 2020-05-12 at 22 19 35

@andre991 @Kedar-27 See the suggestions above. We're likely going to need a reproducible example to investigate any deeper.

@paulb777 and @Ariandr

I went to generate the sample app for you, I couldn't, so I duplicated (made a copy of the folder) my project that was showing the same error. So I ran the pod update on the copied project and miraculously did not give the error.

🤔

I also tried to generate the app for you to reproduce the error, but in the test (empty) project it worked. Unfortunately, I wasn't able to get rid of the issue in my main project. Again, on 6.23.0 compiles without the issue and we have to use it instead of 6.24.0.

@Ariandr What did you find searching the project for declarations of PB_LTYPE_VARINT?

Hi @paulb777
Sorry for the delay with response.

$ grep -r "#define PB_LTYPE_VARINT" *
Pods/nanopb/pb.h:#define PB_LTYPE_VARINT  0x01 /* int32, int64, enum, bool */

The issue might be with PB_LTYPE_BOOL, though I'm not sure.
The error which Xcode gives in my case is the next (you can also see it on the screenshot from @andre991 ):

/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c:50:5: Use of undeclared identifier 'PB_LTYPE_BOOL'

Also, I did this:

$ grep -r "#define PB_LTYPE_BOOL" *
Pods/nanopb/pb.h:#define PB_LTYPE_BOOL    0x00 /* bool */

PB_LTYPE_BOOL was added in the most recent release and the other PB_LTYPEs were renumbered.

It looks like you do have the updated pb.h in your project. The next step would be to understand why the build system is not seeing it.

We're still not going to be able to help much more without a reproducible example.

@paulb777
Found the resolution of the issue.

I did:

pod deintegrate
pod update

Maybe some kind of an issue with cocoapods.

@Ariandr Glad you resolved it! It could also have been caused by stale Xcode state.

Was this page helpful?
0 / 5 - 0 ratings