question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:14

github_iconTop GitHub Comments

3reactions
mika-lindellcommented, Jul 5, 2021

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

3reactions
damiandizeocommented, Nov 20, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve this error? "property with 'retain(or strong ...
It looks like it's caused by recursively including of header files. Try to add @class Project and @class TeamMember into your Task.h, ...
Read more >
iOS getting error RCTBridgeModule.h- Property with 'retain (or ...
iOS getting error RCTBridgeModule.h- Property with 'retain (or strong)' attribute must be of object type #35240.
Read more >
iOS : How to solve this error? "property with 'retain(or strong ...
iOS : How to solve this error? " property with 'retain(or strong )' attribute must be of object type " [ Gift :...
Read more >
Ios – How to solve this error? “property with 'retain(or strong ...
“property with 'retain(or strong)' attribute must be of object type”. iosios4iphoneobjective-c. I have been working on an app all day which has been...
Read more >
Attributes of @property : nonatomic, retain, strong, weak etc..
atomic : Declaring a property atomic makes compiler generate additional code that prevents concurrent access to the object by multiple threads.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found