I have followed the setup instructions in the readme for IOS and am getting failures when trying to run
I Followed the instructions word for word on the readme of how to set up the project. I have also tried react-native link and can't seem to get it running for IOS
it should run and not fail on compile
it doesn't run
follow steps on readme
I can't use your npm module
The following build commands failed:
Libtool /Users/stevenburnett/Desktop/foo/ios/build/Build/Products/Debug-iphonesimulator/libRCTBackgroundGeolocation.a normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/foo.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/foo.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I have checked this and it does exist it just doesn't like me for some reason.
Some more relevant information.. Actual error from Xcode:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/lib/libsqlite3.tbd (No such file or directory)
I cloned your project. I won't compile - "RCTBundleURLProvider.h not foud"
Did you upgrade react-native version after you created project? If you did upgrade also invoke:
react-native upgrade
so project files are also upgraded and commit changes to repo.
After react-native upgrade your project compiles just fine on XCode 7.3.
Do you overwrite the plist/xcode proj? Because if you do that then the project is no longer linked with your module which would cause it to compile correctly. The steps I have tried have been
npm install
react-native upgrade
and if I override the files then your modules is no longer linked and it compiles correctly. If I then proceed to add your module like instructed on the readme I get
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/lib/libsqlite3.tbd (No such file or directory)
However if I don't override the plist or the .xcodeproj I get the same error.
Outside of your Readme instructions I have tried to use react-native link and ended up with the same error.
generally if you override, you have to redo install instructions again. For some react native upgrades however is ineavitable to override files (and I personally do it for every upgrade or at least check diffs). I'm going to try to upgrade sample app, which project files were not upgraded and see if it works. Wait a minute and then you can try sample app if it will compile on your machine.
Sounds good. I just tried upgrading my project and redoing the install instructions on the Readme and got the same error. I will wait to see if sample app works.
Ok. just sample app has been updated and tested on sim.
Tested on both Xcode 7.3 and 8.0 and iPhone 6s Plus and iPhone 7 Plus (sim)
I just pulled down (https://github.com/mauron85/react-native-background-geolocation-example) and npm installed as well as made sure everything is up to date and I am still getting
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/lib/libsqlite3.tbd (No such file or directory)
I am going to try on another computer with xcode 7.3 (The one I was trying on had 8) to see if its specific to my xcode version.
Same error running on a separate machine running xcode 7.3.1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libsqlite3.tbd (No such file or directory)
It is an odd error because I can see that libsqlite3.tbd is included in the project directory as well as the linked libraries, however it can't seem to find it on either machine I use.
that is strange can you check if libsqlite3.tbd is relative to SDK?
In sample app in Navigator click on libsqlite3.tbd (should not be red colored) and check in Utilities (right bar)
Location: Relative to SDK
Full path: /Users/yourusername/Applications/Xcode7.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/usr/lib/libsqlite3.tbd
It is not red. The Utilities side bar reads as followed:
Location: Relative to SDK
Full Path:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/lib/libsqlite3.tbd
However when I open that file in finder it actually points to
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libsqlite3.tbd
Both have that libsqlite3.tbd file
Ok. Try in terminal:
ls -la /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/lib/libsqlite3.tbd
Does it return file size or file not found?
it returns a file.
stevens-MacBook-Pro:~ stevenburnett$ ls -la /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/lib/libsqlite3.tbd
-rw-r--r-- 1 root wheel 7918 Aug 24 16:03 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/lib/libsqlite3.tbd
Ok, I've no idea then. However I've found two links on stackoverflow:
http://stackoverflow.com/questions/32724799/dylib-file-is-missing
http://stackoverflow.com/questions/37511982/xcode-7-3-1-cant-find-sqlite3-0-lib-despite-the-file-being-where-it-says-it-can
Well I ended up removing the libsqlite3.tbd reference throughout the project and the supporting project and it compile and ran. It asked for location and everything and seems to be working normal. Not sure the purpose of that file, but I assume its important so will try to figure out later why the removal of that file seems to make things work.
Check if getLocations or getValidLocations works
It seems to be working. The example app is tracking my location and I assume if neither of those call backs worked then it wouldn't track me. I will close out this issue when I get a chance to try android.
It would probably crash. You can try to close app and reopen. On start it calls getLocations to render initial positions from previous run.
The libsqlite3.tbd file is in .../iPhoneOS.platform/..., but not in .../iPhoneSimulator.platform/..., that is the problem. Copying the file from iPhoneOS or macOS does not help (gives libsqlite3.tbd is not an object file (not allowed in a library) error). Maybe it would be reasonable to make some check, that if the target is simulator, the file is not required.
Symlinking from dylib like that:
cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/lib/
ln -s libsqlite3.dylib libsqlite3.tbd
does not help:
Undefined symbols for architecture x86_64:
"_sqlite3_bind_blob", referenced from:
-[FMDatabase bindObject:toColumn:inStatement:] in libRCTBackgroundGeolocation.a(FMDB.o)
"_sqlite3_bind_double", referenced from:
-[FMDatabase bindObject:toColumn:inStatement:] in libRCTBackgroundGeolocation.a(FMDB.o)
"_sqlite3_bind_int", referenced from:
-[FMDatabase bindObject:toColumn:inStatement:] in libRCTBackgroundGeolocation.a(FMDB.o)
"_sqlite3_bind_int64", referenced from:
-[FMDatabase bindObject:toColumn:inStatement:] in libRCTBackgroundGeolocation.a(FMDB.o)
"_sqlite3_bind_null", referenced from:
-[FMDatabase bindObject:toColumn:inStatement:] in libRCTBackgroundGeolocation.a(FMDB.o)
"_sqlite3_bind_parameter_count", referenced from:
-[FMDatabase executeQuery:withArgumentsInArray:orDictionary:orVAList:] in libRCTBackgroundGeolocation.a(FMDB.o)
-[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] in libRCTBackgroundGeolocation.a(FMDB.o)
"_sqlite3_bind_parameter_index", referenced from:
-[FMDatabase executeQuery:withArgumentsInArray:orDictionary:orVAList:] in libRCTBackgroundGeolocation.a(FMDB.o)
...
My current work around is to remove all references and add it back into the build settings. That seems to solve the problem and would link it correctly in the project.
How do you remove them? I have examined that there are several dozens of sqlite3 calls.
Oh I miss spoke I don't remove the calls. I remove all the sqlite3 files in the project then add it back in the root of the project. So from RTCBackgroundGeolocation I remove the reference in there as well as at the root of the project and in the linking libraries after removing all of those references I add it back at the root and it seems to work.
It seems I am too dumb at 3 AM and know nothing about ObjC :/ I would appreciate a lot if you provide the commands to reproduce.
All good. I just moved all sqlite3 files to the trash within my project from xcode. So I opened up the project in xcode and expanded each directory and found where there was a sqlite3 file and removed it. In the example app I had to remove it from the root of the app. in /libraries/RTCBackgroundGeolocatoin.xcodeproj I had to remove it from there. And under the root example projects build phases I removed the linked binary under link binary with libraries I then re-added it.
I have found only few *sqlite* files within the project directory:
禄 find . -name '*sqlite*'
./node_modules/react-native-mauron85-background-geolocation/android/lib/build/intermediates/classes/debug/com/marianhello/bgloc/data/sqlite
./node_modules/react-native-mauron85-background-geolocation/android/lib/build/intermediates/classes/release/com/marianhello/bgloc/data/sqlite
./node_modules/react-native-mauron85-background-geolocation/android/lib/src/main/java/com/marianhello/bgloc/data/sqlite
Do they look like those you have deleted?
Both those reference the android library and you need the one referencing the one in IOS xcode project. (.xcodeproj under ios/RNBGExample.xcodeproj) and remove it from there. I am not sure how else to remove them other than through xcode
Strangely, but I can't find no sqlite files in the project tree... So will wait for some solution from @mauron85 . Anyway, thank you, @sdb1228, for your advice and patience.
No problem. I assume you are experiencing the same problem? I can get IOS to run with the example, however I can't get android configured correctly. I have tried setting it myself in my local project and still with no luck.
I am using this module with android (RN 0.33) in the fitness app - it works fine on devices, but does nothing in the emulator (Genymotion). Today I have tried to build the app for iOS and have problems with a few libraries (like this one) in the simulator. I assume that is because of the differences between ARM and x86-64 frameworks.
I hope this behavior could be fixed some day as the RN built-in geolocation works fine in emulators.
And if you open sample app in Xcode then libsqlite3.tbd is defined:
Build Phases Link Binary With LibrariesBuild Phases Link Binary With LibrariesWhat @sdb1228 did, he basically removed both references and added just new one.
My intention was to avoid the need of adding libsqlite3.tbd to your project, but it seems problematic. So I probably remove reference from module and update install instruction that libsqlite3.tbd has to be added to your project.
@priezz genymotion will never work properly with this plugin. I've already explained it to you in #6
@mauron85 , your instruction helped! Now I can compile and run the app.
Edit: It was my problem with calling start(), seems to work properly
genymotion will never work properly with this plugin. I've already explained it to you
Yep, I remember, but still hope you will find some way to let it work there in the future :) I know, it is not just me, who suffer from inability to debug the app with fake gps data from emulator.
debug the app with fake gps data from emulator
I'm usually doing it on real device with Lokito App
If anyone needs a reference on what I did I have a repository set up with just bare bones with the fix @mauron85 mentioned above https://github.com/sdb1228/RNbackgroundLocationTest. Removing and readding that file does the trick.
Hi there,
I tried to install your package on ios by following step by step your documentation and I had the following error during my build :
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/lib/libsqlite3.tbd is not an object file (not allowed in a library)
I tought that might be related to this ?
I precise that my device is running on iOs10.
@Okipa Have you tried the steps I did above? Removing the libsqlite3.tbd file and adding it to your project yourself? it also looks like @mauron85 closed an issue 6 days ago with that same error. May want to check there?
I'm sorry, I'm a bit confused (I'm quite new to react-native and XCode).
Would you mind to explain how you managed to remove the libsqlite3.tbd files and how you did add it on the project after that ? I'm looking into it but I'm not sure how to do that.
When will the pushed fix be merged into master?
okay @Okipa and @4ware I posted a video of my workaround. Basically how to get the project up and running with the current master. I will submit a pull request and an update to the readme when I get a chance, but for now please see https://www.youtube.com/watch?v=ZUu-yzhAaFY&feature=youtu.be
I apologize in advance that video quality is awful
@sdb1228 Thank you so much for making that video! It was clear and straight-forward 馃槃
Thanx a lot for your time. The build does not fail anymore, perfect !
thank you @sdb1228 !
It seems that adding a 'lsqlite' flag to 'Build Settings -> Linking -> Other Link Flags' solves this problem.
Sent a PR for that
I adding libsqlite3.tbd to both the top-level and RNBG-level libraries and added the '-sqlite' flag.
As a reward, my error has upgraded
from libsqlite3.tbd (No such file or directory)
to libsqlite3.tbd is not an object file (not allowed in a library)
any ideas?
Libtool /Users/etaiklein/Library/Developer/Xcode/DerivedData/wandr2-awjeoprrrxedjdeszukbnsxpbhji/Build/Products/Debug-iphonesimulator/libRCTBackgroundGeolocation.a normal x86_64
cd /Users/etaiklein/Code/wandr2/node_modules/react-native-mauron85-background-geolocation/ios
export IPHONEOS_DEPLOYMENT_TARGET=9.3
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.1.sdk -L/Users/etaiklein/Library/Developer/Xcode/DerivedData/wandr2-awjeoprrrxedjdeszukbnsxpbhji/Build/Products/Debug-iphonesimulator -filelist /Users/etaiklein/Library/Developer/Xcode/DerivedData/wandr2-awjeoprrrxedjdeszukbnsxpbhji/Build/Intermediates/RCTBackgroundGeolocation.build/Debug-iphonesimulator/RCTBackgroundGeolocation.build/Objects-normal/x86_64/RCTBackgroundGeolocation.LinkFileList /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libsqlite3.tbd -weak_framework UIKit -framework CoreLocation -o /Users/etaiklein/Library/Developer/Xcode/DerivedData/wandr2-awjeoprrrxedjdeszukbnsxpbhji/Build/Products/Debug-iphonesimulator/libRCTBackgroundGeolocation.a
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libsqlite3.tbd is not an object file (not allowed in a library)
https://github.com/etaiklein/wandr/commit/777edd8e0bb80942a29a9735f7289c943ed99d30
(note - to run my project you'll need to manually link Mapbox and Push Notifications)
@etaiklein same here, even after following the video, etc. any luck?
@mikepaszkiewicz no luck so far. Let me know if you make any progress.
Added an additional $20
http://coderbounty.com/issue/78
@seanauriti try following:


Has the video stop working? What version of the package are you running?
Hi,
I have done react-native setup and have successfully running other android react-native apps.
But In my react-native project, I just insalled npm install react-native-mauron85-background-geolocation --save
then added as below
In android/settings.gradle
include ':react-native-mauron85-background-geolocation', ':app'
project(':react-native-mauron85-background-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mauron85-background-geolocation/android')
In android/app/build.gradle
dependencies {
...
compile project(':react-native-mauron85-background-geolocation')
...
}
Registered Module in MainApplication.java
import com.marianhello.react.BackgroundGeolocationPackage; // <--- Import Package
@Override
protected List
return Arrays.
new MainReactPackage(),
new BackgroundGeolocationPackage() // <---- Add the Package
);
}
then I ran react-native run-android, it fails with below error
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApk'.
Configuration with name 'default' not found.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 5.074 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
Can you please help understand whats wrong
I am now running into the same issue as @satishmane any suggestions on how to fix this?
Hi,
please edit settings.gradle under android and add /lib folder after as below
include ':app',':react-native-mauron85-background-geolocation'
project(':react-native-mauron85-background-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mauron85-background-geolocation/android/lib')
Most helpful comment
okay @Okipa and @4ware I posted a video of my workaround. Basically how to get the project up and running with the current master. I will submit a pull request and an update to the readme when I get a chance, but for now please see https://www.youtube.com/watch?v=ZUu-yzhAaFY&feature=youtu.be
I apologize in advance that video quality is awful