Ionic:任务':app:mergeDebugResources'

时间:2019-04-03 15:37:19

标签: android cordova ionic-framework gradle

运行the cordova build android命令时出现此错误。

Execution failed for task ':app:mergeDebugResources'.

几天前我尝试运行此命令时,它生成了apk,但现在不再可用。我也什么都没改变

我尝试再次运行离子式科尔多瓦资源,以免再次损坏图像

其他人有这个问题吗?是什么原因造成的?

完整的堆栈跟踪:

PS C:\school\pokemontest> cordova build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\Gebruiker\AppData\Local\Android\sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app
> Task :app:preBuild UP-TO-DATE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :CordovaLib:checkDebugManifest UP-TO-DATE
> Task :CordovaLib:processDebugManifest UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :CordovaLib:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :CordovaLib:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript UP-TO-DATE
> Task :app:checkDebugManifest UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:prepareLintJar UP-TO-DATE
> Task :app:generateDebugSources UP-TO-DATE
> Task :CordovaLib:compileDebugRenderscript UP-TO-DATE
> Task :CordovaLib:generateDebugBuildConfig UP-TO-DATE
> Task :CordovaLib:generateDebugResValues UP-TO-DATE
> Task :CordovaLib:generateDebugResources UP-TO-DATE
> Task :CordovaLib:packageDebugResources UP-TO-DATE
> Task :CordovaLib:generateDebugRFile UP-TO-DATE
> Task :CordovaLib:prepareLintJar UP-TO-DATE
> Task :CordovaLib:generateDebugSources UP-TO-DATE
> Task :CordovaLib:javaPreCompileDebug UP-TO-DATE
> Task :CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
> Task :CordovaLib:processDebugJavaRes NO-SOURCE
> Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> C:\school\pokemontest\platforms\android\app\src\main\res\drawable-pioort-xhdpi: Error: Invalid resource directory name
> Task :app:mergeDebugResources FAILED
C:\school\pokemontest\platforms\android\app\src\main\res\drawable-pioort-xhdpi: Error: Invalid resource directory name
20 actionable tasks: 1 executed, 19 up-to-date


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
C:\school\pokemontest\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> C:\school\pokemontest\platforms\android\app\src\main\res\drawable-pioort-xhdpi: Error: Invalid resource directory name

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

3 个答案:

答案 0 :(得分:2)

我解决了这个问题。 我删除了插件和平台图。 之后,我为插件运行了cordova prepare命令 和cordova build android重新设置所有内容。

答案 1 :(得分:2)

经过多次尝试,我通过

解决了此问题。

1-打开config.xml

2-将小部件标签的xmlns =“ http://www.w3.org/ns/widgets”更改为xmlns:android =“ http://schemas.android.com/apk/res/android” < / p>

3-重建项目

答案 2 :(得分:0)

您可以尝试运行命令cordova clean android && cordova build android