Problem with analytics for generate .apk

Hey guys I’m install the plugin for analytics, but I have an error when I try to generate an apk.

This error:
FAILURE: Build failed with an exception.

* Where:
Build file '[app_folder]\platforms\android\build.gradle' line: 259

* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not get unknown property 'GMS_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Build file '[app_folder]\platforms\android\build.gradle' line: 259

* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not get unknown property 'GMS_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Picked up _JAVA_OPTIONS: -Xmx512M

[ERROR] An error occurred while running cordova build android (exit code 1).
1 Like

same error :frowning: it compiles fine 1 month ago

What is your ionic info output?

I solve this problem.
Steps:
1- Go to [app_folder]\platforms\android\project.properties
2- find GMS_VERSION
3- change to [11.0.1] => this number is my version, I see this in config.xml

cordova.system.library.4=com.google.android.gms:play-services-analytics:11.0.1

1 Like