Giter Site home page Giter Site logo

Comments (3)

PeterStaev avatar PeterStaev commented on May 16, 2024

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.

d3mac123 avatar d3mac123 commented on May 16, 2024

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.

radeva avatar radeva commented on May 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.