有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java在从cordova安卓编译CordovaLib时找不到符号ClientCertRequest

我目前正在使用以下工具版本构建PhoneGap应用程序:

  • npm@2.5.1
  • cordova@3.6.0-0.2.9
  • cordova-安卓@3.6.0


为了安装需要cordova-安卓v4+的插件,我尝试安装:

  • cordova@5.1.1
  • cordova-安卓@4.0.2


但是,cordova build命令不再有效。以下是引用编译错误的第一行:

Running: /Users/Pierre/Documents/project/platforms/安卓/gradlew cdvBuildDebug -b /Users/Pierre/Documents/project/platforms/安卓/build.gradle -Dorg.gradle.daemon=true
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJava
/Users/Pierre/Documents/project/platforms/安卓/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:25: error: cannot find symbol
import 安卓.webkit.ClientCertRequest;
                     ^
  symbol:   class ClientCertRequest
  location: package 安卓.webkit
/Users/Pierre/Documents/project/platforms/安卓/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:32: error: cannot find symbol
    private final ClientCertRequest request;
                  ^
  symbol:   class ClientCertRequest
  location: class CordovaClientCertRequest


据我所知,the ClientCertRequest symbol has been introduced by the Android API level 21和我的cordova build正在尝试使用较旧的级别进行编译

我试图强制使用API级别21

文件/Users/Pierre/Documents/project/platforms/安卓/CordovaLib/project.properties包含以下内容:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.

# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=安卓-19
apk-configurations=
renderscript.opt.level=O0
安卓.library=true

因此,我尝试创建一个同级文件ant.properties,其中包含:

target=安卓-21

但这并没有改变任何事情

我还尝试了一系列其他的修改,这些修改太长,无法在这里描述,但最终都被覆盖了


以下是安装在我的系统上的Android工具的屏幕截图: enter image description here

我错过了什么


共 (1) 个答案