Build fail after add cordova plugin.google.maps


#1

Hello community a better framework for hybrid apps!

I need some help.

i try to integrate plugin.google.maps using this tutorial https://github.com/wf9a5m75/ionic_test
and after install plugin and run “ionic build android” i get this exception

:compileDebugJava/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/GoogleMaps.java:126: error: cannot find symbol
    root = (ViewGroup) webView.getParent();
                              ^
  symbol:   method getParent()
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/GoogleMaps.java:184: error: cannot find symbol
          webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
                 ^
  symbol:   method setLayerType(int,<null>)
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/GoogleMaps.java:193: error: cannot find symbol
          webView.setBackgroundColor(0);
                 ^
  symbol:   method setBackgroundColor(int)
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/GoogleMaps.java:781: error: cannot find symbol
    webView.setVisibility(View.GONE);
           ^
  symbol:   method setVisibility(int)
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/GoogleMaps.java:861: error: cannot find symbol
          divTop - webView.getScrollY(), 
                          ^
  symbol:   method getScrollY()
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/GoogleMaps.java:863: error: cannot find symbol
          divTop + divH - webView.getScrollY());
                                 ^
  symbol:   method getScrollY()
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:52: error: cannot find symbol
    this.root = (ViewGroup) webView.getParent();
                                   ^
  symbol:   method getParent()
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:54: error: cannot find symbol
    webView.setBackgroundColor(Color.TRANSPARENT);
           ^
  symbol:   method setBackgroundColor(int)
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:56: error: cannot find symbol
      webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
             ^
  symbol:   method setLayerType(int,<null>)
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:129: error: cannot find symbol
    int scrollY = webView.getScrollY();
                         ^
  symbol:   method getScrollY()
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:177: error: incompatible types: CordovaWebView cannot be converted to View
    frontLayer.removeView(webView);
                          ^
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:188: error: incompatible types: CordovaWebView cannot be converted to View
    root.addView(webView);
                 ^
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:194: error: cannot find symbol
    scrollView.scrollTo(webView.getScrollX(), webView.getScrollY());
                               ^
  symbol:   method getScrollX()
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:194: error: cannot find symbol
    scrollView.scrollTo(webView.getScrollX(), webView.getScrollY());
                                                     ^
  symbol:   method getScrollY()
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:208: error: no suitable method found for removeView(CordovaWebView)
    root.removeView(webView);
        ^
    method ViewManager.removeView(View) is not applicable
      (argument mismatch; CordovaWebView cannot be converted to View)
    method ViewGroup.removeView(View) is not applicable
      (argument mismatch; CordovaWebView cannot be converted to View)
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:215: error: incompatible types: CordovaWebView cannot be converted to View
    frontLayer.addView(webView);
                       ^
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:252: error: cannot find symbol
        webView.requestFocus(View.FOCUS_DOWN);
               ^
  symbol:   method requestFocus(int)
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:257: error: cannot find symbol
      int scrollY = webView.getScrollY();
                           ^
  symbol:   method getScrollY()
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:283: error: cannot find symbol
        webView.requestFocus(View.FOCUS_DOWN);
               ^
  symbol:   method requestFocus(int)
  location: variable webView of type CordovaWebView
/Volumes/Archive/projects/mq/platforms/android/src/plugin/google/maps/MyPluginLayout.java:294: error: cannot find symbol
      int scrollY = webView.getScrollY();
                           ^
  symbol:   method getScrollY()
  location: variable webView of type CordovaWebView
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
20 errors
 FAILED

What’s wrong? Thank’s!


Using google maps cordova plugin
#2

Hmm did you add the plugin after adding the android project?
You may need to do this

ionic platform rm android
ionic platform add android

#3

Yep.
And i get ionic-test app from https://github.com/wf9a5m75/ionic_test
step-by-step. as result i see map on ios emulator but it’s blank on android


#4

Hi, I get get this error after added the crosswalk browser ionic browser add crosswalk, https://github.com/wf9a5m75/phonegap-googlemaps-plugin/issues/302#issuecomment-87138144, I updated everything and I want to try to target android 21 but when I run the command it always add Android SDK API 19, any idea?
I also added this to my config.xml

Adding crosswalk browser

Downloaded cordova-crosswalk-engine

Downloaded Cordova Android for Crosswalk

Downloaded Crosswalk webviews

Fetching Android SDK API 19.1.0


#5

Was this ever resolved? I too am getting the same errors…38 of them and then the build fails. Driving me nuts as I have searched 20 diff times for this error and haven’t really come across any useful info to help me understand what is going on.


#6

…and I removed the platform android and re-added it, still getting the same results/errors.


#7

Ok, I did the following:

cordova plugim rm plugin.google.maps
cordova plugin rm com.google.playservices
cordova plugin add https://github.com/wf9a5m75/google-play-services#v23
cordova plugin add plugin.google.maps --variable API_KEY_FOR_ANDROID=“YOUR_ANDROID_API_KEY_IS_HERE” --variable API_KEY_FOR_IOS=“YOUR_IOS_API_KEY_IS_HERE”

And that reduced my errors from 38 down to 24.

These are the two primary errors now, about 12 from each .java file:

C:\Users\RPO\Documents\Developer\MobileApp\lust\platforms\android\src\plugin\google\maps\GoogleMaps.java:881: error: cannot find symbol
divTop + divH - webView.getScrollY());
^
symbol: method getScrollY()
location: variable webView of type CordovaWebView
C:\Users\RPO\Documents\Developer\MobileApp\lust\platforms\android\src\plugin\google\maps\MyPluginLayout.java:53: error: cannot find symbol
this.root = (ViewGroup) webView.getParent();

And my relevant plugins:
android.support.v4 21.0.1 "Android Support v4"
com.google.playservices 23.0.0 "Google Play Services for Android
com.jamiestarke.webviewdebug 1.0.8 "WebView Debug"
com.ludei.webview.plus 2.4.3 “Webview+”