Ionic build android fail google maps PluginUtil.java cannot access AbstractSafeParcelable

Hello everyone, i’m getting an error on android build, not ios.
Everything look fine but when I make

ionic build android

It return this

:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).

/XXX/platforms/android/src/plugin/google/maps/PluginUtil.java:135: error: cannot access AbstractSafeParcelable

    Builder builder = LatLngBounds.builder();
                                  ^
  class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.
1 error

:compileDebugJavaWithJavac 
FAILED



FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':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.


BUILD FAILED




Total time: 22.331 secs

Error: /XXX/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.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/XXX/platforms/android/src/plugin/google/maps/PluginUtil.java:135: error: cannot access AbstractSafeParcelable
    Builder builder = LatLngBounds.builder();
                                  ^
  class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

FAILURE: Build failed with an exception.

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

Here goes some information

Your system information:

Cordova CLI: 6.4.0 
Ionic CLI Version: 2.1.14
Ionic App Lib Version: 2.1.7
ios-deploy version: 1.9.0 
ios-sim version: 5.0.8 
OS: macOS Sierra
Node Version: v7.2.1
Xcode version: Xcode 8.2.1 Build version 8C1002

And plugins installed

com.googlemaps.ios 2.1.1 "Google Maps SDK for iOS"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-dialogs 1.3.0 "Notification"
cordova-plugin-email-composer 0.8.3 "EmailComposer"
cordova-plugin-facebook4 1.7.4 "Facebook Connect"
cordova-plugin-geolocation 2.3.0 "Geolocation"
cordova-plugin-googlemaps 1.4.0 "phonegap-googlemaps-plugin"
cordova-plugin-inappbrowser 1.5.0 "InAppBrowser"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.2.2 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
onesignal-cordova-plugin 2.0.8 "OneSignal Push Notifications"

Hope someone can help me.
Thanks in advance

1 Like

Hi @Sir_Tesla,

I had the same issue. Turns out the google maps plugin is pinning a specific version of google play services which causes it to conflict with other plugins which also use google play services but with the latest version.

Mine was because of the background geolocation plugin.

1 Like