Comments (50)
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
from react-native-background-geolocation.
debug the app with fake gps data from emulator
I'm usually doing it on real device with Lokito App
from react-native-background-geolocation.
@seanauriti try following:
- remove sqlite dependency from your project -> Libraries -> RCTBackgroundGelocation.xcodeproj
- add libsqlite3.tbd into your project Link Binary With Libraries:
from react-native-background-geolocation.
And if you open sample app in Xcode then libsqlite3.tbd is defined:
- in top level project
Build Phases
Link Binary With Libraries
- in Libraries/RCTBackgroundGeolocation.xcodeproj
Build Phases
Link Binary With Libraries
What @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.
from react-native-background-geolocation.
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')
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
Ok. just sample app has been updated and tested on sim.
from react-native-background-geolocation.
Tested on both Xcode 7.3 and 8.0 and iPhone 6s Plus and iPhone 7 Plus (sim)
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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
from react-native-background-geolocation.
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
from react-native-background-geolocation.
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?
from react-native-background-geolocation.
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
from react-native-background-geolocation.
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
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
Check if getLocations or getValidLocations works
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
It would probably crash. You can try to close app and reopen. On start it calls getLocations to render initial positions from previous run.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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)
...
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
How do you remove them? I have examined that there are several dozens of sqlite3
calls.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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?
from react-native-background-geolocation.
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
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
@priezz genymotion will never work properly with this plugin. I've already explained it to you in #6
from react-native-background-geolocation.
@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.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
@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?
from react-native-background-geolocation.
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.
from react-native-background-geolocation.
When will the pushed fix be merged into master?
from react-native-background-geolocation.
@sdb1228 Thank you so much for making that video! It was clear and straight-forward ๐
from react-native-background-geolocation.
Thanx a lot for your time. The build does not fail anymore, perfect !
from react-native-background-geolocation.
thank you @sdb1228 !
from react-native-background-geolocation.
It seems that adding a 'lsqlite' flag to 'Build Settings -> Linking -> Other Link Flags' solves this problem.
Sent a PR for that
from react-native-background-geolocation.
New Error (same lib)
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?
Full Log
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)
WIP Commit
etaiklein/wandr@777edd8
(note - to run my project you'll need to manually link Mapbox and Push Notifications)
from react-native-background-geolocation.
@etaiklein same here, even after following the video, etc. any luck?
from react-native-background-geolocation.
@mikepaszkiewicz no luck so far. Let me know if you make any progress.
from react-native-background-geolocation.
Has the video stop working? What version of the package are you running?
from react-native-background-geolocation.
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 getPackages() {
return Arrays.asList(
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
from react-native-background-geolocation.
Related Issues (20)
- Background service does not work in SDK 31, app crashes HOT 10
- 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 6
- 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 9
- '/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 6
- 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
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.