Comments (22)
same issue - any solutions?
from react-native-background-geolocation.
@dorthwein Was the possible fix helps?
from react-native-background-geolocation.
@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.
@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.
@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.
@mauron85 0.41.2
from react-native-background-geolocation.
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.
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.
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.
Sorry can u post result of find not grep. (I've updated instructions)
from react-native-background-geolocation.
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.
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.
Doesn't make sense for me at all (as I'm not macro expert), but microsoft guys did same thing as you @UrbanSam.
from react-native-background-geolocation.
@UrbanSam can you make PR? Will appreciate.
from react-native-background-geolocation.
@mauron85 I have made a PR #51
from react-native-background-geolocation.
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.
looks like RCTBridge is already imported in RN 0.40 in RCTEventDispatcher.h..
from react-native-background-geolocation.
@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.
The only question in mind left is, how come change of ordering like done @UrbanSam solved this issue too.
from react-native-background-geolocation.
@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.
@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.
Should be fixed in alpha.7. Feel free to reopen if issue still persists.
from react-native-background-geolocation.
Related Issues (20)
- Foreground service notification appears with delay 10s in Android 12 (SDK 31) HOT 2
- invalid null provider error on start HOT 1
- FAILURE: Build completed with 2 failures. after installation of module HOT 3
- Build Failed while using this package. Sometimes it works fine but sometime the build fails HOT 4
- Context.startForegroundService() did not then call Service.startForeground() HOT 3
- The time interval is not working properly. I want to get a call in 10 minutes
- Could not find ::. Required by: project :app HOT 7
- Getting error running the project after installing the library HOT 5
- SDK 31 - Android 12 specify an explicit value for `android:exported` HOT 13
- No variants found for ':mauron85_react-native-background-geolocation'. Check build files to ensure at least one variant exists.
- Execution failed for task ':@mauron85_react-native-background-geolocation-common:compileDebugJavaWithJavac'. HOT 11
- '/Volumes/Untitled2/projects/agrigator/project/node_modules/@mauron85/react-native-background-geolocation/android/lib/build.gradle' line: 62
- Getting issue in fetching location when device screen is locked Android HOT 7
- Error build android: Could not resolve all files for configuration HOT 1
- :@hariks789_react-native-background-geolocation-common:compileReleaseJavaWithJavac'. > Compilation failed; see the compiler error output for details. HOT 7
- Whether support Android without Google Play Service installed
- Task :@mauron85_react-native-background-geolocation:generateDebugBuildConfig FAILED
- Not working in Android 12, API 31 and above HOT 3
- Not working on IOS 17.5.1
- ### Build Failure due to Deprecated `package` Attribute in AndroidManifest.xml
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-background-geolocation.