gpt4 book ai didi

java - 在 cordova-android 的 CordovaLib 编译中找不到符号 ClientCertRequest

转载 作者:行者123 更新时间:2023-11-30 11:02:18 24 4
gpt4 key购买 nike

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

  • npm@2.5.1
  • cordova@3.6.0-0.2.9
  • cordova-android@3.6.0


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

  • cordova@5.1.1
  • cordova-android@4.0.2


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

Running: /Users/Pierre/Documents/project/platforms/android/gradlew cdvBuildDebug -b /Users/Pierre/Documents/project/platforms/android/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/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:25: error: cannot find symbol
import android.webkit.ClientCertRequest;
^
symbol: class ClientCertRequest
location: package android.webkit
/Users/Pierre/Documents/project/platforms/android/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/android/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=android-19
apk-configurations=
renderscript.opt.level=O0
android.library=true

所以我尝试创建一个兄弟文件 ant.properties 包含:

target=android-21

但它并没有改变任何东西。

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


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

我错过了什么?

最佳答案

所以看起来它仍在使用 target=android-19 进行构建。您是否将 AndroidManifest.xml 更改为所需的 21 版本?

Android Min SDK Version vs. Target SDK Version

http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

关于java - 在 cordova-android 的 CordovaLib 编译中找不到符号 ClientCertRequest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30849747/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com