Cordova-plugin-googlemaps: cordova plugin with ionic

Created on 22 Sep 2017  路  32Comments  路  Source: mapsplugin/cordova-plugin-googlemaps

I'm submitting a ... (check one with "x")
[ ] question
[x] any problem or bug report
[ ] feature request

The plugin version: (check one with "x")
[x] 2.0-beta3 (github)
[x] 2.0 (npm)

If you choose 'problem or bug report', please select OS: (check one with "x")
[x] Android
[ ] iOS

I'm getting the following error while executing ionic cordova run android
```
import com.google.android.gms.maps.model.MapStyleOptions;
^
symbol: class MapStyleOptions

/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:282: error: cannot find symbol
map.setMinZoomPreference((float)zoom.getDouble("minZoom"));
^
symbol: method setMinZoomPreference(float)
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:285: error: cannot find symbol
map.setMaxZoomPreference((float)zoom.getDouble("maxZoom"));
^
symbol: method setMaxZoomPreference(float)
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:291: error: cannot find symbol
map.setOnCameraIdleListener(PluginMap.this);
^
symbol: method setOnCameraIdleListener(PluginMap)
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:292: error: cannot find symbol
map.setOnCameraMoveCanceledListener(PluginMap.this);
^

symbol: method setOnCameraMoveCanceledListener(PluginMap)

location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:293: error: cannot find symbol
map.setOnCameraMoveListener(PluginMap.this);
^
symbol: method setOnCameraMoveListener(PluginMap)
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:294: error: cannot find symbol
map.setOnCameraMoveStartedListener(PluginMap.this);
^
symbol: method setOnCameraMoveStartedListener(PluginMap)
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:347: error: cannot find symbol
map.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() {
^
symbol: class OnCameraIdleListener
location: class GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:366: error: cannot find symbol
map.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() {
^
symbol: class OnCameraIdleListener
location: class GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:655: error: cannot find symbol
map.setOnCircleClickListener(null);
^
symbol: method setOnCircleClickListener()
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:657: error: cannot find symbol
map.setOnCameraIdleListener(null);
^
symbol: method setOnCameraIdleListener()
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:658: error: cannot find symbol
map.setOnCameraMoveCanceledListener(null);
^
symbol: method setOnCameraMoveCanceledListener()
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:659: error: cannot find symbol
map.setOnCameraMoveListener(null);
^
symbol: method setOnCameraMoveListener()
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:734: error: cannot find symbol
String markerTag = (String) marker.getTag();
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:764: error: cannot find symbol
if ((marker.getTag() + "").startsWith("markercluster_")){
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:952: error: cannot find symbol
String markerTag = (String) marker.getTag();
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:976: error: cannot find symbol
if ((marker.getTag() + "").startsWith("markercluster_")){
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:1104: error: cannot find symbol
MapStyleOptions styleOptions = new MapStyleOptions(results.styles);
^
symbol: class MapStyleOptions
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:1104: error: cannot find symbol
MapStyleOptions styleOptions = new MapStyleOptions(results.styles);
^
symbol: class MapStyleOptions
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:1142: error: cannot find symbol
map.setMinZoomPreference((float)zoom.getDouble("minZoom"));
^
symbol: method setMinZoomPreference(float)
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:1145: error: cannot find symbol
map.setMaxZoomPreference((float)zoom.getDouble("maxZoom"));
^
symbol: method setMaxZoomPreference(float)
location: variable map of type GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:1446: error: cannot find symbol

              map.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() {
                                                       ^

symbol: class OnCameraIdleListener
location: class GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:1482: error: cannot find symbol
map.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() {
^
symbol: class OnCameraIdleListener
location: class GoogleMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:1992: error: cannot find symbol
String clusterId_markerId = marker.getTag() + "";
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2047: error: cannot find symbol
String markerTag = marker.getTag() + "";
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2060: error: cannot find symbol
if ((marker.getTag() + "").startsWith("markercluster_")){
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2072: error: cannot find symbol
if ((marker.getTag() + "").startsWith("markercluster_")){
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2084: error: cannot find symbol

if ((marker.getTag() + "").startsWith("markercluster_")){

           ^

symbol: method getTag()
location: variable marker of type Marker

/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2095: error: cannot find symbol
if ((marker.getTag() + "").startsWith("markercluster_")){
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2107: error: cannot find symbol
String markerTag = marker.getTag() + "";
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2136: error: cannot find symbol
if (marker.getTag() == null) {
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2141: error: cannot find symbol
String markerTag = (String) marker.getTag();
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2150: error: cannot find symbol
if (marker.getTag() == null) {
^

symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2155: error: cannot find symbol
String markerTag = (String) marker.getTag();
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2446: error: method does not override or implement a method from a supertype
@Override
^
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2456: error: method does not override or implement a method from a supertype
@Override
^
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2466: error: method does not override or implement a method from a supertype
@Override
^
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2475: error: method does not override or implement a method from a supertype
@Override
^
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2481: error: cannot find symbol

this.isDragging = reason == REASON_GESTURE;
                            ^

symbol: variable REASON_GESTURE
location: class PluginMap
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:2597: error: cannot find symbol
String markerTag = activeMarker.getTag() + "";
^
symbol: method getTag()
location: variable activeMarker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginCircle.java:60: error: cannot find symbol
circleOptions.clickable(false);
^
symbol: method clickable(boolean)
location: variable circleOptions of type CircleOptions
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:157: error: cannot find symbol
marker.setTag(null);
^
symbol: method setTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:249: error: cannot find symbol
markerOptions.zIndex((float) opts.getDouble("zIndex"));
^
symbol: method zIndex(float)
location: variable markerOptions of type MarkerOptions
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:275: error: cannot find symbol
marker.setTag(markerId);
^
symbol: method setTag(String)
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:810: error: cannot find symbol
if (marker == null || marker.getTag() == null) {
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:817: error: cannot find symbol
String iconCacheKey = "marker_icon_" + marker.getTag();
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:818: error: cannot find symbol
marker.setTag(null);
^
symbol: method setTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:1010: error: cannot find symbol
String markerTag = marker.getTag() + "";
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:1043: error: cannot find symbol
if (marker == null || marker.getTag() == null) {
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:1065: error: cannot find symbol
if (bitmapDescriptor == null || marker == null || marker.getTag() == null) {
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarkerCluster.java:451: error: cannot find symbol

        marker.setTag(clusterId_markerId);
              ^

symbol: method setTag(String)
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarkerCluster.java:626: error: cannot find symbol
if (marker != null && marker.getTag() != null) {
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginGroundOverlay.java:161: error: cannot find symbol
groundOverlay.setTag(null);
^
symbol: method setTag()
location: variable groundOverlay of type GroundOverlay
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginTileOverlay.java:42: error: cannot find symbol
options.transparency((float)(1 - opts.getDouble("opacity")));
^
symbol: method transparency(float)
location: variable options of type TileOverlayOptions
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.
60 errors
: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: 7.102 secs
Error: /home/renan/Code/cartdeliverapp/platforms/android/gradlew: Command failed with exit code 1 Error output:
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMap.java:52: error: cannot find symbol
import com.google.android.gms.maps.model.MapStyleOptions;
^
symbol: class MapStyleOptions
symbol: method setTag(String)
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:810: error: cannot find symbol
if (marker == null || marker.getTag() == null) {
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:817: error: cannot find symbol
String iconCacheKey = "marker_icon_" + marker.getTag();
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:818: error: cannot find symbol
marker.setTag(null);
^
symbol: method setTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:1010: error: cannot find symbol
String markerTag = marker.getTag() + "";
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:1043: error: cannot find symbol
if (marker == null || marker.getTag() == null) {
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarker.java:1065: error: cannot find symbol
if (bitmapDescriptor == null || marker == null || marker.getTag() == null) {
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarkerCluster.java:451: error: cannot find symbol
marker.setTag(clusterId_markerId);
^
symbol: method setTag(String)
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginMarkerCluster.java:626: error: cannot find symbol
if (marker != null && marker.getTag() != null) {
^
symbol: method getTag()
location: variable marker of type Marker
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginGroundOverlay.java:161: error: cannot find symbol
groundOverlay.setTag(null);
^
symbol: method setTag()
location: variable groundOverlay of type GroundOverlay
/home/renan/Code/cartdeliverapp/platforms/android/src/plugin/google/maps/PluginTileOverlay.java:42: error: cannot find symbol
options.transparency((float)(1 - opts.getDouble("opacity")));
^
symbol: method transparency(float)
location: variable options of type TileOverlayOptions
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.
60 errors

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.

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

need more information

Most helpful comment

But as requested, I provided the sample project that is not working. I can add some more code withing typescript that will use google maps plugin, but I don't think that will fix the java compilation problem which has nothing to do with the ts code ...

All 32 comments

It seems your project fails to install the Google Play Services.

Could you show me the result of $> cordova plugin list?

$> cordova plugin list
cordova-plugin-advanced-http 1.5.9 "Advanced HTTP plugin"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.7 "Console"
cordova-plugin-device 1.1.6 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-googlemaps 2.0.11 "cordova-plugin-googlemaps"
cordova-plugin-nativegeocoder 2.0.2 "NativeGeocoder"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
{}

Umm. Did you try this?
https://github.com/mapsplugin/cordova-plugin-googlemaps#if-you-cant-reinstall-the-plugin-try-like-this

If you still get the error after trying the above, please share your project files on github.

I try but not work

I can't share code

You can't share your code, I can't help you further more.

I'm having similar issue, unable to build my android application with the google maps plugin.
Error in

...\platforms\android\src\plugin\google\maps\PluginGroundOverlay.java:161: error: cannot find symbol
                  groundOverlay.setTag(null);
                               ^

Tried various methods to add/remove the plugin and platform from here: https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1579 but always fails with this groundOverlay.setTag(null) error ...

result config.xml after my cordova plugin add command (that I guess should be working):

    <plugin name="cordova-plugin-googlemaps" spec="~2.0.11">
        <variable name="API_KEY_FOR_ANDROID" value="..." />
        <variable name="API_KEY_FOR_IOS" value="..." />
    </plugin>

I'm using Ionic 3 but i don't think it's related to that.
My configuration:

Tools:
    Cordova CLI : 7.0.1
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.6.1

System:
    Android SDK Tools : 25.2.2
    Node              : v6.9.5
    npm               : 3.10.3
    OS                : Windows 10

Please share your project files on github.

Here it is:
https://github.com/peter-bozovic/IonicWithGoogleMaps

It's just starter Ionic template with googlemaps plugin added and tried to build with cordova build android

I didn't put any yet. The issue is in compiling, I can't even get to this empty page ...

Please study how to use ionic before using this plugin

I know how to use Ionic and I can't give you the source files of my whole project.

That is why I only used basic sample where I can't build the android application after adding the google maps plugin

Sorry, in that case, I can't help you further.

But as requested, I provided the sample project that is not working. I can add some more code withing typescript that will use google maps plugin, but I don't think that will fix the java compilation problem which has nothing to do with the ts code ...

I was able to build your project without any problems.

$> git clone https://github.com/peter-bozovic/IonicWithGoogleMaps
$> vim config.xml        # specify the API keys.
$> vim package.json   # specify the API keys.
$> npm install
$> ionic cordova run android

That's all.

Then it must be something with my workstation.

But I took some time to try it on another computer and it still doesn't work :(
Also I have different (stranger) compilation error

So my main workstation ionic info:

cli packages: (...\AppData\Roaming\npm\node_modules)
    @ionic/cli-utils  : 1.9.2
    ionic (Ionic CLI) : 3.9.2

global packages:
    Cordova CLI : 7.0.1

local packages:
    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.6.1

System:
    Android SDK Tools : 25.2.2
    Node              : v6.9.5
    npm               : 3.10.3 
    OS                : Windows 10

And output after ionic cordova build android:

[INFO] Running app-scripts build: --platform android --target cordova

[08:40:24]  build dev started ... 
[08:40:24]  clean started ... 
[08:40:24]  clean finished in 4 ms 
[08:40:24]  copy started ... 
[08:40:24]  transpile started ... 
[08:40:27]  transpile finished in 3.46 s 
[08:40:27]  preprocess started ... 
[08:40:27]  deeplinks started ... 
[08:40:27]  deeplinks finished in 12 ms 
[08:40:27]  preprocess finished in 14 ms 
[08:40:27]  webpack started ... 
[08:40:28]  copy finished in 3.85 s 
[08:40:34]  webpack finished in 6.78 s 
[08:40:34]  sass started ... 
[08:40:36]  sass finished in 1.67 s 
[08:40:36]  postprocess started ... 
[08:40:36]  removed unused font files 
[08:40:36]  postprocess finished in 23 ms 
[08:40:36]  lint started ... 
[08:40:36]  build dev finished in 11.98 s 
> ionic cordova prepare
> cordova prepare
[08:40:38]  lint finished in 2.19 s 
> cordova build android

[ERROR] An error occurred while running cordova build android (exit code 1):
        (truncated) ... UP-TO-DATE
        :CordovaLib:generateDebugBuildConfig UP-TO-DATE
        :CordovaLib:processDebugResources UP-TO-DATE
        :CordovaLib:generateDebugSources UP-TO-DATE
        :CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
        :CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
        :CordovaLib:processDebugJavaRes UP-TO-DATE
        :CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
        :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
        :CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
        :CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
        :CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
        :CordovaLib:bundleDebug UP-TO-DATE
        :CordovaLib:preReleaseBuild UP-TO-DATE
        :CordovaLib:checkReleaseManifest
        :CordovaLib:prepareReleaseDependencies
        :CordovaLib:compileReleaseAidl UP-TO-DATE
        :CordovaLib:compileReleaseNdk UP-TO-DATE
        :CordovaLib:copyReleaseLint UP-TO-DATE
        :CordovaLib:mergeReleaseShaders UP-TO-DATE
        :CordovaLib:compileReleaseShaders UP-TO-DATE
        :CordovaLib:generateReleaseAssets UP-TO-DATE
        :CordovaLib:mergeReleaseAssets UP-TO-DATE
        :CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
        :CordovaLib:packageReleaseRenderscript UP-TO-DATE
        :CordovaLib:compileReleaseRenderscript UP-TO-DATE
        :CordovaLib:generateReleaseResValues UP-TO-DATE
        :CordovaLib:generateReleaseResources UP-TO-DATE
        :CordovaLib:packageReleaseResources UP-TO-DATE
        :CordovaLib:processReleaseManifest UP-TO-DATE
        :CordovaLib:generateReleaseBuildConfig UP-TO-DATE
        :CordovaLib:processReleaseResources UP-TO-DATE
        :CordovaLib:generateReleaseSources UP-TO-DATE
        :CordovaLib:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
        :CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE
        :CordovaLib:processReleaseJavaRes UP-TO-DATE
        :CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
        :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
        :CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
        :CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
        :CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
        :CordovaLib:bundleRelease UP-TO-DATE
        :prepareComAndroidSupportSupportV42400Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesBase980Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesBasement980Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesLocation980Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesMaps980Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesTasks980Library UP-TO-DATE
        :prepareOrgApacheCordovaCordovaLib623DebugLibrary UP-TO-DATE
        :prepareDebugDependencies
        :compileDebugAidl UP-TO-DATE
        :compileDebugRenderscript UP-TO-DATE
        :generateDebugBuildConfig UP-TO-DATE
        :generateDebugResValues UP-TO-DATE
        :generateDebugResources UP-TO-DATE
        :mergeDebugResources UP-TO-DATE
        :processDebugManifest UP-TO-DATE
        :processDebugResources UP-TO-DATE
        :generateDebugSources UP-TO-DATE
        :incrementalDebugJavaCompilationSafeguard UP-TO-DATE
        :compileDebugJavaWithJavac
        :compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
        ...\platforms\android\src\plugin\google\maps\PluginGroundOverlay.java:161: error: cannot find symbol
                           groundOverlay.setTag(null);
                                        ^
           symbol:   method setTag(<null>)
           location: variable groundOverlay of type GroundOverlay
        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
        :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: 4.82 secs
        Error: cmd: Command failed with exit code 1 Error output:
        ...\platforms\android\src\plugin\google\maps\PluginGroundOverlay.java:161: error: cannot find symbol
                           groundOverlay.setTag(null);
                                        ^
           symbol:   method setTag(<null>)
           location: variable groundOverlay of type GroundOverlay
        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 ':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.

Secondary computer tested ionic info :

cli packages: (...\AppData\Roaming\npm\node_modules)
    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:
    cordova (Cordova CLI) : 7.0.1

local packages:
    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.6.1

System:
    Android SDK Tools : 25.2.5
    Node              : v6.9.5
    npm               : 3.10.10 
    OS                : Windows 10

And output after ionic cordova build android:

[INFO] Running app-scripts build: --platform android --target cordova

[08:39:50]  build dev started ... 
[08:39:50]  clean started ... 
[08:39:50]  clean finished in 10 ms 
[08:39:50]  copy started ... 
[08:39:50]  transpile started ... 
[08:39:55]  transpile finished in 4.18 s 
[08:39:55]  preprocess started ... 
[08:39:55]  deeplinks started ... 
[08:39:55]  deeplinks finished in 6 ms 
[08:39:55]  preprocess finished in 7 ms 
[08:39:55]  webpack started ... 
[08:39:55]  copy finished in 4.59 s 
[08:40:02]  webpack finished in 7.73 s 
[08:40:02]  sass started ... 
[08:40:04]  sass finished in 1.72 s 
[08:40:04]  postprocess started ... 
[08:40:04]  removed unused font files 
[08:40:04]  postprocess finished in 29 ms 
[08:40:04]  lint started ... 
[08:40:04]  build dev finished in 13.76 s 
> ionic cordova prepare android
> cordova prepare android
[08:40:07]  lint finished in 2.51 s 

> cordova build android
[ERROR] An error occurred while running cordova build android (exit code 1):
        (truncated) ... CordovaLib:generateDebugResources UP-TO-DATE
        :CordovaLib:packageDebugResources UP-TO-DATE
        :CordovaLib:processDebugManifest UP-TO-DATE
        :CordovaLib:generateDebugBuildConfig UP-TO-DATE
        :CordovaLib:processDebugResources UP-TO-DATE
        :CordovaLib:generateDebugSources UP-TO-DATE
        :CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
        :CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
        :CordovaLib:processDebugJavaRes UP-TO-DATE
        :CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
        :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
        :CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
        :CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
        :CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
        :CordovaLib:bundleDebug UP-TO-DATE
        :CordovaLib:preReleaseBuild UP-TO-DATE
        :CordovaLib:checkReleaseManifest
        :CordovaLib:prepareReleaseDependencies
        :CordovaLib:compileReleaseAidl UP-TO-DATE
        :CordovaLib:compileReleaseNdk UP-TO-DATE
        :CordovaLib:copyReleaseLint UP-TO-DATE
        :CordovaLib:mergeReleaseShaders UP-TO-DATE
        :CordovaLib:compileReleaseShaders UP-TO-DATE
        :CordovaLib:generateReleaseAssets UP-TO-DATE
        :CordovaLib:mergeReleaseAssets UP-TO-DATE
        :CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
        :CordovaLib:packageReleaseRenderscript UP-TO-DATE
        :CordovaLib:compileReleaseRenderscript UP-TO-DATE
        :CordovaLib:generateReleaseResValues UP-TO-DATE
        :CordovaLib:generateReleaseResources UP-TO-DATE
        :CordovaLib:packageReleaseResources UP-TO-DATE
        :CordovaLib:processReleaseManifest UP-TO-DATE
        :CordovaLib:generateReleaseBuildConfig UP-TO-DATE
        :CordovaLib:processReleaseResources UP-TO-DATE
        :CordovaLib:generateReleaseSources UP-TO-DATE
        :CordovaLib:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
        :CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE
        :CordovaLib:processReleaseJavaRes UP-TO-DATE
        :CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
        :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
        :CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
        :CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
        :CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
        :CordovaLib:bundleRelease UP-TO-DATE
        :prepareComAndroidSupportSupportV42400Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesBase980Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesBasement980Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesLocation980Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesMaps980Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesTasks980Library UP-TO-DATE
        :prepareOrgApacheCordovaCordovaLib623DebugLibrary UP-TO-DATE
        :prepareDebugDependencies
        :compileDebugAidl UP-TO-DATE
        :compileDebugRenderscript UP-TO-DATE
        :generateDebugBuildConfig UP-TO-DATE
        :generateDebugResValues UP-TO-DATE
        :generateDebugResources UP-TO-DATE
        :mergeDebugResources
        Error: Failed to crunch file ...\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\9.8.0\res\drawable-mdpi-v4\common_google_signin_btn_text_light_disabled.9.png into ...\platforms\android\build\intermediates\res\merged\debug\drawable-mdpi-v4\common_google_signin_btn_text_light_disabled.9.png
        :mergeDebugResources FAILED

        FAILURE: Build failed with an exception.

        * What went wrong:
        Execution failed for task ':mergeDebugResources'.
        > Error: Failed to crunch file ...\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\9.8.0\res\drawable-mdpi-v4\common_google_signin_btn_text_light_disabled.9.png into ...\platforms\android\build\intermediates\res\merged\debug\drawable-mdpi-v4\common_google_signin_btn_text_light_disabled.9.png

        * 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: 4.538 secs
        Error: cmd: Command failed with exit code 1 Error output:
        FAILURE: Build failed with an exception.

        * What went wrong:
        Execution failed for task ':mergeDebugResources'.
        > Error: Failed to crunch file ...\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\9.8.0\res\drawable-mdpi-v4\common_google_signin_btn_text_light_disabled.9.png into ...\platforms\android\build\intermediates\res\merged\debug\drawable-mdpi-v4\common_google_signin_btn_text_light_disabled.9.png

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

Again, if I remove the cordova-plugin-googlemaps my application compiles correctly (on both computers).

Am I missing some other package or SDK that I have to install on my computer ?
Are you also using cordova 7.0.1 and android 25 for your build that worked ?

Any help will be appriciated
Thanks

screen shot 2017-09-26 at 12 14 02 am

screen shot 2017-09-26 at 12 15 16 am
screen shot 2017-09-26 at 12 15 20 am

I guess your Google Play Services and Google Repository are old.

Yep, upgraded Google Play Services and Google Repository.
After that, my main computer had the same error message as the second one (strange merge error)

So after googling that error found some limitation about folder names longer than 240 characters, etc.
After copying the project to the root of my drive, it finally compiled :)

So I can finally start some playing with the google maps plugin :)

Thanks again

I have updated both Google Play Services and Google Repository in my skd manager. But I get the same error. Details about error log:

C:\Users\vahidnajafi\myProject\platforms\android\app\src\main\java\plugin\google\maps\PluginMap.java:2194: error: cannot find symbol
    String overlayId = groundOverlay.getTag() + "";
                                    ^
  symbol:   method getTag()
  location: variable groundOverlay of type GroundOverlay
C:\Users\vahidnajafi\myProject\platforms\android\app\src\main\java\plugin\google\maps\PluginGroundOverlay.java:113: error: cannot find symbol
        groundOverlay.setTag("groundoverlay_" + idBase);
                     ^
  symbol:   method setTag(String)
  location: variable groundOverlay of type GroundOverlay
C:\Users\vahidnajafi\myProject\platforms\android\app\src\main\java\plugin\google\maps\PluginGroundOverlay.java:169: error: cannot find symbol
                  groundOverlay.setTag(null);
                               ^
  symbol:   method setTag(<null>)
  location: variable groundOverlay of type GroundOverlay
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.
3 errors
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
27 actionable tasks: 1 executed, 26 up-to-date
> 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 1m 10s
(node:5312) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
C:\Users\vahidnajafi\myProject\platforms\android\app\src\main\java\plugin\google\maps\PluginMap.java:2194: error: cannot find symbol
    String overlayId = groundOverlay.getTag() + "";
                                    ^
  symbol:   method getTag()
  location: variable groundOverlay of type GroundOverlay
C:\Users\vahidnajafi\myProject\platforms\android\app\src\main\java\plugin\google\maps\PluginGroundOverlay.java:113: error: cannot find symbol
        groundOverlay.setTag("groundoverlay_" + idBase);
                     ^
  symbol:   method setTag(String)
  location: variable groundOverlay of type GroundOverlay
C:\Users\vahidnajafi\myProject\platforms\android\app\src\main\java\plugin\google\maps\PluginGroundOverlay.java:169: error: cannot find symbol
                  groundOverlay.setTag(null);
                               ^
  symbol:   method setTag(<null>)
  location: variable groundOverlay of type GroundOverlay
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.
3 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 1m 10s

So what version of Google Play Services did you install?

@wf9a5m75 It's 46.

Did you modify the plugin.xml file of this plugin? And please show me the $> cordova plugin list everything.

@wf9a5m75 Oh sorry, it seems I have had some connection problems yesterday. Now it works fine.

I have updated Google Play Services but I get this output when I try to build.

 BUILD FAILED

Total time: 26.223 secs
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.
(node:4592) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
C:\Users\###\Documents\GitHub\ionic_proj\###\platforms\android\src\plugin\google\maps\PluginMap.java:84: error: cannot find symbol
    GoogleMap.OnInfoWindowLongClickListener, GoogleMap.OnInfoWindowCloseListener, GoogleMap.OnMyLocationClickListener, GoogleMap.OnPoiClickListener {
                                                                                           ^
  symbol:   class OnMyLocationClickListener
  location: class GoogleMap
C:\Users\###\Documents\GitHub\ionic_proj\###\platforms\android\src\plugin\google\maps\PluginMap.java:335: error: cannot find symbol
              map.setOnMyLocationClickListener(PluginMap.this);
                 ^
  symbol:   method setOnMyLocationClickListener(PluginMap)
  location: variable map of type GoogleMap
C:\Users\###\Documents\GitHub\ionic_proj\###\platforms\android\src\plugin\google\maps\PluginMap.java:763: error: cannot find symbol
                  map.setOnMyLocationClickListener(null);
                     ^
  symbol:   method setOnMyLocationClickListener(<null>)
  location: variable map of type GoogleMap
C:\Users\###\Documents\GitHub\ionic_proj\###\platforms\android\src\plugin\google\maps\PluginMap.java:2490: 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 ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

My cordova version is 8.0.0
My ionic info:

ionic info

cli packages: (C:\Users\###\AppData\Roaming\npm\node_modules)

    @ionic/cli-plugin-proxy : 1.5.6
    @ionic/cli-utils        : 1.19.1
    ionic (Ionic CLI)       : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v9.4.0
    npm               : 5.6.0
    OS                : Windows 7

Environment Variables:

    ANDROID_HOME     : C:\Users\###\AppData\Local\Android\sdk

Misc:

    backend : legacy

My plugin list:

cordova-plugin-device 1.1.7 "Device"
cordova-plugin-googlemaps 2.2.2 "cordova-plugin-googlemaps"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"

What am I missing?

@obbe79 Please do not add comment to closed thread that is non related issue. Please make another issue with your project files that is shared on github.

@wf9a5m75 i am facing the same error @obbe79 mentioned.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BTW18 picture BTW18  路  3Comments

melkir picture melkir  路  5Comments

bigbossmaher picture bigbossmaher  路  3Comments

Tong2203 picture Tong2203  路  5Comments

sebagon picture sebagon  路  4Comments