Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode firebase message error OSAtomicCompareAndSwapPtrBarrier

I have an application in ionic 3 (legacy) when building it I get the error in the Firebase Messaging library in this part of the file "GtalkExtensions.pbobjc"

if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) {
      [worker release];
    }

Conflicting types for 'OSAtomicCompareAndSwapPtrBarrier'

Declaration of 'OSAtomicCompareAndSwapPtrBarrier' must be imported from module 'Darwin.libkern.OSAtomic' before it is required

Implicit declaration of function 'OSAtomicCompareAndSwapPtrBarrier' is invalid in C99

How to solve this problem I already removed cocoapods completely and tested several versions and it didn't help.

Mac Mini M1 Mac OS Ventura XCode 14.2

like image 858
Gladisson Avatar asked Mar 05 '26 16:03

Gladisson


1 Answers

The problem is related to new Protobuf (3.23.X) library. If you want to fix your current version of Firebase without upgrading to the latest one you can pin a previous working version of 'Protobuf' in your Podfile:

...
target 'YourTarget' do
  project 'YourProject'
  ...
  pod 'Protobuf', '= 3.22.1' # Pinned version for Firebase Messaging
end

Then remove Podfile.lock and run pod install.

like image 115
iUrii Avatar answered Mar 07 '26 09:03

iUrii



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!