Git Product home page Git Product logo

Comments (22)

dorthwein avatar dorthwein commented on July 16, 2024

same issue - any solutions?

from react-native-background-geolocation.

UrbanSam avatar UrbanSam commented on July 16, 2024

@dorthwein Was the possible fix helps?

from react-native-background-geolocation.

dorthwein avatar dorthwein commented on July 16, 2024

@UrbanSam negative ghost ride - no luck. It ended up causing several other bugs/things not loading.

Honestly, I went with another package. I'd prefer to use this one as there isn't a license fee for android, but such is life.

from react-native-background-geolocation.

UrbanSam avatar UrbanSam commented on July 16, 2024

@dorthwein What others bug came up? And which RN were you on?
Here's a example of lines to remove.

#if __has_include("RCTBridge.h") <!--- remove this
#import "RCTBridge.h" <!--- remove this
#else <!--- remove this
#import <React/RCTBridge.h>
#endif <!--- remove this

from react-native-background-geolocation.

mauron85 avatar mauron85 commented on July 16, 2024

@UrbanSam this brings me nothing but tears, as your changes are actually reverting what I did in last commit. What version is your RN lib?

from react-native-background-geolocation.

UrbanSam avatar UrbanSam commented on July 16, 2024

@mauron85 0.41.2

from react-native-background-geolocation.

mauron85 avatar mauron85 commented on July 16, 2024

Can you test on a clean project? Maybe you have duplicate files left by upgrade mechanism or something...

Or at least remove/reinstall react-native lib.
Or check manually on *nix system with find.

from within your app dir:

find node_modules/ -name RCTBridge*

and post output

from react-native-background-geolocation.

UrbanSam avatar UrbanSam commented on July 16, 2024

I tried with new project with RN 0.41.2, it still the same issue.

Here's the result you need, I use sublime to find in folder node_module
searchResult.txt

from react-native-background-geolocation.

UrbanSam avatar UrbanSam commented on July 16, 2024

Hi, by switching the if statement to check <React/RCTBridge.h> instead, seem to able to fix it as well.
I'm able to build with this line below

#if __has_include(<React/RCTBridge.h>)
#import <React/RCTBridge.h>
#else
#import "RCTBridge.h"
#endif

from react-native-background-geolocation.

mauron85 avatar mauron85 commented on July 16, 2024

Sorry can u post result of find not grep. (I've updated instructions)

from react-native-background-geolocation.

UrbanSam avatar UrbanSam commented on July 16, 2024

node_modules//react-native/React/Base/RCTBridge+Private.h
node_modules//react-native/React/Base/RCTBridge.h
node_modules//react-native/React/Base/RCTBridge.m
node_modules//react-native/React/Base/RCTBridgeDelegate.h
node_modules//react-native/React/Base/RCTBridgeMethod.h
node_modules//react-native/React/Base/RCTBridgeModule.h

from react-native-background-geolocation.

mauron85 avatar mauron85 commented on July 16, 2024

That is kind of interesting. Trying to figure out where is the catch.

"RCTBridge.h" is old path pre RN 0.40
<React/RCTBridge.h> is new path RN 0.40 and newer

So let's think how does if else work here.

In pre RN 0.40:

#if __has_include(<React/RCTBridge.h>) // should be FALSE (I guess)
#import <React/RCTBridge.h>
#else
#import "RCTBridge.h" // so will use old path
#endif

in RN 0.40:
#if __has_include(<React/RCTBridge.h>) // should be TRUE
#import <React/RCTBridge.h> // should use this one
#else
#import "RCTBridge.h"
#endif

So what I'm missing? No clue.

from react-native-background-geolocation.

mauron85 avatar mauron85 commented on July 16, 2024

Doesn't make sense for me at all (as I'm not macro expert), but microsoft guys did same thing as you @UrbanSam.

https://github.com/Microsoft/react-native-code-push/pull/678/files#diff-44a84efa8cad867f5ca85f13ab8c5abd

from react-native-background-geolocation.

mauron85 avatar mauron85 commented on July 16, 2024

@UrbanSam can you make PR? Will appreciate.

from react-native-background-geolocation.

UrbanSam avatar UrbanSam commented on July 16, 2024

@mauron85 I have made a PR #51

from react-native-background-geolocation.

ilyadoroshin avatar ilyadoroshin commented on July 16, 2024

having the same issue.. "Duplicate interface definition for class 'RCTBridge'"

$ find node_modules/ -name RCTBridge*: 
node_modules/react-native/React/Base/RCTBridge+Private.h
node_modules/react-native/React/Base/RCTBridge.h
node_modules/react-native/React/Base/RCTBridge.m
node_modules/react-native/React/Base/RCTBridgeDelegate.h
node_modules/react-native/React/Base/RCTBridgeMethod.h
node_modules/react-native/React/Base/RCTBridgeModule.h
node_modules/react-native-barcode-builder/Example/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTBridge.d
node_modules/react-native-barcode-builder/Example/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTBridge.dia
node_modules/react-native-barcode-builder/Example/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTBridge.o
node_modules/react-native-barcode-builder/Example/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/StaticAnalyzer/React/React/normal/x86_64/RCTBridge.d
node_modules/react-native-barcode-builder/Example/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/StaticAnalyzer/React/React/normal/x86_64/RCTBridge.plist
node_modules/react-native-global-props/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTBridge.d
node_modules/react-native-global-props/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTBridge.dia
node_modules/react-native-global-props/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTBridge.o
node_modules/react-native-global-props/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/StaticAnalyzer/React/React/normal/x86_64/RCTBridge.d
node_modules/react-native-global-props/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/StaticAnalyzer/React/React/normal/x86_64/RCTBridge.plist

Removing the following from RCTBackgroundGeolocation.m fixes it for me:

#if __has_include("RCTBridge.h")
#import "RCTBridge.h"
#else
#import <React/RCTBridge.h>
#endif

any thoughts?

from react-native-background-geolocation.

ilyadoroshin avatar ilyadoroshin commented on July 16, 2024

looks like RCTBridge is already imported in RN 0.40 in RCTEventDispatcher.h..

from react-native-background-geolocation.

mauron85 avatar mauron85 commented on July 16, 2024

@ilyadoroshin nice, that is indeed the root of all problems. They don't have any #ifndef guard, so RCTBridge is imported twice.

I'll probably report this to react-native team (I guess).

Anyway RCTBridge.h import can be safely removed.

from react-native-background-geolocation.

mauron85 avatar mauron85 commented on July 16, 2024

The only question in mind left is, how come change of ordering like done @UrbanSam solved this issue too.

from react-native-background-geolocation.

ilyadoroshin avatar ilyadoroshin commented on July 16, 2024

@mauron85 it's all some deep-deep black magic for me, since I'm just js-developer :) wandering in the dark, removing this and that, and somehow it works.. no time to dig deeper. Tell me if you need any help to reproduce or any other data.

And thanks a bunch for such a brilliant package! 👍

from react-native-background-geolocation.

UrbanSam avatar UrbanSam commented on July 16, 2024

@mauron85 hmm i'm not really sure about this as well, I'm just like @ilyadoroshin say.
But I assume it check for the path of the file exist, assuming Pre RN 0.40 would not have the file path to <React/RCTBrdige.h>, so it would make sense to import "RCTBridge.h", else import it as <React/RCTBrdige.h>.

from react-native-background-geolocation.

mauron85 avatar mauron85 commented on July 16, 2024

Should be fixed in alpha.7. Feel free to reopen if issue still persists.

from react-native-background-geolocation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.