簡體   English   中英

Cordova 5建築物同時使用坡度/螞蟻引發Java編譯錯誤

[英]Cordova 5 building using both grade/ant throwing java compile errors

安裝了Android SDK Manager中列出的所有工具。

JAVA_HOME指向jdk7

GRADLE_HOME,ANT_HOME和ANDROID_HOME是其他正確配置的環境變量。

已經嘗試刪除並再次將平台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

我正在使用cordova 5.0.0

升級到5.1.1 npm update -g cordova ,然后使用從項目中刪除android

cordova platform remove android

然后再次添加android

cordova platform add android

工作正常。 同時,我還安裝了API22,因此這兩個原因之一或兩者均是造成此問題的原因。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM