How to solve geolocation error: Cannot read property ‘PRIORITY_HIGH_ACCURACY’

office, home, workspace-820390.jpg

If you are on NativeScript 8.1+, and using @nativescript/geolocation plugin 8.1.0, and have googlePlayServicesVersion accidentally set somewhere. Recent updates from this plugin may break your builds on Android.

Answers from Discord

Related GitHub issue: https://github.com/NativeScript/plugins/issues/364#issuecomment-1321794964

Symtoms

Error: Cannot enable the location service. TypeError: Cannot read property 'PRIORITY_HIGH_ACCURACY' of undefined

How to fix this

Try to remove googlePlayServicesVersion settings from all of your .gradle script or set it to Set it to 21.+. You may have accidentally set it in either app.gradle or before-plugins.gradle

After fix above lines, try to
ns clean
ns run android

To clean up and re-build your project.

This Post Has One Comment

  1. Thomas Leonard

    I saw a lot of website but I believe this one holds something special in it.

Leave a Reply