[英]Cordova 5 building using both grade/ant throwing java compile errors
Installed all Tools listed in Android SDK Manager. 安装了Android SDK Manager中列出的所有工具。
JAVA_HOME points to jdk7 JAVA_HOME指向jdk7
GRADLE_HOME, ANT_HOME, ANDROID_HOME are the other properly configured environment variables. GRADLE_HOME,ANT_HOME和ANDROID_HOME是其他正确配置的环境变量。
Already tried removing & adding again platform android
to cordova project. 已经尝试删除并再次将平台
android
添加到cordova项目。
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\CordovaClientCertRequest.java:25: error: cannot find symbol
import android.webkit.ClientCertRequest;
^
symbol: class ClientCertRequest
location: package android.webkit
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\CordovaClientCertRequest.java:32: error: cannot find symbol
private final ClientCertRequest request;
^
symbol: class ClientCertRequest
location: class CordovaClientCertRequest
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\CordovaClientCertRequest.java:34: error: cannot find symbol
public CordovaClientCertRequest(ClientCertRequest request) {
^
symbol: class ClientCertRequest
location: class CordovaClientCertRequest
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemWebChromeClient.java:251: error: cannot find symbol
public boolean onShowFileChooser(WebView webView, final ValueCallback<Uri[]>
filePathsCallback, final WebChromeClient.FileChooserParams fileChooserParams) {
^
symbol: class FileChooserParams
location: class WebChromeClient
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemWebViewClient.java:29: error: cannot find symbol
import android.webkit.ClientCertRequest;
^
symbol: class ClientCertRequest
location: package android.webkit
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemWebViewClient.java:116: error: cannot find symbol
public void onReceivedClientCertRequest (WebView view, ClientCertRequest req
uest)
^
symbol: class ClientCertRequest
location: class SystemWebViewClient
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemWebChromeClient.java:249: error: cannot find symbol
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
^
symbol: variable LOLLIPOP
location: class VERSION_CODES
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemCookieManager.java:37: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
^
symbol: variable LOLLIPOP
location: class VERSION_CODES
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemCookieManager.java:38: error: cannot find symbol
cookieManager.setAcceptThirdPartyCookies(webView, true);
^
symbol: method setAcceptThirdPartyCookies(WebView,boolean)
location: variable cookieManager of type CookieManager
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemCookieManager.java:59: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
^
symbol: variable LOLLIPOP
location: class VERSION_CODES
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemCookieManager.java:60: error: cannot find symbol
cookieManager.flush();
^
symbol: method flush()
location: variable cookieManager of type CookieManager
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemWebChromeClient.java:257: error: cannot find symbol
Uri[] result = WebChromeClient.FileChooserParams.parseResult
(resultCode, intent);
^
symbol: variable FileChooserParams
location: class WebChromeClient
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemWebChromeClient.java:250: error: method does not ov
erride or implement a method from a supertype
@Override
^
C:\Users\Pratik\Documents\routeplannerfront\platforms\android\CordovaLib\src\org
\apache\cordova\engine\SystemWebViewClient.java:114: error: method does not over
ride 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.
14 errors
:CordovaLib:compileDebugJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:compileDebugJava'.
> 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: 6.446 secs
I was using cordova 5.0.0 我正在使用cordova 5.0.0
After upgrading it to 5.1.1 npm update -g cordova
& then removing android from project using 升级到5.1.1
npm update -g cordova
,然后使用从项目中删除android
cordova platform remove android
and then adding android again 然后再次添加android
cordova platform add android
worked fine. 工作正常。 In the meantime, I also installed API22 so either one of these or both were responsible for the issue.
同时,我还安装了API22,因此这两个原因之一或两者均是造成此问题的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.