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

[BUG] Compile error in Swift code #101

Open
mdhaney opened this issue Jan 5, 2022 · 7 comments
Open

[BUG] Compile error in Swift code #101

mdhaney opened this issue Jan 5, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@mdhaney
Copy link

mdhaney commented Jan 5, 2022

Bug

I have read the Troubleshooting page: Yes

Describe the bug
I'm trying to use the library in an Expo project using their EAS build tool (which lets you add third party native modules) and I get the following error while compiling the pod:

Screen Shot 2022-01-05 at 3 39 30 PM

Any idea why I could be getting this error? Do I need to be compiling against a certain version of the iOS APIs or something like that? Thanks for any help, because I really need to get this working.

@mdhaney mdhaney added the bug Something isn't working label Jan 5, 2022
@mrousavy
Copy link
Owner

mrousavy commented Jan 6, 2022

oh, interesting. Does everything work smoothly if you add an override keyword to that function?

@mdhaney
Copy link
Author

mdhaney commented Jan 6, 2022

Thanks for the quick response! I thought of trying what you suggested, but unfortunately there's no easy way for me to make that change. Since I have to use Expo's EAS build, which is a cloud service, the only way I can add modules is through NPM. So for me to test that, I would have to clone, make the change, and publish a private NPM module which I'm not really setup to do.

How hard would it be for you to publish a version with this fix so I can test it? Also, I looked in the logs and noticed it was using version 15 of the the iOS SDK, and version 5.4 of Swift. So maybe you could try a build beforehand using those versions and confirm if you can reproduce the error and if adding the override keyword fixes the problem.

@mc706
Copy link

mc706 commented Jan 9, 2022

I ran into this same issue, and was able to hack together a fix by updating the override keyword and proxying NPM locally with verdaccio

@jeffreyvanhees
Copy link

Same error. Unable to build.

jeffreyvanhees added a commit to jeffreyvanhees/react-native-google-nearby-messages that referenced this issue Mar 7, 2022
@jeffreyvanhees
Copy link

jeffreyvanhees commented May 2, 2022

Any progress on this? More info:

❌  (node_modules/react-native-google-nearby-messages/ios/GoogleNearbyMessages.swift:235:7)

  233 | 	// Called when the UIView gets destroyed (e.g. App reload)
  234 | 	@objc
> 235 | 	func invalidate() {
      | 	     ^ overriding declaration requires an 'override' keyword
  236 | 		print("GNM_BLE: invalidate")
  237 | 		disconnect()
  238 | 	}

[RUN_FASTLANE]
❌  (node_modules/react-native-google-nearby-messages/ios/GoogleNearbyMessages.swift:118:7)

  116 |
  117 | 	@objc(subscribe:rejecter:)
> 118 | 	func subscribe(_ resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) -> Void {
      | 	     ^ method 'subscribe' with Objective-C selector 'subscribe:rejecter:' conflicts with method 'unpublish(_:rejecter:)' with the same Objective-C selector
  119 | 		print("GNM_BLE: Subscribing...")
  120 | 		do {
  121 | 			if (self.messageManager == nil) {
...

@wassgha
Copy link

wassgha commented Jul 31, 2022

same as #105 , issue #105 includes fix

@NiccoloCase
Copy link

@mdhaney Hi, I know that the thread is not very recent, but since I'm trying to implement this package on expo I wonder if you could kindly share the code of the plugin you used.
At the moment I can't even get the library to work on android. In fact, I get the error "Plugin with id 'maven' not found".
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants