question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build error: cannot find symbol

See original GitHub issue

I’m submitting a … (check one with “x”)

  • question
  • any problem or bug report
  • feature request

If you choose ‘problem or bug report’, please select OS: (check one with “x”)

  • Android
  • iOS

cordova information: (run $> cordova plugin list)

cordova-plugin-device 2.0.1 "Device"
cordova-plugin-googlemaps 2.2.2 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

    @ionic-native/core": "4.4.0",
    @ionic-native/google-maps": "^4.5.3",

My Ionic Info

cli packages: 

    @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  : 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

Current behavior: Blank IONIC app won’t ionic cordova run android with cordova-plugin-googlemaps. It runs smoothly without the cordova-plugin-googlemaps.

Steps:

> ionic start geoTest blank > cd geoTest > ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="mykey" > npm install --save @ionic-native/google-maps > ionic cordova platform add android@6.2.3 > ionic cordova run android

Expected behavior: Build

Related code, data or error log (please format your code or data):

BUILD FAILED

Total time: 13.016 secs
(node:7056) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
C:\Users\user\Documents\GitHub\ionic_proj\geoTest\platforms\android\src\plugin\google\maps\PluginMap.java:84: error:
cannot find symbol
    GoogleMap.OnInfoWindowLongClickListener, GoogleMap.OnInfoWindowCloseListener, GoogleMap.OnMyLocationClickListener, G
oogleMap.OnPoiClickListener {
                                                                                           ^
  symbol:   class OnMyLocationClickListener
  location: class GoogleMap
C:\Users\user\Documents\GitHub\ionic_proj\geoTest\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\user\Documents\GitHub\ionic_proj\geoTest\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\user\Documents\GitHub\ionic_proj\geoTest\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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

10reactions
battikacommented, Feb 7, 2018

Guys, as a workaround all you need to do is clone the OneSignal-Cordova-SDK plugin and in the build-extras-onesignal.gradle file change the com.google.android.gms and com.google.firebase dependencies like this:

def versionGroupAligns = [
    // ### Google Play Services library
    'com.google.android.gms': [
        'version': '11.8.+'
    ],

    // ### Google Firebase library
    // Although not used by OneSignal Firebase has some dependencies on gms
    // If present, ensuring they are aligned
    'com.google.firebase': [
        'version': '11.8.+'
    ],
...

Then, reinstall the OneSignal plugin from your filesystem.

I know it is not ideal but works for me. Hope OneSignal will use the latest Play Services version in their next release. I created an issue in their repo: https://github.com/OneSignal/OneSignal-Cordova-SDK/issues/297

I did not have time to dig deeper how this issue can be resolved in a more elegant way but if you do I’ll be more than happy if you let me know.

1reaction
kodeinecommented, Feb 22, 2018

i am facing the same issue, i tried changing to 11.8.0 but it doesnt help. any work around?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Resolve The Cannot Find Symbol Error in Java
As its name implies, the cannot find symbol error refers to a symbol which cannot be found. While there are multiple ways and...
Read more >
java - What does a "Cannot find symbol" or "Cannot resolve ...
A "Cannot find symbol" error means that the compiler cannot do this. Your code appears to be referring to something that the compiler...
Read more >
What can cause the "cannot find symbol" error in Java?
The “cannot find symbol” error occurs mainly when we try to reference a variable that is not declared in the program which we...
Read more >
"Cannot Find Symbol" compile error
The "Cannot find symbol" errors generally occur when you try to reference an undeclared variable in your code. A "Cannot find symbol" error...
Read more >
The “Cannot find symbol” Compilation Error
As the name suggests, the Java cannot find symbol error occurs when a required symbol cannot be found in the symbol table. Although...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found