Error getting location in NativeScript 5
See original GitHub issueHi,
After upgrade NativeScript to version 5, I have this error:
Cannot enable the location service. Error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbck;
My app.gradle is:
{
"nativescript": {
"id": "com.autocorp.autocorpapp",
"tns-android": {
"version": "5.0.0"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"moment": "^2.22.2",
"nativescript-crossplatform-aes": "^1.0.3",
"nativescript-directions": "^1.3.0",
"nativescript-dom": "^2.0.2",
"nativescript-geolocation": "^4.3.1",
"nativescript-google-maps-sdk": "^2.6.1",
"nativescript-loading-screen": "^1.0.6",
"nativescript-phone": "^1.4.0",
"nativescript-sqlite": "^2.2.3",
"nativescript-theme-core": "^1.0.4",
"nativescript-xml2js": "^0.5.2",
"tns-core-modules": "^5.0.2"
},
"readme": "NativeScript Application",
"devDependencies": {
"nativescript-dev-webpack": "^0.17.0"
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:23 (1 by maintainers)
Top Results From Across the Web
Geolocation - NativeScript Docs
Geolocation plugin to use for getting current location, monitor movement, etc. npm install @nativescript/geolocation. Important Breaking Change Version ...
Read more >Error: Cannot enable the location service. TypeError: Cannot ...
For anyone still looking for a solution to this, I was able to find was using CoreTypes.Accuracy.high geolocation.
Read more >'tns' is not a recognized command - Google Groups
I have installed NativeScript CLI and whenever I try using the tns command, I get this error: "'tns' is not a recognized internal...
Read more >Geolocation Mobile App Using NativeScript - Daxima
Using Nativescript plugins to manage geolocation in mobile application. ... you will get locations only from the last 5 seconds.
Read more >geolocation nativescript plugin does not work in sap business ...
We found out that the reported issue has caused due to some breaking changes introduced in recent update to the nativescript-geolocation plugin.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @neumartin , I’ve tested the plugin’s demo and found that there is no issue with it. The problem that you observe is related to dependency which both nativescript-geolocation and nativescript-google-maps-sdk plugins are using. The
googlePlayServicesVersion
dependency should be used with same version for both plugins. So the solution of the issue, when building an app is to specify which version of the dependency should be used by both plugins. As suggested by @annadante you should add before-plugins.gradle file where the googlePlayServicesVersion should be specified:I fixed the problem by adding this file to App_Resources/Android
file name: before-plugins.gradle content: android {
// other stuff here
project.ext { googlePlayServicesVersion = “15.0.1” } }