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
4
Answers
I have find smth like
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/OSAtomicCompareAndSwapPtrBarrier.3.html
it is very bad idea, but actually it works
You can import at in files with this error and continue work
I have upgraded everything firebase related to the latest version and the error is gone.
Example:
it’s might be incompatible with Protobuf.
maybe you can try to specific another version in Podfile.lock like
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:
Then remove Podfile.lock and run
pod install
.