Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jencircj-developer opened this issue Aug 18, 2020 · 15 comments
Labels
Help Wanted :octocat: Issues ideal for external contributors. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications. Resolution: PR Submitted A pull request with a fix has been provided.

Comments

@jencircj-developer
Copy link

jencircj-developer commented Aug 18, 2020

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.

@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue;

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(R) Core(TM) 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

@safaiyeh
Copy link
Contributor

Hi @JencirJamal could you test this out on v0.63 and provide a repro?

@safaiyeh safaiyeh added Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available and removed Needs: Triage 🔍 labels Aug 18, 2020
@github-actions
Copy link

⚠️ Missing Reproducible Example
ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

@github-actions
Copy link

⚠️ Using Old Version
ℹ️ It looks like you are using an older version of React Native. Please upgrade to the latest version, and verify if the issue persists. If it does not, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the current release.

@jencircj-developer
Copy link
Author

Hi @safaiyeh , I can test it in the latest v0.63 version of react-native, But i guess the bug is still there in this line of code in your repo

@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue;

There is the below PR which was suggested by some other developer who already had this issue 2 years back, he has done the fix for it, But i see the PR is not merged for some reason.
#19479

I guess this issue is mostly faced by developers who created their own Native iOS custom bridge module and integrate to their project. Currently i am working for a big complex project which uses lot of react-native dependencies and recently we migrated from very older version 0.59 to 0.61 and it had a lot of breaking changes in several dependencies and took around 1-2 months to complete the migration. It will take some more time for our team to upgrade the react-native to 0.63 version. Anyways i will check if this issue is present after upgrade and let you know if it still exist.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Aug 19, 2020
@safaiyeh
Copy link
Contributor

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

@sunzhongliangde
Copy link

sunzhongliangde commented Nov 9, 2020

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

@chrisglein
Copy link

Open for someone to rehydrate PR #19479 with a valid CLA and get this addressed.

@chrisglein chrisglein added Resolution: PR Submitted A pull request with a fix has been provided. Help Wanted :octocat: Issues ideal for external contributors. and removed Needs: Attention Issues where the author has responded to feedback. Newer Patch Available labels Nov 13, 2020
@damiandizeo
Copy link

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

@ReynaldoMaciel
Copy link

Same issue here using react-native-ffmpeg dependency

@sasmyk
Copy link

sasmyk commented Dec 15, 2020

Guys, how did you resolve it?)))

@AlkanV
Copy link

AlkanV commented Dec 17, 2020

facing same issue.

@sasmyk
Copy link

sasmyk commented Dec 17, 2020

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'

@mika-lindell
Copy link

mika-lindell commented 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

@arsensgitacc
Copy link

have this issue on 0.70.5

@Saadnajmi
Copy link
Contributor

For what it's worth, I hit this issue while doing some recent work with visoionOS, found this explanation that this can be fixed by setting a proper minimum deployment target, and observe that React Nativedoes so consistently for a couple of versions, so I think this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted :octocat: Issues ideal for external contributors. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications. Resolution: PR Submitted A pull request with a fix has been provided.
Projects
None yet
Development

No branches or pull requests