I encountered a similar issue and was able to resolve it by updating the nativescript-geolocation plugin. It turned out that version 3.0.1 did not rely on Google Play services, but it was outdated and incompatible with tns v6. Here is what worked for me:
To fix the problem, I fetched the source code of nativescript-geolocation v3.0.1, made some adjustments, and then included this modified code in my tns v6 project. The process is explained below.
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="573e29261b2d2c2f38351f222e2c">[email protected]</a>:NativeScript/nativescript-geolocation.git
cd nativescript-geolocation
git checkout -b your-branch v3.0.1
Afterwards, I edited the src/geolocation.android.ts file by changing just one line of code:
- let currentContext = <android.app.Activity>androidAppInstance.currentContext;
+ let currentContext = <android.app.Activity>androidAppInstance.context;
Finally, I added the dependency to my project using the following command:
tns plugin add /path/to/nativescript-geolocation/src
For guidance on how to utilize this plugin in version 3.0.1, refer to the demo/app/main-page.ts
file in the linked repository.