离子编译错误:无法找到符号导入android.webkit.ClientCertRequest;

时间:2015-11-06 19:44:17

标签: android cordova ionic android-sdk-tools

当我尝试ionic build android

时,无法在ubuntu上编译我的应用

我的AndroidManifest.xml

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="19" />

我的Project.Properties

target=android-19
android.library.reference.1=CordovaLib

我的错误:

:CordovaLib:compileDebugJava/home/fernando/Dropbox/Code/Kelps/KelpsApp/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
/home/fernando/Dropbox/Code/Kelps/KelpsApp/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:32: error: cannot find symbol
    private final ClientCertRequest request;

symbol:   class ClientCertRequest
  location: class CordovaClientCertRequest
/home/fernando/Dropbox/Code/Kelps/KelpsApp/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:34: error: cannot find symbol
    public CordovaClientCertRequest(ClientCertRequest request) {
                                    ^
  symbol:   class ClientCertRequest
  location: class CordovaClientCertRequest
/home/fernando/Dropbox/Code/Kelps/KelpsApp/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java:29: error: cannot find symbol
import android.webkit.ClientCertRequest;

[...]

symbol:   variable LOLLIPOP
  location: class VERSION_CODES
/home/fernando/Dropbox/Code/Kelps/KelpsApp/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
/home/fernando/Dropbox/Code/Kelps/KelpsApp/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
/home/fernando/Dropbox/Code/Kelps/KelpsApp/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java:250: 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.
14 errors
 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.

使用https://blog.nraboy.com/2014/09/install-android-cordova-ionic-framework-ubuntu/

安装离子环境

已经尝试删除平台并再次添加平台。

有人之前遇到过这个错误吗?

谢谢!

1 个答案:

答案 0 :(得分:2)

android.webkit.ClientCertRequest,此类要求API等级21或更高。 android:targetSdkVersiontarget应为21或更高。 一种方法是安装API 21或更高版本。另一种方法是通过运行ionic platforms add android@3.6.4来添加旧版Android平台。 现在命令ionic build android将起作用。