kumbe / Phonegap-ZoomControl

Plugin for enable the native zoom control on phonegap
Apache License 2.0
8 stars 14 forks source link

Android app fails to build on Phonegap #8

Open ivellios1988 opened 8 years ago

ivellios1988 commented 8 years ago

This plugin causes some issues when compiling Android apps on Phonegap:

-compile: [javac] Compiling 20 source files to /project/bin/classes [javac] /project/src/com/kumbe/phonegap/zoom/ZoomControl/ZoomControl.java:22: error: incompatible types [javac] final WebView webView = this.webView; [javac] ^ [javac] required: WebView [javac] found: CordovaWebView [javac] /project/src/com/kumbe/phonegap/zoom/ZoomControl/ZoomControl.java:51: error: incompatible types [javac] final WebView webView = this.webView; [javac] ^ [javac] required: WebView [javac] found: CordovaWebView [javac] /project/src/com/kumbe/phonegap/zoom/ZoomControl/ZoomControl.java:69: error: incompatible types [javac] final WebView webView = this.webView; [javac] ^ [javac] required: WebView [javac] found: CordovaWebView [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] 3 errors

starmindfr commented 8 years ago

same issue, seems there is a "fix" on the repository. In fact it's ok with old phonegap build but not with CLI where the name of webview component is not good, and the fix seems not included for phonegap "build" on release 1.7.0 ?

oorabi commented 8 years ago

Same Issue

starmindfr commented 8 years ago

We need someone to merge the fix in order to have the plugin working without any extra works ... i dont understand how to add a new plugin for free on phonegap so we need author of this to validate the fix

oorabi commented 8 years ago

Solution As Following: in the file : plugins\com.kumbe.phonegap.zoom.zoomcontrol\src\android\com\kumbe\phonegap\zoom\ZoomControl.java

Add import org.apache.cordova.CordovaWebView;

replace final WebView webView = this.webView; by final WebView webView = ((WebView)this.webView.getEngine().getView());

kumbe commented 8 years ago

version 0.1.8 now is available, thanks for your contribution

starmindfr commented 8 years ago

Working fine with latest phonegap Build Cli, thanks!