agontuk / react-native-geolocation-service Goto Github PK
View Code? Open in Web Editor NEWReact native geolocation service for iOS and android
Home Page: https://www.npmjs.com/package/react-native-geolocation-service
License: MIT License
React native geolocation service for iOS and android
Home Page: https://www.npmjs.com/package/react-native-geolocation-service
License: MIT License
I am building tracking app I need to watch location after moving atleast 5 meter. It should not be dependent upon time. So don't want to get my location after some interval of time, i just want when user moves 5 meters. For this I am using these options, but it send me location even I am on asame place.
Please check this code:
startWatchLocation() {successCallback, ?errorCallback, ?options}
here my ?options are :::
{
enableHighAccuracy: true,
distanceFilter: 5,
interval: 0,
fastestInterval: 0,
showLocationDialog: true
}
Please suggest me what should be the options value according to my requirement.
I add ' compile project(':react-native-geolocation-service') ' to build.gradle,
I am still having this error.It is working fine in emulator.Tested in android 8 general mobile gm5 plus
I have not installed yarn please add it to npm
The location request running until timeout in Android 7, 7.1. Android 8 works, Android 6 works.
Issue Description::
I am working on react native tracking application. Basically users check in from a certain place and they need to reach at the destination. Using this application we are finding out the path they are following. I need to get a geocodes from users check in location to destination to track the path he is following.
Now it builds a clean path in case of Android device, but having an issue with ios. For ios it takes a huge variation inside code.
I have tested this by traveling to same place using both devices(ios and android). For Android it's generates a exact latitude longitude values, but for ios there is a huge variation. Why this is happening. I have followed the official doc of react native for geolocation setup.
You can check this link:: https://facebook.github.io/react-native/docs/geolocation.html#ios
This is happening when I have updated react native version to 0.58
Environment I am using ::
React Native: 0.58
react-native-geolocation-service: 2.0.0
Geolocation.clearWatch(this.watchId);
this code is not working.
I am trying to generate a signed apk and upgraded gradle.
Now am getting the following error on this package.
> Task :react-native-geolocation-service:compileReleaseJavaWithJavac
/Users/germanazo/Projects/myproject/client/node_modules/react-native-geolocation-service/android/src/main/java/com/agontuk/RNFusedLocation/RNFusedLocationModule.java:13: error: cannot find symbol
import com.facebook.react.bridge.BaseActivityEventListener;
^
symbol: class BaseActivityEventListener
location: package com.facebook.react.bridge
/Users/germanazo/Projects/myproject/client/node_modules/react-native-geolocation-service/android/src/main/java/com/agontuk/RNFusedLocation/RNFusedLocationModule.java:67: error: cannot find symbol
private final ActivityEventListener mActivityEventListener = new BaseActivityEventListener() {
^
symbol: class BaseActivityEventListener
location: class RNFusedLocationModule
2 errors
In iOS, using the example here https://github.com/Agontuk/react-native-geolocation-service/blob/master/example/App.js, I constantly get -1
returned for both speed
and heading
. This never changes, even when travelling.
Is there something I did incorrectly in setup?
react-native-geolocation-service: 1.1.0
react-native: 0.56.0
Apparently the Geolocation object for me is undefined. I followed the instructions for setting up for android, and I don't have this issue when running ios
I added the following dep because I'm still figuring out how to add project wide properties (always causing me more error that I barely understand):
compile(project(':react-native-geolocation-service')) {
exclude group: 'com.google.android.gms', module: 'play-services-location'
}
compile 'com.google.android.gms:play-services-location:15.0.1'
and I used 15.0.1 because I'm also using firebase messaging which requires me to put this:
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-messaging:17.1.0"
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
in dependencies
and this on the bottom of app level gradle:
apply plugin: 'com.google.gms.google-services'
with that, I'm getting this error:
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 11.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Do u have any suggestion as to what kind of config that would let ur lib to work with this situation?
I'm pretty new with this (managing dependencies manually), so any help would be great ๐
Thanks in advance for trying to solve RN navigator.geolocation issue :)
Log from Crashlytics:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Activity.startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int)' on a null object reference
at com.google.android.gms.common.api.Status.startResolutionForResult(Unknown Source)
at com.google.android.gms.common.api.ResolvableApiException.startResolutionForResult(Unknown Source)
at com.agontuk.RNFusedLocation.RNFusedLocationModule.onComplete(RNFusedLocationModule.java:127)
at com.google.android.gms.tasks.zzf.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Google Play Services: On
Wifi: On
Android 7.0.
Galaxy S6 Edge+.
User had version 1.0.3 of react-native-geolocation-service.
FYI: Users on my latest version have 1.0.4 of react-native-geolocation-service.
Hello,
First of all thank you so much for this awesome plugin for android as I was dealing with timeout problem with navigator.geolocation.
As you are using this condition in your example Platform.Version < 23
so what is that mean? Is there any limitation for this plugin? I am not an android developer but learning react native so could you please explain this.
thank you in advance.
If they have location on their device set to gps only, would it be possible/desirable to use gps and not prompt them to enable location even if enableHighAccuracy = false?
Like if they have location turned off, always prompt, if on, then use low accuracy, but if on and set to gps only, then just use gps and don't prompt?
Possibility am unclear on how this differs from built-in geolocation, but am trying to achieve reliable location, and do want to prompt if they're someone who only enables location from the status bar when needed, but also avoid unnecessarily requiring them to give their location to google if they've explicitly chosen not too.
Make location dialog optional.
Geolocation.getCurrentPosition(
(success) => {},
(error) => {},
{ enableHighAccuracy: true, showLocationDialog: false }
);
When I try to upgrade com.google.gms:google-services
from 3.2.1
to 3.3.0
it gives these errors:
More than one variant of project :react-native-geolocation-service matches the consumer attributes:
- Configuration ':react-native-geolocation-service:debugApiElements' variant android-aidl:
- Found artifactType 'android-aidl' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':react-native-geolocation-service:debugApiElements' variant android-classes:
- Found artifactType 'android-classes' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':react-native-geolocation-service:debugApiElements' variant android-manifest:
- Found artifactType 'android-manifest' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':react-native-geolocation-service:debugApiElements' variant android-renderscript:
- Found artifactType 'android-renderscript' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':react-native-geolocation-service:debugApiElements' variant jar:
- Found artifactType 'jar' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
What to do?
HI, thanks for your repo. I am happy with this, but just have some issues.
Even I don't move phone, I am getting heading and speed value as random value.
And one more question. I think this may be stupid.
Regarding heading value. is this bearing?
Thanks a lot.
I am sharing some logs here.
08-04 06:33:56.797 12404 12605 I ReactNativeJS: 175.67702362167088
08-04 06:33:59.812 12404 12605 I ReactNativeJS: -------update timer--------
08-04 06:33:59.812 12404 12605 I ReactNativeJS: { mocked: false,
08-04 06:33:59.812 12404 12605 I ReactNativeJS: timestamp: 1533339239795,
08-04 06:33:59.812 12404 12605 I ReactNativeJS: coords:
08-04 06:33:59.812 12404 12605 I ReactNativeJS: { speed: 0.15508875250816345,
08-04 06:33:59.812 12404 12605 I ReactNativeJS: heading: 355,
08-04 06:33:59.812 12404 12605 I ReactNativeJS: accuracy: 10,
08-04 06:33:59.812 12404 12605 I ReactNativeJS: longitude: 102.6415833,
08-04 06:33:59.812 12404 12605 I ReactNativeJS: altitude: 168.32766951579003,
08-04 06:33:59.812 12404 12605 I ReactNativeJS: latitude: 17.9826499 } }
08-04 06:33:59.812 12404 12605 I ReactNativeJS: 144.8435785981375
08-04 06:34:02.848 12404 12605 I ReactNativeJS: -------update timer--------
08-04 06:34:02.849 12404 12605 I ReactNativeJS: { mocked: false,
08-04 06:34:02.849 12404 12605 I ReactNativeJS: timestamp: 1533339242828,
08-04 06:34:02.849 12404 12605 I ReactNativeJS: coords:
08-04 06:34:02.849 12404 12605 I ReactNativeJS: { speed: 0,
08-04 06:34:02.849 12404 12605 I ReactNativeJS: heading: 0,
08-04 06:34:02.849 12404 12605 I ReactNativeJS: accuracy: 12.071999549865723,
08-04 06:34:02.849 12404 12605 I ReactNativeJS: longitude: 102.6415719,
08-04 06:34:02.849 12404 12605 I ReactNativeJS: altitude: 167.7569680554231,
08-04 06:34:02.849 12404 12605 I ReactNativeJS: latitude: 17.9826675 } }
08-04 06:34:02.849 12404 12605 I ReactNativeJS: 67.94417376289368
08-04 06:34:05.863 12404 12605 I ReactNativeJS: -------update timer--------
08-04 06:34:05.864 12404 12605 I ReactNativeJS: { mocked: false,
08-04 06:34:05.864 12404 12605 I ReactNativeJS: timestamp: 1533339245841,
08-04 06:34:05.864 12404 12605 I ReactNativeJS: coords:
08-04 06:34:05.864 12404 12605 I ReactNativeJS: { speed: 0,
08-04 06:34:05.864 12404 12605 I ReactNativeJS: heading: 0,
08-04 06:34:05.864 12404 12605 I ReactNativeJS: accuracy: 13.942999839782715,
08-04 06:34:05.864 12404 12605 I ReactNativeJS: longitude: 102.6415758,
08-04 06:34:05.864 12404 12605 I ReactNativeJS: altitude: 167.5328005358987,
08-04 06:34:05.864 12404 12605 I ReactNativeJS: latitude: 17.9827 } }
08-04 06:34:05.864 12404 12605 I ReactNativeJS: 157.25653319482475
08-04 06:34:08.887 12404 12605 I ReactNativeJS: -------update timer--------
08-04 06:34:08.889 12404 12605 I ReactNativeJS: { mocked: false,
08-04 06:34:08.889 12404 12605 I ReactNativeJS: timestamp: 1533339248868,
08-04 06:34:08.889 12404 12605 I ReactNativeJS: coords:
08-04 06:34:08.889 12404 12605 I ReactNativeJS: { speed: 0.29819566011428833,
08-04 06:34:08.889 12404 12605 I ReactNativeJS: heading: 349,
08-04 06:34:08.889 12404 12605 I ReactNativeJS: accuracy: 14.440999984741211,
08-04 06:34:08.889 12404 12605 I ReactNativeJS: longitude: 102.6415497,
08-04 06:34:08.889 12404 12605 I ReactNativeJS: altitude: 167.5163922326466,
08-04 06:34:08.889 12404 12605 I ReactNativeJS: latitude: 17.9827577 } }
08-04 06:34:08.889 12404 12605 I ReactNativeJS: -175.5590839504895
08-04 06:34:11.890 12404 12605 I ReactNativeJS: -------update timer--------
08-04 06:34:11.891 12404 12605 I ReactNativeJS: { mocked: false,
08-04 06:34:11.891 12404 12605 I ReactNativeJS: timestamp: 1533339251882,
08-04 06:34:11.891 12404 12605 I ReactNativeJS: coords:
08-04 06:34:11.891 12404 12605 I ReactNativeJS: { speed: 0.34035244584083557,
08-04 06:34:11.891 12404 12605 I ReactNativeJS: heading: 336,
08-04 06:34:11.891 12404 12605 I ReactNativeJS: accuracy: 14.642000198364258,
My use of Geolocation
new Promise((resolve, reject) =>
Geolocation.getCurrentPosition(
result => resolve(result.coords),
reject,
{enableHighAccuracy : true, maximumAge: 1000}
)
)
When the maximumAge
option is set, the module throw the following error:
The callback getCurrentPosition() exists in module RNFusedLocation, but only one callback may be registered to a function in a native module.
I'm using the watchPosition event but it isn't work very well. I need an actualitations real time for search elements on the street, but watchPosition gives me info each 10 secong. How do I make it faster?
this.watchID = Geolocation.watchPosition(
position => {
this.findElmentsByLocation(position.coords);
},
error => {
// eslint-disable-next-line
console.log('ERROR IN watchPosition: ', error);
},
{
enableHighAccuracy: true,
distanceFilter: 0,
interval: 2000,
fastestInterval: 2000
}
);
FATAL EXCEPTION: Thread-6
08-10 07:47:38.939 24097 24137 E AndroidRuntime: Process: com.pack, PID: 24097
08-10 07:47:38.939 24097 24137 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;
08-10 07:47:38.939 24097 24137 E AndroidRuntime: at com.google.android.gms.location.LocationServices.<clinit>(Unknown Source)
08-10 07:47:38.939 24097 24137 E AndroidRuntime: at com.google.android.gms.location.LocationServices.getFusedLocationProviderClient(Unknown Source)
08-10 07:47:38.939 24097 24137 E AndroidRuntime: at com.agontuk.RNFusedLocation.RNFusedLocationModule.<init>(RNFusedLocationModule.java:96)
08-10 07:47:38.939 24097 24137 E AndroidRuntime: at com.agontuk.RNFusedLocation.RNFusedLocationPackage.createNativeModules(RNFusedLocationPackage.java:26)
08-10 07:47:38.939 24097 24137 E AndroidRuntime: at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:106)
08-10 07:47:38.939 24097 24137 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1191)
08-10 07:47:38.939 24097 24137 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1161)
08-10 07:47:38.939 24097 24137 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1094)
ANy idea how to solve this? I suspect this is because I am somehow using other versions of the google services library.. but i could use some guidance as to why this happens
when netWork is offline it can not getPosition just show Location request time out
I'm working on a large react-native app with some legacy code in it from previous developers. Originally, we were using react-native's default geolocation which was slow on android/would timeout, but mostly worked.
As part of our backend api, we need to send up to date geolocation data on each request we make to our server, so we wrote a middleware that would automatically query for our location, and merge it into our request headers with the react-native navigator.geolocation API.
To speed things up, we researched, and found this package, and implemented it. We saw a 100% improvement in geolocation on android, which brought it up to par with the speeds we were seeing on Android, so huge thanks for your work and integration.
However, we found a bug. We have a part of our app that did a Promise.all([request1, request2])
, which consistently only let one request through. After some investigation, we realized it was geolocation that was preventing then second query.
I'm not familiar enough with Android development, or the fused location service, but I'm guessing there is some unhandled error here. We fixed it on our javascript side by storing the current geolocation queries promise, and clearing it after the query is complete. Then if another parallel geolocation request comes it, we reuse the query promise if it is available.
Ultimately, I'm not sure if there is a fix for this on the java side, or if at least the documentation for this package could make a note on parallel requests.
I noted that in the README, implementing watchPosition
was marked as a TODO. When I tried implmenting it, i get a type error:
Cannot read property 'startObserving' of undefined
react-native: "0.55.4"
react-native-geolocation-service": "^1.1.0",
I was wondering if this feature was still in the works or if I could potentially be configuring the library wrong?
So I have 2 pages in my app, A is a list of locations user can check into and B is the page that will ask for user's Geolocation from your lib.
If I use the app normally it's fine 90% of the time (sometimes it still gives me this error, but less likely). But if I go back and forth between page A and B rapidly for different checkin locations, it will sometimes give me this:
{message: "Location request timed out.", code: 3}
I'm using your library like this:
if (Platform.OS === 'android') {
if (Platform.Version >= 23)
PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION).then((permission) => {
if (permission === PermissionsAndroid.RESULTS.GRANTED)
Geolocation.getCurrentPosition((location) => {
var dist = distanceInKm(location.coords.latitude, location.coords.longitude, this.props.location.lat, this.props.location.long) * 1000 //in meters
if (this.mounted)
this.setState({ lat: location.coords.latitude, long: location.coords.longitude, dist, isMock: location.mocked, permission: true });
}, (error) => console.log(error), { enableHighAccuracy: true, timeout: 3000, maximumAge: 3600000 });
else if (permission === PermissionsAndroid.RESULTS.NEVER_ASK_AGAIN || permission === PermissionsAndroid.RESULTS.DENIED)
Alert.alert('Geolocation Permission Denied', 'Please change your device\'s location permission settings in order to use this app');
}).catch((error) => Alert.alert(error.message, 'Please update your device\'s settings in order to use this app'));
else
Geolocation.getCurrentPosition((location) => {
var dist = distanceInKm(location.coords.latitude, location.coords.longitude, this.props.location.lat, this.props.location.long) * 1000 //in meters
if (this.mounted)
this.setState({ lat: location.coords.latitude, long: location.coords.longitude, dist, isMock: location.mocked, permission: true });
}, (error) => Alert.alert(error.message, 'Please update your device\'s settings in order to use this app'), { enableHighAccuracy: true, timeout: 3000, maximumAge: 3600000 });
}
else { //for IOS
Geolocation.getCurrentPosition((location) => {
var dist = distanceInKm(location.coords.latitude, location.coords.longitude, this.props.location.lat, this.props.location.long) * 1000 //in meters
if (this.mounted)
this.setState({ lat: location.coords.latitude, long: location.coords.longitude, dist, permission: true });
}, (error) => Alert.alert(error.message, 'Please update your device\'s settings in order to use this app'), { enableHighAccuracy: true, timeout: 3000, maximumAge: 3600000 });
}
and only testing on Android simulator so far, haven't gotten a test device yet.
Just want to know If I missed anything. i.e. Do I have to terminate the operation altogether when I leave page B or something similar?
Thanks in advance! ๐
After all setup I have this issue::
> TypeError: Cannot read property 'getCurrentPosition' of undefined
> at Object.getCurrentPosition$ (blob:http://localhost:8081/0786bd13-e17c-404e-8e19-b46bdfbaf7f3:162211:33)
> at tryCatch (blob:http://localhost:8081/0786bd13-e17c-404e-8e19-b46bdfbaf7f3:21370:19)
> at Generator.invoke [as _invoke] (blob:http://localhost:8081/0786bd13-e17c-404e-8e19-b46bdfbaf7f3:21543:24)
> at Generator.prototype.(anonymous function) [as next] (blob:http://localhost:8081/0786bd13-e17c-404e-8e19-b46bdfbaf7f3:21413:23)
> at tryCatch (blob:http://localhost:8081/0786bd13-e17c-404e-8e19-b46bdfbaf7f3:21370:19)
> at invoke (blob:http://localhost:8081/0786bd13-e17c-404e-8e19-b46bdfbaf7f3:21446:22)
> at blob:http://localhost:8081/0786bd13-e17c-404e-8e19-b46bdfbaf7f3:21474:13
> at tryCallTwo (blob:http://localhost:8081/0786bd13-e17c-404e-8e19-b46bdfbaf7f3:20708:7)
> at doResolve (blob:http://localhost:8081/0786bd13-e17c-404e-8e19-b46bdfbaf7f3:20872:15)
> at new Promise (blob:http://localhost:8081/0786bd13-e17c-404e-8e19-b46bdfbaf7f3:20731:5)
Steps I have followed::
After these I have installed "react-native-geolocation-service" package
Link this package
I have followed all the Android settings.
Import in file like this:: import Geolocation from "react-native-geolocation-service";
Function where I used it::
getLocation() {
Geolocation.getCurrentPosition(response => {
console.log("geo response = ", response);
if (response && response.coords) {
console.log("geo res true");
this.saveLocationLogs(response.coords);
}
},
(error) => {
console.log("Error geolocation");
this.onGeolocationErrorOccurCallback(error);
},
GeolocationOptions
).catch((error) => {
console.log(error);
});
}
There is a TypeError: cannot read property getCurrentPosition of undefined.
still I am not able to get my current location?? Why this is happening? Please suggest me a solution.
Getting multiple warning any plan to upgrade project before end of the year?
WARNING: Configuration 'provided' is obsolete and has been replaced with 'compileOnly'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'
I was reading your module source code - I'm not using it currently - but I noticed something that might cause a bug...
This was inspired by this talk from Runkeeper developer : https://speakerdeck.com/pconno3/the-struggles-with-location-services
He mentions a difficult bug they had on some android devices, when using System
current time : your system time CAN change when different cell-towers provide different times, that update system time..
This is indeed what Location
documentation says (https://developer.android.com/reference/android/location/Location.html#getTime() )
"Note that the UTC time on a device is not monotonic: it can jump forwards or backwards unpredictably. So always use getElapsedRealtimeNanos() when calculating time deltas."
)
I thought you might want to know that ;)
Maybe this should be in react-native official package?
Hi,
First, thanks for your work... you saved my app ^^ !
I'm just here to see if you got a solution, some of my users are answering "Cancel" when this popup/notif/alert appears... (sorry, screen in french)
It means :
"To obtain best results, allow your device to activate localization, that use Google service localization" "Cancel" "Ok"
If they press "Cancel", the popup reappear instantly, again, and again, and again ...
Hope someone will find a solution. Some of them do not want to enable localization...
My App get crash when starting up.
This issue might be related with react-native-smart-splash-screen.
But I post here because I was not have this issue until I use this lib.
02-25 23:11:37.374 2931 2931 E WindowManager: android.view.WindowLeaked: Activity com.eabsen.MainActivity has leaked window DecorView@9d1f8db[] that was originally added here
02-25 23:11:37.374 2931 2931 E WindowManager: at android.view.ViewRootImpl.<init>(ViewRootImpl.java:418)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:331)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.app.Dialog.show(Dialog.java:322)
02-25 23:11:37.374 2931 2931 E WindowManager: at com.reactnativecomponent.splashscreen.RCTSplashScreen$1.run(RCTSplashScreen.java:73)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.app.Activity.runOnUiThread(Activity.java:5866)
02-25 23:11:37.374 2931 2931 E WindowManager: at com.reactnativecomponent.splashscreen.RCTSplashScreen.openSplashScreen(RCTSplashScreen.java:49)
02-25 23:11:37.374 2931 2931 E WindowManager: at com.reactnativecomponent.splashscreen.RCTSplashScreen.openSplashScreen(RCTSplashScreen.java:39)
02-25 23:11:37.374 2931 2931 E WindowManager: at com.reactnativecomponent.splashscreen.RCTSplashScreen.openSplashScreen(RCTSplashScreen.java:35)
02-25 23:11:37.374 2931 2931 E WindowManager: at com.eabsen.MainActivity.onCreate(MainActivity.java:20)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.app.Activity.performCreate(Activity.java:6679)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.app.ActivityThread.-wrap12(ActivityThread.java)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.os.Handler.dispatchMessage(Handler.java:102)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.os.Looper.loop(Looper.java:154)
02-25 23:11:37.374 2931 2931 E WindowManager: at android.app.ActivityThread.main(ActivityThread.java:6119)
02-25 23:11:37.374 2931 2931 E WindowManager: at java.lang.reflect.Method.invoke(Native Method)
02-25 23:11:37.374 2931 2931 E WindowManager: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
02-25 23:11:37.374 2931 2931 E WindowManager: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
After I uninstall this lib, everything back to normal.
Hi!
The app just crashed throwing this error:
Fatal Exception: java.lang.RuntimeException: Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
at com.facebook.react.bridge.CallbackImpl.invoke(CallbackImpl.java:30)
at com.agontuk.RNFusedLocation.SingleLocationUpdate.invokeSuccess(SingleLocationUpdate.java:93)
at com.agontuk.RNFusedLocation.SingleLocationUpdate.access$300(SingleLocationUpdate.java:16)
at com.agontuk.RNFusedLocation.SingleLocationUpdate$2.onLocationResult(SingleLocationUpdate.java:45)
at com.google.android.gms.internal.zzcff.zzu(Unknown Source)
at com.google.android.gms.common.api.internal.zzci.zzb(Unknown Source)
at com.google.android.gms.common.api.internal.zzcj.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
It doesn't happens all the time, so I can't do a step-by-step debug.
Our crashlytics console is showing this crash in production app.
Fatal Exception: java.lang.NullPointerException
...
com.google.android.gms.common.api.Status.startResolutionForResult (Unknown Source)
com.google.android.gms.common.api.ResolvableApiException.startResolutionForResult (Unknown Source)
com.agontuk.RNFusedLocation.RNFusedLocationModule.onLocationSettingsResponse (RNFusedLocationModule.java:173)
com.agontuk.RNFusedLocation.RNFusedLocationModule.access$200 (RNFusedLocationModule.java:31)
com.agontuk.RNFusedLocation.RNFusedLocationModule$2.onComplete (RNFusedLocationModule.java:126)
...
getCurrentPosition is resulting in location request timeout only for android version 6.0 devices.
Just thought i'd provide some feedback. To get this going on Andoid 9 (Pie) i did the following:
npm i react-native-geolocation-service
react-native link react-native-geolocation-service
android\app\build.gradle
in the dependencies {...}
sectionimplementation "com.google.android.gms:play-services-location:16.0.0"
I was also had problems with red screens on launch when debugging. Deleting the android\build
folder before deployment fixed this for me
Hi Agontuk, I hope I'm doing something wrong, I cloned the repository, cd example && npm i
I have turned on the high accuracy location service on my phone and allowed the example app to access my location but I'm getting error code 3, "Location request has timed out." when running the app (same behaviour as React Native's Geolocation API). Did I miss a step?
When requesting a location using Geolocation.getCurrentPosition, if the location service is not enabled on the device, a message requesting user's permission pops up.
This has worked fine in the past, in debug versions and in release versions
the image is in portuguese, my device's default language
Issue:
In release versions, the pop up simply doesn't appear when a location request is made
react-native-cli: 2.0.1
react-native: 0.53.0
react-native-geolocation-service: 1.0.4 And 1.1.0
Edit:
Also, the problem happens with android versions 6.0
and 7.1.1
Hi,
I am using this package since it was first published but today I find out that I am not getting value for speed and heading parameter. I do not know what I did wrong. I am not an android developer please let me know what extra information you required to look into this issue.
Thanks
Hello,
I'm getting the following error on build:
class file for com.google.android.gms.common.internal.safeparcel.zza not found
.
My build.gradle
has:
compile project(':react-native-geolocation-service') {
exclude group: 'com.google.android.gms', module: 'play-services-location'
}
...
compile 'com.google.android.gms:play-services-location:11.+'
Thank you!
When a user opens the app with location services enabled, and the app then registers a watchPosition
callback, and then the user disables location services, and goes back to the app, watchPosition
never raises an exception. React Native core's navigator.geolocation has this same issue, but I would expect watchPosition
to raise an exception the same way that getCurrentPosition
would. This would be useful for detecting that location services are off so the app could prompt a user to reenable it.
I want to implement live tracking in the application but for that I needed changed location after every metre for that I used watchPosition method but still the device detects changed location after 100m of range or more than that, any solution for this?
Hey! Thanks for making this plugin! It was working pretty well for me until I needed to update my code to Google Play Services version 15.0.0. After that, I updated my build.gradle file to reflect the change:
dependencies {
compile project(':react-native-code-push')
compile project(':react-native-sentry')
compile project(':react-native-restart')
compile project(':react-native-linear-gradient')
compile project(':react-native-spinkit')
compile project(':react-native-device-info')
compile project(':react-native-push-notification')
compile(project(':react-native-geolocation-service')){
exclude group: 'com.google.android.gms', module: 'play-services-location'
}
compile 'com.google.android.gms:play-services-location:15.0.0'
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
Ever after, I just get the "Google play service is not available." error. Is there something I should know or is the library not compatible with 15.0.0?
I followed every step in android and the build success but when app start I got this error:
java.lang.IllegalAccessError: Illegal class access: 'com.google.android.gms.location.FusedLocationProviderClient' attempting to access 'com.google.android.gms.internal.zzbce' (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears in /data/app/com.*****.****-QrqAHGWseTtHezcO8qIiAw==/base.apk)
this is my build.gradle:
dependencies {
compile project(':react-native-dialogs')
compile project(':react-native-fetch-blob')
compile project(':react-native-image-picker')
compile project(':react-native-fbsdk')
compile project(':react-native-admob')
compile project(':react-native-svg')
compile project(':react-native-vector-icons')
compile project(':react-native-spinkit')
compile project(':react-native-mail')
compile project(':react-native-device-info')
compile project(':react-native-geolocation-service')
compile fileTree(dir: "libs", include: ["*.jar"])
// From node_modules
compile 'com.android.support:appcompat-v7:25.0.2'
compile 'com.facebook.react:react-native:+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.3.1'
}
06-06 14:11:14.452 6060 6060 I dex2oat : dex2oat took 4.142s (threads: 4) arena alloc=127KB java alloc=6MB native alloc=32MB free=3MB
06-06 14:11:14.544 620 634 I ActivityManager: Force stopping com.farma appid=10061 user=-1: uninstall pkg
06-06 14:11:17.048 620 645 I PackageManager: Package com.farma codePath changed from /data/app/com.farma-1 to /data/app/com.farma-2; Retaining data and using new
06-06 14:11:17.048 620 645 W PackageManager: Code path for com.farma changing from /data/app/com.farma-1 to /data/app/com.farma-2
06-06 14:11:17.048 620 645 W PackageManager: Resource path for com.farma changing from /data/app/com.farma-1 to /data/app/com.farma-2
06-06 14:11:17.048 620 634 I ActivityManager: Force stopping com.farma appid=10061 user=-1: replace pkg
06-06 14:11:17.246 620 645 W Settings: Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
06-06 14:11:17.246 620 645 I art : Starting a blocking GC Explicit
06-06 14:11:17.265 620 645 I art : Explicit concurrent mark sweep GC freed 24854(1333KB) AllocSpace objects, 6(120KB) LOS objects, 33% free, 10MB/15MB, paused 448us total 18.977ms
06-06 14:11:17.275 620 645 W PackageManager: Couldn't remove dex file for package: at location /data/app/com.farma-1/base.apk, retcode=-1
06-06 14:11:17.275 620 645 I ActivityManager: Force stopping com.farma appid=10061 user=0: pkg removed
06-06 14:11:17.289 620 620 D JobSchedulerService: Receieved: android.intent.action.PACKAGE_REMOVED
06-06 14:11:17.294 620 675 I InputReader: Reconfiguring input devices. changes=0x00000010
06-06 14:11:17.296 6051 6051 I art : System.exit called, status: 0
06-06 14:11:17.296 6051 6051 I AndroidRuntime: VM exiting with result code 0.
06-06 14:11:17.304 620 675 I InputReader: Reconfiguring input devices. changes=0x00000010
06-06 14:11:17.305 620 675 I InputReader: Reconfiguring input devices. changes=0x00000010
06-06 14:11:17.316 620 620 V WebViewFactory: webViewPackageName: com.android.webview
06-06 14:11:17.360 849 849 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_REMOVED
06-06 14:11:17.393 2519 2519 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1221 android.content.ContextWrapper.startService:581 android.content.ContextWrapper.startService:581 com.android.keychain.KeyChainBroadcastReceiver.onReceive:12 android.app.ActivityThread.handleReceiver:2725
06-06 14:11:17.411 620 633 W Searchables: No global search activity found
06-06 14:11:17.421 620 633 W Searchables: No global search activity found
06-06 14:11:17.421 620 633 W VoiceInteractionManagerService: no available voice recognition services found for user 0
06-06 14:11:17.438 3054 3054 I Finsky : [1] com.google.android.finsky.p2p.c.a(10): Frosting ID looked up on UI thread. Caller should move to a background thread.
06-06 14:11:17.457 838 4691 E NetworkScheduler: Unrecognised action provided: android.intent.action.PACKAGE_REMOVED
06-06 14:11:17.461 3054 3054 I Finsky : [1] com.google.android.finsky.p2p.d.a(2): Wrote row to frosting DB: 36
06-06 14:11:17.469 849 849 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_ADDED
06-06 14:11:17.471 849 849 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_REPLACED
06-06 14:11:17.487 849 849 D CarrierServiceBindHelper: mHandler: 3
06-06 14:11:17.487 849 849 D CarrierServiceBindHelper: mHandler: 3
06-06 14:11:17.487 849 849 D CarrierServiceBindHelper: mHandler: 3
06-06 14:11:17.488 849 849 D CarrierConfigLoader: mHandler: 9 phoneId: 0
06-06 14:11:17.503 3054 3054 I Finsky : [1] com.google.android.finsky.scheduler.bb.a(50): Jobs in database: 1-1337 12-1
06-06 14:11:17.505 3054 3054 I Finsky : [1] com.google.android.finsky.scheduler.g.a(287): ConstraintMapping: 1-1337, 12-1, -> L: 14956ms, D: 86399956ms, C: false, I: false, N: 1
06-06 14:11:17.513 3054 3054 I Finsky : [1] com.google.android.finsky.scheduler.JobSchedulerEngine.a(19): Cancelling existing job with id: 9001
06-06 14:11:17.514 3054 3054 I Finsky : [1] com.google.android.finsky.scheduler.JobSchedulerEngine.a(19): Cancelling existing job with id: 9000
06-06 14:11:17.516 3054 3054 I Finsky : [1] com.google.android.finsky.scheduler.JobSchedulerEngine.a(142): Scheduling job Id: 9002, L: 14956, D: 86399956, C: false, I: false, N: 1
06-06 14:11:17.520 3054 3054 I Finsky : [1] com.google.android.finsky.scheduler.JobSchedulerEngine.a(142): Scheduling job Id: 9003, L: 14956, D: 86399956, C: false, I: false, N: 1
06-06 14:11:17.535 3054 3054 I Finsky : [1] com.google.android.finsky.p2p.c.a(10): Frosting ID looked up on UI thread. Caller should move to a background thread.
06-06 14:11:17.537 620 1619 I AccountManagerService: getTypesVisibleToCaller: isPermitted? true
06-06 14:11:17.540 3054 3054 I Finsky : [1] com.google.android.finsky.wear.WearSupportService.onStartCommand(26): Starting WearSupportService for auto_install
06-06 14:11:17.541 620 887 I AccountManagerService: getTypesVisibleToCaller: isPermitted? true
06-06 14:11:17.542 3054 3054 I Finsky : [1] com.google.android.finsky.wear.w.a(18): Connecting to wearable
06-06 14:11:17.544 3054 3054 I Finsky : [1] com.google.android.finsky.externalreferrer.b.a(10): Package state data is missing for com.farma
06-06 14:11:17.549 3054 3054 I Finsky : [1] com.google.android.finsky.p2p.d.a(2): Wrote row to frosting DB: 37
06-06 14:11:17.553 1444 6090 I ChromeSync: [Sync,SyncIntentOperation] Handling the intent: Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.farma flg=0x4000010 cmp=com.google.android.gms/.chimera.GmsIntentOperationService (has extras) }.
06-06 14:11:17.569 838 838 I WearableService: Wearable Services not starting - Wear is not available on this device.
06-06 14:11:17.621 838 1814 W WearableService: onGetService - Wear is not available on this device.
06-06 14:11:17.637 3054 3054 E Finsky : [1] com.google.android.finsky.wear.x.a(3): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE,resolution=null, message=null}
06-06 14:11:17.637 3054 3054 W Finsky : [1] com.google.android.finsky.wear.w.b(31): GoogleApiClient instance is not connected when requested
06-06 14:11:17.637 3054 3054 W Finsky : [1] com.google.android.finsky.wear.dk.run(16): Dropping command=auto_install due to Gms not connected
06-06 14:11:17.637 3054 3054 I Finsky : [1] com.google.android.finsky.wear.WearSupportService.b(66): Stopping WearSupportService
06-06 14:11:17.649 838 4691 E NetworkScheduler: Unrecognised action provided: android.intent.action.PACKAGE_REPLACED
06-06 14:11:17.687 1444 1844 I Icing : IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=36
06-06 14:11:17.687 1444 1879 I Icing : IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=32
06-06 14:11:17.701 838 1797 I AsyncOpDispatcher: 19-GetFileDescriptorAndDelete
06-06 14:11:17.748 1444 2350 I Icing : Usage reports ok 2, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
06-06 14:11:17.753 838 1816 I AsyncOpDispatcher: 19-GetFileDescriptorAndDelete
06-06 14:11:17.759 1444 2350 I Icing : Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
06-06 14:11:17.767 1444 1879 I Icing : IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=32
06-06 14:11:17.768 1444 1844 I Icing : IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=36
06-06 14:11:17.775 838 1797 I AsyncOpDispatcher: 19-GetFileDescriptorAndDelete
06-06 14:11:17.780 1444 1811 I Icing : Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
06-06 14:11:17.782 838 1816 I AsyncOpDispatcher: 19-GetFileDescriptorAndDelete
06-06 14:11:17.787 1444 1811 I Icing : Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
06-06 14:11:18.762 1444 2590 I Icing : Indexing 8151D8890BD57A504FC0CB0F95635B8C4F4FCF86 from com.google.android.gms
06-06 14:11:18.796 1444 2590 I Icing : Indexing done 8151D8890BD57A504FC0CB0F95635B8C4F4FCF86
06-06 14:11:22.045 6102 6102 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
06-06 14:11:22.046 6102 6102 D AndroidRuntime: CheckJNI is OFF
06-06 14:11:22.059 6102 6102 D ICU : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
06-06 14:11:22.083 6102 6102 E memtrack: Couldn't load memtrack module (No such file or directory)
06-06 14:11:22.083 6102 6102 E android.os.Debug: failed to load memtrack module: -2
06-06 14:11:22.085 6102 6102 I Radio-JNI: register_android_hardware_Radio DONE
06-06 14:11:22.092 6102 6102 D AndroidRuntime: Calling main entry com.android.commands.am.Am
06-06 14:11:22.097 620 1931 I ActivityManager: START u0 {flg=0x10000000 cmp=com.farma/.MainActivity} from uid 0 on display 0
06-06 14:11:22.113 596 596 E EGL_emulation: tid 596: eglCreateSyncKHR(1215): error 0x3004 (EGL_BAD_ATTRIBUTE)
06-06 14:11:22.138 6102 6102 D AndroidRuntime: Shutting down VM
06-06 14:11:22.149 620 1619 I ActivityManager: Start proc 6111:com.farma/u0a61 for activity com.farma/.MainActivity
06-06 14:11:22.185 6111 6111 E libprocessgroup: failed to make and chown /acct/uid_10061: Read-only file system
06-06 14:11:22.185 6111 6111 W Zygote : createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?
06-06 14:11:22.185 6111 6111 I art : Late-enabling -Xcheck:jni
06-06 14:11:22.201 6111 6111 V fb-UnpackingSoSource: locked dso store /data/user/0/com.farma/lib-main
06-06 14:11:22.201 6111 6111 V fb-UnpackingSoSource: deps mismatch on deps store: regenerating
06-06 14:11:22.201 6111 6111 V fb-UnpackingSoSource: so store dirty: regenerating
06-06 14:11:22.215 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libfb.so: deferring to libdir
06-06 14:11:22.215 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libfolly_json.so: deferring to libdir
06-06 14:11:22.215 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libglog.so: deferring to libdir
06-06 14:11:22.215 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libglog_init.so: deferring to libdir
06-06 14:11:22.215 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libgnustl_shared.so: deferring to libdir
06-06 14:11:22.215 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libicu_common.so: deferring to libdir
06-06 14:11:22.215 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libimagepipeline.so: deferring to libdir
06-06 14:11:22.216 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libjsc.so: deferring to libdir
06-06 14:11:22.216 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libprivatedata.so: deferring to libdir
06-06 14:11:22.216 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libreactnativejni.so: deferring to libdir
06-06 14:11:22.216 6111 6111 D ApkSoSource: not allowing consideration of lib/x86/libyoga.so: deferring to libdir
06-06 14:11:22.216 6111 6111 V fb-UnpackingSoSource: regenerating DSO store com.facebook.soloader.ApkSoSource
06-06 14:11:22.216 6111 6111 V fb-UnpackingSoSource: starting syncer worker
06-06 14:11:22.219 6111 6111 V fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.farma/lib-main (from syncer thread)
06-06 14:11:22.220 6111 6111 V fb-UnpackingSoSource: not releasing dso store lock for /data/user/0/com.farma/lib-main (syncer thread started)
06-06 14:11:22.241 6111 6124 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
06-06 14:11:22.244 6111 6111 D : HostConnection::get() New Host Connection established 0xe9bdf9f0, tid 6111
06-06 14:11:22.594 6111 6111 D ReactNative: ReactInstanceManager.ctor()
06-06 14:11:22.614 6111 6111 D ReactNative: ReactInstanceManager.createReactContextInBackground()
06-06 14:11:22.614 6111 6111 D ReactNative: ReactInstanceManager.recreateReactContextInBackgroundInner()
06-06 14:11:22.641 838 838 I WearableService: Wearable Services stopping
06-06 14:11:22.649 6111 6124 D libEGL : loaded /system/lib/egl/libEGL_emulation.so
06-06 14:11:22.650 6111 6124 D libEGL : loaded /system/lib/egl/libGLESv1_CM_emulation.so
06-06 14:11:22.657 6111 6124 D libEGL : loaded /system/lib/egl/libGLESv2_emulation.so
06-06 14:11:22.663 6111 6124 D : HostConnection::get() New Host Connection established 0xeeb92c80, tid 6124
06-06 14:11:22.670 6111 6133 W unknown:InspectorPackagerConnection: Couldn't connect to packager, will silently retry
06-06 14:11:22.920 6111 6124 I OpenGLRenderer: Initialized EGL, version 1.4
06-06 14:11:23.339 6111 6124 W EGL_emulation: eglSurfaceAttrib not implemented
06-06 14:11:23.339 6111 6124 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xeeb93980, error=EGL_SUCCESS
06-06 14:11:23.362 6111 6111 W unknown:ReactNative: Packager connection already open, nooping.
06-06 14:11:23.496 6111 6124 W EGL_emulation: eglSurfaceAttrib not implemented
06-06 14:11:23.496 6111 6124 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xeeb939a0, error=EGL_SUCCESS
06-06 14:11:24.222 620 641 W art : Long monitor contention event with owner method=int com.android.server.wm.WindowManagerService.relayoutWindow(com.android.server.wm.Session, android.view.IWindow, int, android.view.WindowManager$LayoutParams, int, int, int, int, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.content.res.Configuration, android.view.Surface) from WindowManagerService.java:3103 waiters=0 for 212ms
06-06 14:11:24.289 6111 6124 W EGL_emulation: eglSurfaceAttrib not implemented
06-06 14:11:24.289 6111 6124 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xeeb93a60, error=EGL_SUCCESS
06-06 14:11:24.314 6111 6124 E Surface : getSlotFromBufferLocked: unknown buffer: 0xdf884690
06-06 14:11:24.324 6111 6111 D ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer()
06-06 14:11:24.324 6111 6111 D ReactNative: ReactInstanceManager.recreateReactContextInBackground()
06-06 14:11:24.324 6111 6111 D ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread()
06-06 14:11:24.351 6111 6139 I art : Thread[21,tid=6139,Native,Thread*=0xdfb0d600,peer=0x12c20220,"Thread-287"] recursive attempt to load library "/data/app/com.farma-2/lib/x86/libfb.so"
06-06 14:11:24.353 6111 6139 D ReactNative: ReactInstanceManager.createReactContext()
06-06 14:11:24.364 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
06-06 14:11:24.365 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
06-06 14:11:24.367 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
06-06 14:11:24.372 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
06-06 14:11:24.374 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
06-06 14:11:24.375 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
06-06 14:11:24.377 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.checkbox.ReactCheckBoxManager
06-06 14:11:24.383 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
06-06 14:11:24.388 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
06-06 14:11:24.392 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
06-06 14:11:24.398 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
06-06 14:11:24.399 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
06-06 14:11:24.400 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
06-06 14:11:24.402 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
06-06 14:11:24.404 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
06-06 14:11:24.407 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
06-06 14:11:24.411 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
06-06 14:11:24.411 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
06-06 14:11:24.411 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
06-06 14:11:24.412 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
06-06 14:11:24.414 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.toolbar.ReactToolbarManager
06-06 14:11:24.419 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.webview.ReactWebViewManager
06-06 14:11:24.431 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
06-06 14:11:24.434 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
06-06 14:11:24.435 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
06-06 14:11:24.436 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
06-06 14:11:24.436 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
06-06 14:11:24.437 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
06-06 14:11:24.439 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
06-06 14:11:24.440 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
06-06 14:11:24.440 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
06-06 14:11:24.443 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode
06-06 14:11:24.444 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
06-06 14:11:24.448 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
06-06 14:11:24.450 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
06-06 14:11:24.451 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
06-06 14:11:24.452 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
06-06 14:11:24.458 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
06-06 14:11:24.460 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
06-06 14:11:24.461 6111 6139 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
06-06 14:11:24.468 6111 6139 I art : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.location.LocationRequest>
06-06 14:11:24.468 6111 6139 I art : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.location.LocationRequest>
06-06 14:11:24.469 6111 6139 I art : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.location.LocationRequest>
06-06 14:11:24.469 6111 6139 I art : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.location.LocationRequest>
06-06 14:11:24.469 6111 6139 I art : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.location.LocationRequest>
06-06 14:11:24.472 6111 6139 I art : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.location.LocationSettingsRequest>
06-06 14:11:24.472 6111 6139 I art : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.location.LocationSettingsRequest>
06-06 14:11:24.472 6111 6139 I art : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.location.LocationSettingsRequest>
06-06 14:11:24.474 6111 6139 I art : Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.location.LocationSettingsRequest>
06-06 14:11:24.489 6111 6139 E AndroidRuntime: FATAL EXCEPTION: Thread-287
06-06 14:11:24.489 6111 6139 E AndroidRuntime: Process: com.farma, PID: 6111
06-06 14:11:24.489 6111 6139 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at com.google.android.gms.location.LocationServices.<clinit>(Unknown Source)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at com.agontuk.RNFusedLocation.RNFusedLocationModule.<init>(RNFusedLocationModule.java:73)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at com.agontuk.RNFusedLocation.RNFusedLocationPackage.createNativeModules(RNFusedLocationPackage.java:26)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:106)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1172)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1142)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1080)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$900(ReactInstanceManager.java:113)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:911)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.Api$zzf" on path: DexPathList[[zip file "/data/app/com.farma-2/base.apk"],nativeLibraryDirectories=[/data/app/com.farma-2/lib/x86, /data/app/com.farma-2/base.apk!/lib/x86, /vendor/lib, /system/lib]]
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: ... 10 more
06-06 14:11:24.489 6111 6139 E AndroidRuntime: Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.common.api.Api$zzf
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at java.lang.Class.classForName(Native Method)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
06-06 14:11:24.489 6111 6139 E AndroidRuntime: ... 11 more
06-06 14:11:24.489 6111 6139 E AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
06-06 14:11:24.509 620 1931 W ActivityManager: Force finishing activity com.farma/.MainActivity
06-06 14:11:24.558 596 596 E EGL_emulation: tid 596: eglCreateSyncKHR(1215): error 0x3004 (EGL_BAD_ATTRIBUTE)
06-06 14:11:24.580 620 1931 W ActivityManager: Force finishing activity com.android.settings/.SubSettings
06-06 14:11:24.581 620 875 D Sensors : batch handle 1, but there is no batch sensor in genymotion
06-06 14:11:24.628 5179 5179 I art : Starting a blocking GC Explicit
06-06 14:11:24.644 5179 5179 I art : Explicit concurrent mark sweep GC freed 2191(285KB) AllocSpace objects, 1(40KB) LOS objects, 24% free, 5MB/7MB, paused 156us total 15.145ms
06-06 14:11:24.644 5179 5179 I art : Starting a blocking GC Explicit
06-06 14:11:24.655 5179 5179 I art : Explicit concurrent mark sweep GC freed 60(2536B) AllocSpace objects, 0(0B) LOS objects, 24% free, 5MB/7MB,paused 127us total 9.776ms
06-06 14:11:24.655 5179 5179 I art : Starting a blocking GC Explicit
06-06 14:11:24.661 5179 5179 I art : Explicit concurrent mark sweep GC freed 5(176B) AllocSpace objects, 0(0B) LOS objects, 24% free, 5MB/7MB, paused 111us total 5.896ms
06-06 14:11:24.680 5179 5194 E Surface : getSlotFromBufferLocked: unknown buffer: 0xdecf5cb0
06-06 14:11:24.742 620 684 I OpenGLRenderer: Initialized EGL, version 1.4
06-06 14:11:24.783 620 684 W EGL_emulation: eglSurfaceAttrib not implemented
06-06 14:11:24.783 620 684 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xd80b1040, error=EGL_SUCCESS
06-06 14:11:24.865 5179 5194 W EGL_emulation: eglSurfaceAttrib not implemented
06-06 14:11:24.865 5179 5194 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xdf2f95e0, error=EGL_SUCCESS
06-06 14:11:25.057 5179 5179 D DashboardSummary: rebuildUI took: 31 ms
06-06 14:11:25.298 6111 6124 E Surface : getSlotFromBufferLocked: unknown buffer: 0xdf8845b0
06-06 14:11:25.314 6111 6124 E Surface : getSlotFromBufferLocked: unknown buffer: 0xdf884620
06-06 14:11:25.326 6111 6111 E WindowManager:
06-06 14:11:25.326 6111 6111 E WindowManager: android.view.WindowLeaked: Activity com.farma.MainActivity has leaked window com.android.internal.policy.PhoneWindow$DecorView{519045e V.E...... R....... 0,0-768,1184} that was originally added here
06-06 14:11:25.326 6111 6111 E WindowManager: at android.view.ViewRootImpl.<init>(ViewRootImpl.java:368)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:299)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.app.Dialog.show(Dialog.java:319)
06-06 14:11:25.326 6111 6111 E WindowManager: at com.reactnativecomponent.splashscreen.RCTSplashScreen$1.run(RCTSplashScreen.java:73)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.app.Activity.runOnUiThread(Activity.java:5511)
06-06 14:11:25.326 6111 6111 E WindowManager: at com.reactnativecomponent.splashscreen.RCTSplashScreen.openSplashScreen(RCTSplashScreen.java:49)
06-06 14:11:25.326 6111 6111 E WindowManager: at com.reactnativecomponent.splashscreen.RCTSplashScreen.openSplashScreen(RCTSplashScreen.java:39)
06-06 14:11:25.326 6111 6111 E WindowManager: at com.reactnativecomponent.splashscreen.RCTSplashScreen.openSplashScreen(RCTSplashScreen.java:35)
06-06 14:11:25.326 6111 6111 E WindowManager: at com.farma.MainActivity.onCreate(MainActivity.java:20)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.app.Activity.performCreate(Activity.java:6237)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.app.ActivityThread.-wrap11(ActivityThread.java)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.os.Handler.dispatchMessage(Handler.java:102)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.os.Looper.loop(Looper.java:148)
06-06 14:11:25.326 6111 6111 E WindowManager: at android.app.ActivityThread.main(ActivityThread.java:5417)
06-06 14:11:25.326 6111 6111 E WindowManager: at java.lang.reflect.Method.invoke(Native Method)
06-06 14:11:25.326 6111 6111 E WindowManager: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-06 14:11:25.326 6111 6111 E WindowManager: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-06 14:11:27.298 6111 6139 I Process : Sending signal. PID: 6111 SIG: 9
06-06 14:11:27.307 620 684 E Surface : getSlotFromBufferLocked: unknown buffer: 0xd80ddea0
06-06 14:11:27.312 620 834 W libprocessgroup: failed to open /acct/uid_10061/pid_6111/cgroup.procs: No such file or directory
06-06 14:11:27.312 620 834 I ActivityManager: Process com.farma (pid 6111) has died
06-06 14:11:27.312 620 875 D GraphicsStats: Buffer count: 4
06-06 14:11:27.528 620 641 W AppOps : Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0
06-06 14:11:27.621 620 1887 D NetlinkSocketObserver: NeighborEvent{elapsedMs=3953244, 10.0.3.2, [525400123502], RTM_NEWNEIGH, NUD_REACHABLE}
dependencies {
compile project(':react-native-vector-icons')
compile project(':react-native-text-input-mask')
compile project(':react-native-smart-splash-screen')
compile(project(':react-native-geolocation-service')) {
exclude group: 'com.google.android.gms', module: 'play-services-location'
}
compile 'com.google.android.gms:play-services-location:11.8.0'
compile project(':react-native-device-info')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:26.0.2"
compile "com.facebook.react:react-native:+" // From node_modules
}
My app is crashing at the start
I use react-native-geolocation-service for get user current location without internet and I try with your example code , my problem is when WIFI is off app give me thie error :
code:5 , Location settings are not satisfied
and when WIFI is on app work very well and give me current location
i test in my code and also test resource code , it alway show this warning, have any solution
I implemented your service but i still have the timeout error on Android.
I use RN version 52 on Android 6.0
Maybe add typescript typings? It's as easy as doing this:
declare module "react-native-geolocation-service" {
export default navigator.geolocation;
}
Hi my app keeps crashing these are the details:
classpath 'com.google.gms:google-services:3.1.0'
"react": "16.0.0-alpha.12"
"react-native": "^0.46.4"
My targetedSDKVersion is 23
I have made the changes in the MainApplication.java android/app/build.gradle and settings.gradle files. Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.