react-native: ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:132:1: Property with 'retain (or strong)' attribute must be of object type

iOS Xcode build fails with this Syntax error “ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:132:1: Property with ‘retain (or strong)’ attribute must be of object type

Description

I am using this RCTBridgeModule to create my own custom bridge module for one of my application. Recently i migrated the app to latest react-native version 0.61.5. Now the iOS xcode build and react-native run ios command build gives me the error “ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:132:1: Property with ‘retain (or strong)’ attribute must be of object type”. The build works fine when i removed the strong keyword from this line below. The strong or retain keyword is not required here as i see the variable methodQueue here is not an object. https://github.com/facebook/react-native/blob/75a617827963fd53f5f36987677a992e137eaebf/React/Base/RCTBridgeModule.h#L146

See this link for more details on declaring dispatch_queue as a property after ARC - https://stackoverflow.com/questions/8904206/what-property-should-i-use-for-a-dispatch-queue-after-arc

React Native version:

info Fetching system and libraries information… System: OS: macOS 10.15.2 CPU: (8) x64 Intel® Core™ i7-7820HQ CPU @ 2.90GHz Memory: 2.77 GB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.14.1 - /usr/local/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 Android SDK: API Levels: 23, 25, 26, 28, 29 Build Tools: 28.0.3, 29.0.2 System Images: android-28 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.6 AI-192.7142.36.36.6392135 Xcode: 11.6/11E708 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5 npmGlobalPackages: react-native-cli: 2.0.1

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Use RCTBridgeModule to create some custom bridge module for a react-native application
  2. Build the iOS project after integrating the above custom module
  3. Xcode build fails with above syntax error

Expected Results

Xcode build should work fine without any syntax error

Snack, code example, screenshot, or link to a repository:

Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Was able to fix this by making sure platforms is defined in podspec of your custom native dependencies. For example:

s.platforms = { :ios => "11.0" }

https://stackoverflow.com/q/19404328 https://stackoverflow.com/questions/8618632/does-arc-support-dispatch-queues

Same issue here, using react-native-ffmpeg dependency which latest require development target iOS 11+, and since updated this I’m having this problem!!

have this issue on 0.70.5

facing same issue.

In my case it was because on a new lib added. It was ffmpeg, so i fixed it by updating Pods with pod 'react-native-ffmpeg/full', :path => '../node_modules/react-native-ffmpeg'

the ios podspec file need add s.platform = :ios, "9.0" like this; if you don’t add this line , has Property with 'retain (or strong)' attribute must be of object type error

Appreciate it, it looks like that PR needs to be reopened for discussion as the submitter didn’t sign the CLA.