Search code examples
swiftxcodefirebasecocoapods

"Use of undeclared identifier '__BYTE_ORDER' " error after updating pod


Getting these two errors, after updating pods:

Use of undeclared identifier '__BYTE_ORDER'
Use of undeclared identifier '__LITTLE_ENDIAN'

Using Xcode Version 11.2.1 (11B53)

Xcode errors


Solution

  • Well, I have solved my problem. I have done the following steps:

    1) Uninstall pod:
    To remove pods from a project completely you need to install two things.

    a) Cocoapods-Deintegrate Plugin
    b) Cocoapods-Clean Plugin

    To install those, open your terminal and type

    sudo gem install cocoapods-deintegrate
    

    (Press enter)

    sudo gem install cocoapods-clean
    

    Now go to your project directory by typing this on your terminal

    cd (path of the project) //Remove the braces after cd
    

    Then press enter and type

    pod deintegrate
    

    to deintegrate pod. Then type

    pod cache clean --all
    

    to clean the cache. Now type

    pod clean
    

    to clean pod directory.

    After completing the above tasks there should be the Podfile still remaining on your project directory. Just delete that manually or use this following command on the terminal.

    rm Podfile
    

    Then delete the DerivedData from Xcode by typing

    rm -rf ~/Library/Developer/Xcode/DerivedData
    

    Or follow the link to delete it manually.

    Now remove Cocoapods from the system

    sudo gem uninstall cocoapods
    

    That's it. Now you have your project free from Pods & Cleaned.

    2) Install pod:
    After that, install a fresh pod to your project by following:

    sudo gem install -n /usr/local/bin cocoapods
    

    For MacOS, Catalina

    sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
    

    Latest CocoaPods 1.10.0 seem not working. More info is here. Then give your project path

    cd /your project path 
    

    Now type

    pod setup
    

    Init the Pod

    pod init
    

    Open Pod file and add Pod list into it
    For example

    pod 'Firebase/Analytics'
    pod 'Firebase/Auth'
    pod 'Firebase/Firestore'
    

    Then install those pods.

    pod install
    

    Now open your-project.xcworkspace. The errors should be gone.
    Thanks