我尝试使用cordova构建框架文件时出错

时间:2014-08-07 15:15:18

标签: android cordova sdk compilation

命令:

C:\Users\Vince\Desktop\cordova-android\framework>ant jar

构建

-check-env:
 [checkenv] Android SDK Tools Revision 23.0.2
 [checkenv] Installed at D:\softs\android-SDK

-setup:
     [echo] Project Name: Cordova
  [gettype] Project Type: Android Library

-build-setup:
[getbuildtools] Using latest Build Tools: 20.0.0
     [echo] Resolving Build Target for Cordova...
[gettarget] Project Target:   Android 4.3
[gettarget] API level:        18
     [echo] ----------

错误:

    [javac]   symbol:   method setWebContentsDebuggingEnabled(boolean)
    [javac]   location: class CordovaWebView
    [javac] C:\Users\Vince\Desktop\cordova-android\framework\src\org\apache\co
rdova\IceCreamCordovaWebViewClient.java:78: error: cannot find symbol
    [javac]         return android.os.Build.VERSION.SDK_INT >= android.os.Build.
VERSION_CODES.KITKAT && "content".equals(uri.getScheme());
    [javac]
             ^
    [javac]   symbol:   variable KITKAT
    [javac]   location: class VERSION_CODES
    [javac] Note: C:\Users\Viince\Desktop\cordova-android\framework\src\org\apa
che\cordova\CordovaWebView.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 4 errors

BUILD FAILED
D:\softs\android-SDK\tools\ant\build.xml:720: The following error occurred while
 executing this line:
D:\softs\android-SDK\tools\ant\build.xml:734: Compile failed; see the compiler e
rror output for details.

Total time: 1 second

任何有关消除此错误的建议都会很棒!感谢所有愿意回答的人。我有Android SDK构建工具20。

1 个答案:

答案 0 :(得分:0)

我通过在Eclipse中打开项目然后右键单击CordovaLib项目然后属性,然后在“Android”下确保API版本19被选中来修复了这个确切的错误。

这与我在“我的应用”项目中选择的内容以及下面输入的内容相匹配。

然后我运行了这里描述的命令: https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/platforms/android/README.md

android update project -p platforms/android/

cd platforms/android/

ant clean

cd FacebookLib

ant clean

open -e AndroidManifest.xml 

// change your minSdkVersion and your targetSdkVersion to your environment settings for me it was:
// <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />

ant release

cd ../../..

cordova build android