3

I have a simple Xcode project with some Pods (related to Google Firebase) already installed. Everything with these is working perfectly fine. However, any attempts to install any additional Pods is resulting in the Xcode project failing to compile. I'm providing two examples of this below. Please note that both pods below are failing with the same error

LBTAComponents

I am trying to install the LBTAComponents pod.

I add pod "LBTAComponents" to the Podfile and run Pod install. I then build the project, and the build fails with error /Users/admin/testApp/Pods/leveldb-library/port/port_posix.h:77:35: Use of undeclared identifier '__BYTE_ORDER'

I've tried the standard troubleshooting steps, such as cleaning the build data and deleting the Derived Data folder. The issue still persists

AFNetworking

I am having a similar issue with the AFNetwoking pod.

I add pod 'AFNetworking', '~> 3.0'" to the Podfile and run Pod install. I then build the project, and again the build fails with error /Users/admin/testApp/Pods/leveldb-library/port/port_posix.h:77:35: Use of undeclared identifier '__BYTE_ORDER'. This is the same error as the previous example.

Again, the standard troubleshooting steps I mentioned before did not resolve the issue.

I'll emphasize again that the installation of Google's Firebase pods is working perfectly fine. However, subsequent pod installations are producing the error I described above.

Any idea how I can go about correcting this? Cheers!

LBTAComponents

Okay, so attempting to install any additional Pods related to Firebase also results in the same build failure as above. So it seems that I cannot install any new Pods whatsoever.

For reference, here is my Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'App' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for App
  pod 'Firebase'
  pod 'Firebase/Analytics'
  pod 'Firebase/Auth'
  pod 'Firebase/Storage'
  pod 'Firebase/Firestore'
  pod 'Firebase/Database'

  target 'AppTests' do
    inherit! :search_paths
    # Pods for testing
    pod 'Firebase'
    pod 'Firebase/Analytics'
    pod 'Firebase/Auth'
    pod 'Firebase/Storage'
    pod 'Firebase/Firestore'
    pod 'Firebase/Database'
  end

  target 'AppUITests' do
    inherit! :search_paths
    # Pods for testing
    pod 'Firebase'
    pod 'Firebase/Analytics'
    pod 'Firebase/Auth'
    pod 'Firebase/Storage'
    pod 'Firebase/Firestore'
    pod 'Firebase/Database'
  end

end

and my Podfile.lock:

PODS:
  - BoringSSL-GRPC (0.0.3):
    - BoringSSL-GRPC/Implementation (= 0.0.3)
    - BoringSSL-GRPC/Interface (= 0.0.3)
  - BoringSSL-GRPC/Implementation (0.0.3):
    - BoringSSL-GRPC/Interface (= 0.0.3)
  - BoringSSL-GRPC/Interface (0.0.3)
  - Firebase (6.9.0):
    - Firebase/Core (= 6.9.0)
  - Firebase/Analytics (6.9.0):
    - Firebase/Core
  - Firebase/Auth (6.9.0):
    - Firebase/CoreOnly
    - FirebaseAuth (~> 6.2.3)
  - Firebase/Core (6.9.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 6.1.2)
  - Firebase/CoreOnly (6.9.0):
    - FirebaseCore (= 6.3.0)
  - Firebase/Database (6.9.0):
    - Firebase/CoreOnly
    - FirebaseDatabase (~> 6.1.0)
  - Firebase/Firestore (6.9.0):
    - Firebase/CoreOnly
    - FirebaseFirestore (~> 1.5.1)
  - Firebase/Storage (6.9.0):
    - Firebase/CoreOnly
    - FirebaseStorage (~> 3.4.1)
  - FirebaseAnalytics (6.1.2):
    - FirebaseCore (~> 6.3)
    - FirebaseInstanceID (~> 4.2)
    - GoogleAppMeasurement (= 6.1.2)
    - GoogleUtilities/AppDelegateSwizzler (~> 6.0)
    - GoogleUtilities/MethodSwizzler (~> 6.0)
    - GoogleUtilities/Network (~> 6.0)
    - "GoogleUtilities/NSData+zlib (~> 6.0)"
    - nanopb (~> 0.3)
  - FirebaseAuth (6.2.3):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 6.2)
    - GoogleUtilities/AppDelegateSwizzler (~> 6.2)
    - GoogleUtilities/Environment (~> 6.2)
    - GTMSessionFetcher/Core (~> 1.1)
  - FirebaseAuthInterop (1.0.0)
  - FirebaseCore (6.3.0):
    - FirebaseCoreDiagnostics (~> 1.0)
    - FirebaseCoreDiagnosticsInterop (~> 1.0)
    - GoogleUtilities/Environment (~> 6.2)
    - GoogleUtilities/Logger (~> 6.2)
  - FirebaseCoreDiagnostics (1.1.0):
    - FirebaseCoreDiagnosticsInterop (~> 1.0)
    - GoogleDataTransportCCTSupport (~> 1.0)
    - GoogleUtilities/Environment (~> 6.2)
    - GoogleUtilities/Logger (~> 6.2)
  - FirebaseCoreDiagnosticsInterop (1.0.0)
  - FirebaseDatabase (6.1.0):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 6.0)
    - leveldb-library (~> 1.18)
  - FirebaseFirestore (1.5.1):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 6.2)
    - FirebaseFirestore/abseil-cpp (= 1.5.1)
    - "gRPC-C++ (= 0.0.9)"
    - leveldb-library (~> 1.22)
    - nanopb (~> 0.3.901)
    - Protobuf (~> 3.1)
  - FirebaseFirestore/abseil-cpp (1.5.1):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 6.2)
    - "gRPC-C++ (= 0.0.9)"
    - leveldb-library (~> 1.22)
    - nanopb (~> 0.3.901)
    - Protobuf (~> 3.1)
  - FirebaseInstanceID (4.2.5):
    - FirebaseCore (~> 6.0)
    - GoogleUtilities/Environment (~> 6.0)
    - GoogleUtilities/UserDefaults (~> 6.0)
  - FirebaseStorage (3.4.1):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 6.0)
    - GTMSessionFetcher/Core (~> 1.1)
  - GoogleAppMeasurement (6.1.2):
    - GoogleUtilities/AppDelegateSwizzler (~> 6.0)
    - GoogleUtilities/MethodSwizzler (~> 6.0)
    - GoogleUtilities/Network (~> 6.0)
    - "GoogleUtilities/NSData+zlib (~> 6.0)"
    - nanopb (~> 0.3)
  - GoogleDataTransport (2.0.0)
  - GoogleDataTransportCCTSupport (1.1.0):
    - GoogleDataTransport (~> 2.0)
    - nanopb
  - GoogleUtilities/AppDelegateSwizzler (6.3.1):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (6.3.1)
  - GoogleUtilities/Logger (6.3.1):
    - GoogleUtilities/Environment
  - GoogleUtilities/MethodSwizzler (6.3.1):
    - GoogleUtilities/Logger
  - GoogleUtilities/Network (6.3.1):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (6.3.1)"
  - GoogleUtilities/Reachability (6.3.1):
    - GoogleUtilities/Logger
  - GoogleUtilities/UserDefaults (6.3.1):
    - GoogleUtilities/Logger
  - "gRPC-C++ (0.0.9)":
    - "gRPC-C++/Implementation (= 0.0.9)"
    - "gRPC-C++/Interface (= 0.0.9)"
  - "gRPC-C++/Implementation (0.0.9)":
    - "gRPC-C++/Interface (= 0.0.9)"
    - gRPC-Core (= 1.21.0)
    - nanopb (~> 0.3)
  - "gRPC-C++/Interface (0.0.9)"
  - gRPC-Core (1.21.0):
    - gRPC-Core/Implementation (= 1.21.0)
    - gRPC-Core/Interface (= 1.21.0)
  - gRPC-Core/Implementation (1.21.0):
    - BoringSSL-GRPC (= 0.0.3)
    - gRPC-Core/Interface (= 1.21.0)
    - nanopb (~> 0.3)
  - gRPC-Core/Interface (1.21.0)
  - GTMSessionFetcher/Core (1.2.2)
  - leveldb-library (1.22)
  - nanopb (0.3.901):
    - nanopb/decode (= 0.3.901)
    - nanopb/encode (= 0.3.901)
  - nanopb/decode (0.3.901)
  - nanopb/encode (0.3.901)
  - Protobuf (3.10.0)

DEPENDENCIES:
  - Firebase
  - Firebase/Analytics
  - Firebase/Auth
  - Firebase/Database
  - Firebase/Firestore
  - Firebase/Storage

SPEC REPOS:
  https://github.com/cocoapods/specs.git:
    - BoringSSL-GRPC
    - Firebase
    - FirebaseAnalytics
    - FirebaseAuth
    - FirebaseAuthInterop
    - FirebaseCore
    - FirebaseCoreDiagnostics
    - FirebaseCoreDiagnosticsInterop
    - FirebaseDatabase
    - FirebaseFirestore
    - FirebaseInstanceID
    - FirebaseStorage
    - GoogleAppMeasurement
    - GoogleDataTransport
    - GoogleDataTransportCCTSupport
    - GoogleUtilities
    - "gRPC-C++"
    - gRPC-Core
    - GTMSessionFetcher
    - leveldb-library
    - nanopb
    - Protobuf

SPEC CHECKSUMS:
  BoringSSL-GRPC: db8764df3204ccea016e1c8dd15d9a9ad63ff318
  Firebase: 2d750c54cda57d5a6ae31212cfe5cc813c6be7e4
  FirebaseAnalytics: 5d9ccbf46ed25d3ec9304d263f85bddf1e93e2d2
  FirebaseAuth: e7f86c2dfc57281cd01f7da5e4b40e01e4510a4a
  FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc
  FirebaseCore: 8b2765c445d40db7137989b7146a3aa3f91b5529
  FirebaseCoreDiagnostics: be4f7a09d02ab305f18de59a470412caddb64c2a
  FirebaseCoreDiagnosticsInterop: 6829da2b8d1fc795ff1bd99df751d3788035d2cb
  FirebaseDatabase: 518cd94286de2ee999e19383a2a6ae04c81ce993
  FirebaseFirestore: 5ee8bdb959541f0d55352f2d681efb03b9742a43
  FirebaseInstanceID: 550df9be1f99f751d8fcde3ac342a1e21a0e6c42
  FirebaseStorage: b7c6d00997bc21d4465453bdcc5cc65513110fed
  GoogleAppMeasurement: 0ae90be1cc4dad40f4a27fc767ef59fa032ec87b
  GoogleDataTransport: c8617c00e4f3eb9418e42ac0e8ac5241a9d555dd
  GoogleDataTransportCCTSupport: 9f352523e8785a71f6754f51eeff09f49ec19268
  GoogleUtilities: f895fde57977df4e0233edda0dbeac490e3703b6
  "gRPC-C++": 9dfe7b44821e7b3e44aacad2af29d2c21f7cde83
  gRPC-Core: c9aef9a261a1247e881b18059b84d597293c9947
  GTMSessionFetcher: 61bb0f61a4cb560030f1222021178008a5727a23
  leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7
  nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
  Protobuf: a4dc852ad69c027ca2166ed287b856697814375b

PODFILE CHECKSUM: a068de7f759e79161ece809834082ef4236e1f53

COCOAPODS: 1.7.5

3 Answers3

4

the build fails with error /Users/admin/testApp/Pods/leveldb-library/port/port_posix.h:77:35: Use of undeclared identifier '__BYTE_ORDER'. This is the same error as the previous example.

If you read the error, you'll see that the offending pod is leveldb-library. A quick pod search leveldb-library points us to the leveldb-library Github repo, where we should be able to find the offending file. Looking at your Podfile.lock, you're inheriting the dependency on leveldb-library from Firebase. There's something a little weird about that leveldb-library pod -- most of the tags in the repo have a 'v', like v1.20, but a few are missing the 'v', such as 1.22. If you look at the port directory in the 1.22 tag, you'll see that none of the file names mention posix, but if you look in the v1.20 tag you'll find the port_posix.h file that the error complains about.

So, it looks like maybe you've some outdated files in your copy of the leveldb-library pod, and you should probably just clear that out and install it again. IIRC you can do:

pod clean leveldb-library

followed by:

pod install

and you should get a fresh copy. If that doesn't solve the problem, continue to dig into exactly which copy of that pod you've got and make sure it matches what's in the pod's repo. You could also do a pod update since you're at least one version behind on Firebase.

Caleb
  • 124,013
  • 19
  • 183
  • 272
0

I had same error on leveldb-library (same version and same checksum as OP) after I updated my macOS to catalina, upgraded my Cocoapod and upgrade my XCode from 10.2 to 11.1.

I solved my problem after I changed the build system from New Build System to Legacy Build System via File Menu -> Workspace Settings.. -> Build System. (refer to https://stackoverflow.com/a/53050109/3230406)

V-SHY
  • 3,925
  • 4
  • 31
  • 47
0

resolved by cleaning build folder product -> clean build folder

Fahd Allebdi
  • 354
  • 4
  • 7