You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 8, 2023. It is now read-only.
I have the same problem, and after doing some testing I understood that the problem occurs after the installation of google-map sdk. When I delete it it works just fine. Anyone has any updates onthis?
@annadante, why version 15.0.1? And where did you find that information? Just in case I need to look up myself because of any mismatch. I used to have googlePlayServicesVersion = "+" which should force everything to the latest version.
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:
Reacted by Martin Neu, Juras Norkus, Nikolay Iliev, Alebiosu Lukmon, Shyam Seshadri, Juan Velasquez, Lucas Pelos, alexmeia, Ekpoto Liberty, Alejandro Sobko and 1 more
Reacted by SENECHAL Maxime
Reacted by Ben Margevicius
Reacted by Martin Neu, Nikolay Iliev, Ekpoto Liberty and Fio Quino
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"
}
}
@annadante, why version 15.0.1? And where did you find that information? Just in case I need to look up myself because of any mismatch. I used to have googlePlayServicesVersion = "+" which should force everything to the latest version.
Thank you ;)
This worked for me too. However, I don't get why I had to create a new statement if I had previously pinned on app.graddle the "googlePlayServicesVersion" version to be used...
I tried the solution listed above, but now I am getting:
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
@dpdragnev can you please post the package.json content so I can investigate your case (It is probably a conflict in the support library version as suggested by the error which is caused by a plugins requiring specific support version)
Meanwhile, have you tried using before-plugins.gradle file to force a version
I tried to add the before-plugins.gradle file and I cannot even build. I am getting a build error:
Failed to capture fingerprint of input files for task ':app:checkDebugClasspath' property 'compileClasspath' during up-to-date check.
> The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
I am supposed to release this app to the play store next week. What would you suggest I do if we cannot find a solution to this issue? Should I downgrade from 5.0 to v 4.*?
@dpdragnev I am building a project with the exact same dependencies with no hassle. Looking at your error log the issue seems related to version mismatch of some Android libraries Update your Google Play Services to latest (details here)
@DimitarTodorovbefore-plugins.gradle solution works. Maybe worth changing the github documentation as I was trying to set googlePlayServicesVersion = "16.+" on the app.gradle file which is applied after the plugins configuration.
Activity
lukkystunt commentedon Nov 12, 2018
@neumartin please any update on this, currently getting the same error.
neumartin commentedon Nov 12, 2018
I just downgrade to 4, no solutions for now.
fabiopolimeni commentedon Nov 13, 2018
Getting the same error, geolocation doesn't seem to work anymore in NS 5
package.json
Someone who knows how to fix this, please have a look 🥇 :D
[-]Error in NativeScript 5[/-][+]Error getting location in NativeScript 5[/+]neumartin commentedon Nov 14, 2018
I think that this is a bug, it is strange that we are few who had this issue and it is not labeled as a bug.
@tbozhikov @nsndeck can you help us?
Clifte commentedon Nov 14, 2018
Same problem here.
Error: Cannot enable the location service. Error: java.lang.NoClassDefFoundError: com.google.android.gms.location.LocationRequest
package.json
{
"nativescript": {
"id": "",
"tns-ios": {
"version": "5.0.0"
},
"tns-android": {
"version": "5.0.0"
}
},
"main": "app.js",
"description": "NativeScript Application",
"license": "SEE LICENSE IN ",
"repository": "",
"dependencies": {
"moment": "^2.21.0",
"nativescript-barcodescanner": "^2.7.4",
"nativescript-camera": "^4.0.3",
"nativescript-dom": "^2.0.0",
"nativescript-fancyalert": "^1.2.0",
"nativescript-geolocation": "^4.3.1",
"nativescript-google-maps-sdk": "^2.5.0",
"nativescript-iqkeyboardmanager": "^1.3.0",
"nativescript-loading-indicator": "^2.4.0",
"nativescript-orientation": "^2.2.0",
"nativescript-platform-css": "^1.6.5",
"nativescript-plugin-firebase": "^7.3.0",
"nativescript-pro-ui": "3.1.4",
"nativescript-speech-recognition": "^1.4.1",
"nativescript-theme-core": "~1.0.4",
"nativescript-toast": "^1.4.6",
"tns-core-modules": "^5.0.2"
},
"devDependencies": {
"nativescript-dev-typescript": "~0.7.0",
"nativescript-dev-webpack": "~0.18.0",
"typescript": "^3.1.6"
},
"readme": "NativeScript Application"
}
annagrigoryan92 commentedon Nov 14, 2018
I have the same problem, and after doing some testing I understood that the problem occurs after the installation of google-map sdk. When I delete it it works just fine. Anyone has any updates onthis?
annagrigoryan92 commentedon Nov 14, 2018
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"
}
}
fabiopolimeni commentedon Nov 15, 2018
@annadante, why version 15.0.1? And where did you find that information? Just in case I need to look up myself because of any mismatch. I used to have
googlePlayServicesVersion = "+"which should force everything to the latest version.Thank you ;)
annagrigoryan92 commentedon Nov 15, 2018
I tried the "+" thing and it didn't work.
The information was commented in the app.gradle file in Android folder :D
DimitarTodorov commentedon Nov 15, 2018
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
googlePlayServicesVersiondependency 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:neumartin commentedon Nov 15, 2018
@DimitarTodorov thanks!, i will try.
daniel-rfe commentedon Nov 23, 2018
This worked for me too. However, I don't get why I had to create a new statement if I had previously pinned on app.graddle the "googlePlayServicesVersion" version to be used...
dpdragnev commentedon Nov 24, 2018
I tried the solution listed above, but now I am getting:
Any suggestions?
NickIliev commentedon Nov 28, 2018
@dpdragnev can you please post the package.json content so I can investigate your case (It is probably a conflict in the support library version as suggested by the error which is caused by a plugins requiring specific support version)
Meanwhile, have you tried using
before-plugins.gradlefile to force a versionapp/App_Resources/Android/before-plugins.gradle
dpdragnev commentedon Nov 28, 2018
@NickIliev Here is my package.json:
I tried to add the before-plugins.gradle file and I cannot even build. I am getting a build error:
I am supposed to release this app to the play store next week. What would you suggest I do if we cannot find a solution to this issue? Should I downgrade from 5.0 to v 4.*?
Thank you
NickIliev commentedon Nov 30, 2018
@dpdragnev I am building a project with the exact same dependencies with no hassle. Looking at your error log the issue seems related to version mismatch of some Android libraries Update your Google Play Services to latest (details here)
heese commentedon Dec 5, 2018
Above (
before-plugins.gradle) did not work for me but the approach described here: #156 (comment)Instead of
+I used version15.0.1bmargevicius commentedon Dec 12, 2018
If you do the before-plugins.gradle method.
You do not have to change app.gradle from googlePlayServicesVersion = "+".
heese commentedon Dec 12, 2018
This is what I tried first but it did not work for me. I have not investigated the reasons further as I found a good-enough solution.
freddiandrew commentedon Jan 21, 2019
@heese in my case ,when using this geolocation with firebase edit the following file
node_modules/nativescript-geolocation/platform/android/include.gradle
line 15 ...? project.googlePlayServicesVersion : "11.4.0"
update to ? project.googlePlayServicesVersion : "16.+"
i put the same value because booth firebase and geolocation use the same playService from google.
project.ext {
googlePlayServicesVersion = "16.+"
}
}
i know that`s not best solution but it work for me..
velval commentedon Feb 12, 2019
@DimitarTodorov before-plugins.gradle solution works. Maybe worth changing the github documentation as I was trying to set googlePlayServicesVersion = "16.+" on the app.gradle file which is applied after the plugins configuration.
aniruddhadas9 commentedon Aug 5, 2019
Thanks @NickIliev @annadante for answers. it worked for me
codeGV commentedon Sep 10, 2020
Cool, Thats work for me