Ionic pro build fail cordova-plugin

After adding cordova-plugin to my project I am getting the following error. None of the possible solutions that I tried worked for me.

/usr/src/app/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:86: error: cannot find symbol
    GoogleMap.OnInfoWindowLongClickListener, GoogleMap.OnInfoWindowCloseListener, GoogleMap.OnMyLocationClickListener, GoogleMap.OnPoiClickListener {
                                                                                           ^
  symbol:   class OnMyLocationClickListener
  location: class GoogleMap
/usr/src/app/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:337: error: cannot find symbol
              map.setOnMyLocationClickListener(PluginMap.this);
                 ^
  symbol:   method setOnMyLocationClickListener(PluginMap)
  location: variable map of type GoogleMap
/usr/src/app/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:768: error: cannot find symbol
                  map.setOnMyLocationClickListener(null);
                     ^
  symbol:   method setOnMyLocationClickListener()
  location: variable map of type GoogleMap
/usr/src/app/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:2500: error: method does not override or implement a method from a supertype
  @Override
  ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 22s
27 actionable tasks: 27 executed
Error: /usr/src/app/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/usr/src/app/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:86: error: cannot find symbol
    GoogleMap.OnInfoWindowLongClickListener, GoogleMap.OnInfoWindowCloseListener, GoogleMap.OnMyLocationClickListener, GoogleMap.OnPoiClickListener {
                                                                                           ^
  symbol:   class OnMyLocationClickListener
  location: class GoogleMap
/usr/src/app/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:337: error: cannot find symbol
              map.setOnMyLocationClickListener(PluginMap.this);
                 ^
  symbol:   method setOnMyLocationClickListener(PluginMap)
  location: variable map of type GoogleMap
/usr/src/app/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:768: error: cannot find symbol
                  map.setOnMyLocationClickListener(null);
                     ^
  symbol:   method setOnMyLocationClickListener()
  location: variable map of type GoogleMap
/usr/src/app/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:2500: error: method does not override or implement a method from a supertype
  @Override
  ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 22s
cordova build android failed
Running after script...
$ run "clean-up"
Running Stage clean-up for Job: 5345523
ERROR: Job failed: exit status 1

One of the plugins you installed specified older Google Play Services SDK, but the maps plugin requires 11.8.0.

Check out the platform/android/app/build.prop file, and make sure all versions of Google Play Services SDK are 11.8.0, not 11.+ or 11.2.+.

1 Like