3

私は現在、cordova(phonegap)を使用したモバイルデバイスのクロスプラットフォーム開発に取り掛かろうとしています。

今、私はcordova.jarをビルドしようとしています-だから私は最初の段階です。

android update project -p . -t android-15フレームワークディレクトリで実行する と、次の出力が得られます。

E:\eclipse\cordova-android-master\framework>android update project -p . -t android-15
Updated project.properties
Updated local.properties
build.xml: Found version-tag: custom. File will not be updated.
Updated file E:\eclipse\cordova-android-master\framework\proguard-project.txt
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.

ant jar次に、フレームワークディレクトリでコマンドを実行するステップで、次の出力を取得します。

Buildfile: E:\eclipse\cordova-android-master\framework\build.xml

-check-env:
 [checkenv] Android SDK Tools Revision 21
 [checkenv] Installed at E:\eclipse\android-sdk-windows

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

-pre-clean:

clean:
   [delete] Deleting directory E:\eclipse\cordova-android-master\framework\bin
   [delete] Deleting directory E:\eclipse\cordova-android-master\framework\gen
[getlibpath] Library dependencies:
[getlibpath] No Libraries
   [subant] No sub-builds to iterate on

build-javascript:

-build-setup:
     [echo] Resolving Build Target for Cordova...
[gettarget] Project Target:   Android 4.0.3
[gettarget] API level:        15
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: E:\eclipse\cordova-android-master\framework\bin
    [mkdir] Created dir: E:\eclipse\cordova-android-master\framework\bin\res
    [mkdir] Created dir: E:\eclipse\cordova-android-master\framework\gen
    [mkdir] Created dir: E:\eclipse\cordova-android-master\framework\bin\classes
    [mkdir] Created dir: E:\eclipse\cordova-android-master\framework\bin\dexedLibs
     [echo] ----------
     [echo] Resolving Dependencies for Cordova...
[dependency] Ordered libraries:
[dependency] 
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
     [echo] ----------
     [echo] Building Libraries with '${build.target}'...
   [subant] No sub-builds to iterate on

-pre-build:

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 53 source files to E:\eclipse\cordova-android-master\framework\bin\classes
    [javac] E:\eclipse\cordova-android-master\framework\src\org\apache\cordova\CordovaWebView.java:900: error: cannot find symbol
    [javac]             settings.setAllowUniversalAccessFromFileURLs(true);
    [javac]                     ^
    [javac]   symbol:   method setAllowUniversalAccessFromFileURLs(boolean)
    [javac]   location: variable settings of type WebSettings
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 1 error

誰かが私が間違っていることを知っていますか?

common-codec-1.6.jarは、readmeにあるように、libフォルダーにあります。

androidapiレベル15がインストールされています。

4

1 に答える 1

4

コンパイルエラーが発生しないように、APIレベル16でビルドする必要があります。メソッドWebSettings.setAllowUniversalAccessFromFileURLs()は、APIレベル16で導入されました。

于 2012-12-26T21:13:39.977 に答える