Comments (3)
Interesting, I'm using the watchLocation
and at least in the android sims it is working w/o any problems. What error do you get when the app crashes?
from nativescript-geolocation.
This is what I get from the device:
An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.test/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreate failed
Error calling module function
Error: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
android.support.v4.content.ContextCompat.checkSelfPermission(ContextCompat.java:453)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
com.tns.Runtime.callJSMethod(Runtime.java:890)
com.tns.Runtime.callJSMethod(Runtime.java:874)
com.tns.Runtime.callJSMethod(Runtime.java:866)
com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
android.app.Activity.performCreate(Activity.java:6237)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
android.app.ActivityThread.-wrap11(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5417)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
File: "file:///data/data/org.nativescript.test/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js, line: 149, column: 13
StackTrace:
Frame: function:'enableLocationRequestCore', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js', line: 149, column: 14
Frame: function:'watchLocation', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js', line: 168, column: 9
Frame: function:'', file:'file:///data/data/org.nativescript.test/files/app/main-page.js', line: 80, column: 23
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'global.loadModule', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/globals/globals.js', line: 30, column: 31
Frame: function:'resolvePageFromEntry', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 95, column: 40
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 177, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 678, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 16, column: 25
Error: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
android.support.v4.content.ContextCompat.checkSelfPermission(ContextCompat.java:453)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
com.tns.Runtime.callJSMethod(Runtime.java:890)
com.tns.Runtime.callJSMethod(Runtime.java:874)
com.tns.Runtime.callJSMethod(Runtime.java:866)
com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
android.app.Activity.performCreate(Activity.java:6237)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
android.app.ActivityThread.-wrap11(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5417)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
File: ", line: 1, column: 265
StackTrace:
Frame: function:'enableLocationRequestCore', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js', line: 149, column: 14
Frame: function:'watchLocation', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js', line: 168, column: 9
Frame: function:'', file:'file:///data/data/org.nativescript.test/files/app/main-page.js', line: 80, column: 23
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'global.loadModule', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/globals/globals.js', line: 30, column: 31
Frame: function:'resolvePageFromEntry', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 95, column: 40
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 177, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 678, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 16, column: 25
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.tns.NativeScriptException:
Calling js method onCreate failed
Error calling module function
Error: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
android.support.v4.content.ContextCompat.checkSelfPermission(ContextCompat.java:453)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
com.tns.Runtime.callJSMethod(Runtime.java:890)
com.tns.Runtime.callJSMethod(Runtime.java:874)
com.tns.Runtime.callJSMethod(Runtime.java:866)
com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
android.app.Activity.performCreate(Activity.java:6237)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
android.app.ActivityThread.-wrap11(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5417)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
File: "file:///data/data/org.nativescript.test/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js, line: 149, column: 13
StackTrace:
Frame: function:'enableLocationRequestCore', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js', line: 149, column: 14
Frame: function:'watchLocation', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js', line: 168, column: 9
Frame: function:'', file:'file:///data/data/org.nativescript.test/files/app/main-page.js', line: 80, column: 23
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'global.loadModule', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/globals/globals.js', line: 30, column: 31
Frame: function:'resolvePageFromEntry', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 95, column: 40
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 177, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 678, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 16, column: 25
Error: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
android.support.v4.content.ContextCompat.checkSelfPermission(ContextCompat.java:453)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
com.tns.Runtime.callJSMethod(Runtime.java:890)
com.tns.Runtime.callJSMethod(Runtime.java:874)
com.tns.Runtime.callJSMethod(Runtime.java:866)
com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
android.app.Activity.performCreate(Activity.java:6237)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
android.app.ActivityThread.-wrap11(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5417)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
File: ", line: 1, column: 265
StackTrace:
Frame: function:'enableLocationRequestCore', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js', line: 149, column: 14
Frame: function:'watchLocation', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js', line: 168, column: 9
Frame: function:'', file:'file:///data/data/org.nativescript.test/files/app/main-page.js', line: 80, column: 23
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'global.loadModule', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/globals/globals.js', line: 30, column: 31
Frame: function:'resolvePageFromEntry', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 95, column: 40
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 177, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 678, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.test/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 16, column: 25
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
at com.tns.Runtime.callJSMethod(Runtime.java:890)
at com.tns.Runtime.callJSMethod(Runtime.java:874)
at com.tns.Runtime.callJSMethod(Runtime.java:866)
at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
... 9 more
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
at android.support.v4.content.ContextCompat.checkSelfPermission(ContextCompat.java:453)
... 19 more
from nativescript-geolocation.
Hi @d3mac123,
Recently we did some re-organisation of the plugin and the demos. Could you update the plugin and tell us if this is still an issue?
Best regards,
Veselina
P.S. In case no answer is received in 7 days, the issue will be closed.
from nativescript-geolocation.
Related Issues (20)
- geolocation.clearWatch(watchId) iOS - is not able to stop watch geolocation
- LocationRequest() from plugin crash the app [BUG] HOT 5
- Distance function returns 0 between two locations HOT 4
- Sample Background Service for the Angular version HOT 4
- _getLocationCallback() from plugin crashes the app
- enableLocationRequest() not working on Android HOT 1
- Application crashes when using the plugin to get location geoLocation.isEnabled() HOT 3
- Cannot read property 'osVersion' of undefined at iOS HOT 4
- Google Play service fused location HOT 1
- getCurrentLocation takes 14 seconds to return the coordinates HOT 1
- App Crash after installing nativescript-plugin-firebase
- Android foregroundService location requests while screen is off for a while not working HOT 1
- watchLocation() HOT 4
- Nativescript 8 - TypeError: Cannot read property 'high' of undefined HOT 4
- Android 11 has new requirements regarding background location permissions HOT 1
- TypeError: Cannot read property 'Accuracy' of undefined. HOT 1
- [help wanted] exception handle...
- Nativesctipt geolocation cant resolve platform
- Detect Mock Location
- Plugin doesn't make my app build
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 nativescript-geolocation.