我找到了以下问题的解决方案,我想为任何遇到相同问题的人记录解决方案。
在PhoneGap Android构建日志中,我有以下错误:
Installing "cordova-plugin-file-opener2" at "2.0.7" for android
Using this version of Cordova with older version of cordova-android is being deprecated. Consider upgrading to cordova-android@5.0.0 or newer.
--------------------------------------------------------------------------------
COMPILE OUTPUT
--------------------------------------------------------------------------------
Buildfile: /project/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 25.2.5
-setup:
[echo] Project Name: appname
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 24.0.1
[echo] Resolving Build Target for appname...
[gettarget] Project Target: Android 5.0.1
[gettarget] API level: 21
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /project/bin
[mkdir] Created dir: /project/bin/res
[mkdir] Created dir: /project/bin/rsObj
[mkdir] Created dir: /project/bin/rsLibs
[mkdir] Created dir: /project/gen
[mkdir] Created dir: /project/bin/classes
[mkdir] Created dir: /project/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for appname...
BUILD FAILED
/android-sdk/tools/ant/build.xml:573: ../../../../../../android-sdk/com.android.support:support-v4:+ resolve to a path with no project.properties file for project /project
我的项目config.xml
:
...
<preference name="phonegap-version" value="3.7.0" />
...
<plugin name="cordova-plugin-file-opener2" source="npm" />
...
答案 0 :(得分:1)
现在在错误中你会注意到安装尝试
Installing "cordova-plugin-file-opener2" at "2.0.7" for android
由于config.xml
中的同一个插件没有设置版本,它会自动尝试使用最新版本。
按照my previous answer中的步骤操作,您会发现此PhoneGap version 3.7.0
的{{3}}插件File Opener Plugin 1.0.11
是2.0.7
,而不是安装的spec="1.0.11"
,因此添加<plugin name="cordova-plugin-file-opener2" spec="1.0.11" source="npm" />
uglify-js
插件看起来像:
"uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony",
将强制它使用兼容版本。我认为这将转换为任何未构建的旧插件。