I have the same error with .podspec with command
pod spec lint
When I run my project with Xcode or with command
npx react-native run-android
all it works.
My version of react native is 0.76.2