我創建了一個科爾多瓦項目,並構建它是這樣的:導入科爾多瓦6.1.2項目到Eclipse:cordovalib.jar在Android的依賴失蹤
cordova create /my_folder/FlugbuchFPG com.MyName.FlugbuchFPG FlugbuchFPG
cd /my_folder/FlugbuchFPG
cordova platform add android --save
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.MyName.FlugbuchFPG
Name: FlugbuchFPG
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving [email protected]~6.1.2 into config.xml file ...
Installed platforms:
android 6.1.2
Available platforms:
amazon-fireos ~3.6.3 (deprecated)
blackberry10 ~3.8.0
browser ~4.1.0
firefoxos ~3.6.3
ios ~4.3.0
osx ~4.0.1
webos ~3.7.0
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-17,android-18,android-19,android-20,android-21,android-22,android-23,android-N,android-25,Google Inc.:Google APIs:17,Google Inc.:Google APIs:18,Google Inc.:Glass Development Kit Preview:19,Google Inc.:Google APIs (x86 System Image):19,Google Inc.:Google APIs:19,Google Inc.:Google APIs:21,Google Inc.:Google APIs:22,Google Inc.:Google APIs:23
Gradle: installed
cordova build
ANDROID_HOME=/Users/myname/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
Subproject Path: CordovaLib
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:prepareAndroidCordovaLibUnspecifiedDebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:transformClassesWithDexForDebug
:mergeDebugJniLibFolders
:transformNative_libsWithMergeJniLibsForDebug
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug
:validateSigningDebug
:packageDebug
:assembleDebug
:cdvBuildDebug
BUILD SUCCESSFUL
Total time: 19.753 secs
Built the following apk(s):
/my_folder/FlugbuchFPG/platforms/android/build/outputs/apk/android-debug.apk
我在android-debug.apk下載到我的Android-設備,它工作正常。
然後我嘗試將項目導入到Eclipse 4.4.2。我選擇 - >文件 - >導入... - > Android - >現有的Android代碼到工作區
Eclipse爲我提供了6個包。我只選擇「MainActivity」和「CordovaLib」,因爲所有其他人在路徑或名稱中都有「調試」一詞。我將「MainAvtivity」重命名爲我的應用程序名稱,將「CordovaLib」重命名爲「ProjectnameCordovaLib」。
導入運行,但由於錯誤,項目被標記爲紅色。當我去「右鍵單擊 - >屬性 - > Java構建路徑 - > Android依賴項」時,它告訴我,bin-Folder中缺少cordovalib.jar。事實上,bin-Folder是完全空的。
當我從Android Dependencies中刪除條目時,其他錯誤可以確認。所以這似乎不是解決方案。那麼,我該如何創建oder獲取丟失的cordovalib.jar或以不同的方式解決此問題?謝謝。