离子中的Android构建错误 - 包括Cordova插件文件



下面的错误似乎是在我的项目中使用cordova插件'file'和'file-opener2'。在删除插件时,它会生成一个正确的安卓版本。

我还尝试将科尔多瓦版本设置为 7.1.0,将科尔多瓦平台 android 设置为 6.4.0 版。 尽管错误不同,但构建仍然失败

* Wh
at went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
at ChildProcess.whenDone (/Users/Naresh/Documents/AnshFertilityApp/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at ChildProcess.emit (events.js:180:13)
at maybeClose (internal/child_process.js:936:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
(node:99591) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:99591) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我当前的离子信息:

cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0 
local packages:
@ionic/app-scripts : 3.1.9
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2
System:
Node : v9.8.0
npm  : 5.6.0 
OS   : macOS High Sierra
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro

我安装了这个插件,它工作正常:

https://github.com/dpa99c/cordova-android-support-gradle-release

替换

<framework src="com.android.support:support-v4:+" />

<framework src="com.android.support:support-v4:24.1.1+" />
cordova.plugins.fileOpener2plugin.xml

. 并删除安卓平台 Ionic Cordova平台RMAndroid,然后再次添加 Ionic Cordova平台 添加安卓

最新更新