Ionic package: error when building in ionic cloud


#1

Yesterday morning, cloud packaging was working just fine (ionic package build android --profile [my profile name] --release).

Today I received this issue that a few others had as well:

I upgraded to cordova-android 6.2.3 as requested and it seems to have worked, except now a new error pops up:

:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/home/package/workspace/[my app]/cordova/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.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:compileReleaseJavaWithJavac’.

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: 2.698 secs
Error: /home/package/workspace/[my app]/cordova/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.
/home/package/workspace/[my app]/cordova/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.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:compileReleaseJavaWithJavac’.

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.

Google Maps has had an issue for a long time involving the project.properties file (this appears to be the same issue). The fix for this has always been simple enough, simply changing the instances of “9.8.0” to “+” in platforms/android/project.properties as outlined here:

http://masteringionic.com/blog/2017-05-24-fixing-googlemaps-android-build-error-with-abstractsafeparcelable-not-found-message/

With this fix it builds locally just fine, this is a fix that I’ve had to use for about 6 months now and have never had an issue with “package build” either. The above error only happens with “package build,” I’m guessing my project.properties file is not being reflected. Anyone know why this is popping up all of a sudden?

I’ve contacted customer support about this and have not received a response.

Thank you


#2

More context for reference:

As far as I can tell, the cordova-plugin-googlemaps dev pinned their play-services dependency to 9.8.0 which causes compatibility issues. This is an easy fix locally as all you have to do is change the platforms/android/project.properties from

cordova.system.library.2=com.google.android.gms:play-services-maps:9.8.0
cordova.system.library.3=com.google.android.gms:play-services-location:9.8.0

(etc for whatever play-services are in the properties) to

cordova.system.library.2=com.google.android.gms:play-services-maps:+ cordova.system.library.3=com.google.android.gms:play-services-location:+

or, alternatively, to 10.0.0 or something higher.

Easy for me locally but it doesn’t look like I have any control over that when I’m trying to ionic package build in the ionic-cloud, do I? I’m almost certain this is the issue but I’m not sure what I can do about it.


#3

Fork the plugin, make the changes, install it via your Git repo.


#4

A post was split to a new topic: Ionic Package: Execution failed for task ‘:processDebugManifest’