【问题标题】:Phonegap android build errorPhonegap android构建错误
【发布时间】:2017-03-08 20:37:02
【问题描述】:

所以我正在使用phonegap,我一辈子都无法弄清楚为什么我不能运行Phonegap build android。

我已经尝试过,通过 android studio 添加 Android 版本,我尝试过在 android studio 中刷新和构建。

我不确定您需要查看哪些文件,所以请告诉我,我会提供。

任何时候我都会收到此错误:

* What went wrong:

Execution failed for task ':processDebugResources'.

> 
com.android.ide.common.process.ProcessException: 
org.gradle.process.internal.ExecException: Process 'command 
'/Users/mathewmorse/Library/Android/sdk/build-tools/23.0.2/aapt'' 
finished with non-zero exit value 1




BUILD FAILED



Total time: 13.317 secs

Error: Error code 1 for command: 
/Users/mathewmorse/Documents/www/susu/platforms/android/gradlew with 
args: cdvBuildDebug, 
b,/Users/mathewmorse/Documents/www/susu/platforms/android/build.gradle,-
Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

编辑:整个过程:

Mathews-MacBook-Pro:susu mathewmorse$ phonegap build android
[phonegap] executing 'cordova build android ' ...
cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/icon/android/drawable-ldpi-icon.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/icon/android/drawable-mdpi-icon.png

cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/icon/android/drawable-hdpi-icon.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/icon/android/drawable-xhdpi-icon.png

cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/icon/android/drawable-xxhdpi-icon.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/icon/android/drawable-xxxhdpi-icon.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-land-ldpi-screen.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-land-mdpi-screen.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-land-hdpi-screen.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-land-xhdpi-screen.png


cp: no such file or directory:     /Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-land-xxhdpi-screen.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-land-xxxhdpi-screen.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-port-ldpi-screen.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-port-mdpi-screen.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-port-hdpi-screen.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-port-xhdpi-screen.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-port-xxhdpi-screen.png


cp: no such file or directory: 
/Users/mathewmorse/Documents/www/susu/www/www/res/screen/android/drawable-port-xxxhdpi-screen.png


ANDROID_HOME=/Users/mathewmorse/Library/Android/sdk

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home

:preBuild
UP-TO-DATE

:preDebugBuild

UP-TO-DATE

:checkDebugManifest


:CordovaLib:preBuild

UP-TO-DATE

:CordovaLib:preDebugBuild

UP-TO-DATE

:CordovaLib:compileDebugNdk

UP-TO-DATE

:CordovaLib:compileLint


:CordovaLib:copyDebugLint

UP-TO-DATE

:CordovaLib:mergeDebugProguardFiles
UP-TO-DATE

:CordovaLib:packageDebugRenderscript

UP-TO-DATE

:CordovaLib:checkDebugManifest


:CordovaLib:prepareDebugDependencies


:CordovaLib:compileDebugRenderscript

UP-TO-DATE

:CordovaLib:generateDebugResValues

UP-TO-DATE

:CordovaLib:generateDebugResources UP-TO-DATE

:CordovaLib:packageDebugResources

UP-TO-DATE

:CordovaLib:compileDebugAidl
UP-TO-DATE


:CordovaLib:generateDebugBuildConfig

UP-TO-DATE

:CordovaLib:generateDebugAssets

UP-TO-DATE

:CordovaLib:mergeDebugAssets

UP-TO-DATE

:CordovaLib:processDebugManifest

UP-TO-DATE

:CordovaLib:processDebugResources

UP-TO-DATE

:CordovaLib:generateDebugSources

UP-TO-DATE

:CordovaLib:compileDebugJavaWithJavac

UP-TO-DATE

:CordovaLib:processDebugJavaRes

UP-TO-DATE

:CordovaLib:transformResourcesWithMergeJavaResForDebug

UP-TO-DATE

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug

UP-TO-DATE

:CordovaLib:mergeDebugJniLibFolders

UP-TO-DATE

:CordovaLib:transformNative_libsWithMergeJniLibsForDebug

UP-TO-DATE

:CordovaLib:transformNative_libsWithSyncJniLibsForDebug

UP-TO-DATE

:CordovaLib:bundleDebug

UP-TO-DATE

:prepareAndroidCordovaLibUnspecifiedDebugLibrary

UP-TO-DATE

:preReleaseBuild

UP-TO-DATE

:CordovaLib:preReleaseBuild

UP-TO-DATE


:CordovaLib:compileReleaseNdk

UP-TO-DATE

:CordovaLib:copyReleaseLint
UP-TO-DATE

:CordovaLib:mergeReleaseProguardFiles

UP-TO-DATE

:CordovaLib:packageReleaseRenderscript
UP-TO-DATE


:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies

:CordovaLib:compileReleaseRenderscript

UP-TO-DATE
:CordovaLib:generateReleaseResValues
UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources

UP-TO-DATE
:CordovaLib:compileReleaseAidl

UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig

UP-TO-DATE

:CordovaLib:generateReleaseAssets
UP-TO-DATE

:CordovaLib:mergeReleaseAssets

UP-TO-DATE

:CordovaLib:processReleaseManifest

UP-TO-DATE

:CordovaLib:processReleaseResources

UP-TO-DATE

:CordovaLib:generateReleaseSources

UP-TO-DATE


:CordovaLib:compileReleaseJavaWithJavac

UP-TO-DATE

:CordovaLib:processReleaseJavaRes

UP-TO-DATE

:CordovaLib:transformResourcesWithMergeJavaResForRelease

UP-TO-DATE

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease

UP-TO-DATE

:CordovaLib:mergeReleaseJniLibFolders
UP-TO-DATE


:CordovaLib:transformNative_libsWithMergeJniLibsForRelease

UP-TO-DATE

:CordovaLib:transformNative_libsWithSyncJniLibsForRelease

UP-TO-DATE

:CordovaLib:bundleRelease

UP-TO-DATE

:prepareComAndroidSupportSupportV42311Library

UP-TO-DATE

:prepareDebugDependencies


:compileDebugAidl

UP-TO-DATE

:compileDebugRenderscript

UP-TO-DATE

:generateDebugBuildConfig
UP-TO-DATE

:generateDebugAssets

UP-TO-DATE

:mergeDebugAssets

UP-TO-DATE

:generateDebugResValues
UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources
/Users/mathewmorse/Documents/www/susu/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml:24:23-37 : AAPT: No resource found that matches the given name (at 'icon' with value '@drawable/icon').



 FAILED



FAILURE: 
Build failed with an exception.



* What went wrong:

Execution failed for task ':processDebugResources'.

> 
com.android.ide.common.process.ProcessException: 
org.gradle.process.internal.ExecException: Process 'command 
'/Users/mathewmorse/Library/Android/sdk/build-tools/23.0.2/aapt'' 
finished with non-zero exit value 1



* Try:

Run with 
--stacktrace option to get the stack trace. Run with --info or 
--debug option to get more log output.



BUILD FAILED



Total time: 13.317 secs

Error: Error code 1 for command: 
/Users/mathewmorse/Documents/www/susu/platforms/android/gradlew with 
args: cdvBuildDebug,-
b,/Users/mathewmorse/Documents/www/susu/platforms/android/build.gradle,-
Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

【问题讨论】:

  • 是所有错误信息吗?那还有其他消息吗
  • 我对其进行了编辑以包含 CML 吐出的全部内容
  • 在浏览器上运行的时候,效果好吗?
  • 如果我运行 phonegap serve 它就可以了。 deviceready 有时会出现一些问题,但我也在努力使用 google 登录,这会出现错误,但这是一个不同的问题。

标签: android cordova gradle phonegap-build


【解决方案1】:

当您使用:phonegap serve ProjectName 运行时,它会在浏览器上运行。它很有可能不在浏览器中使用该图标。它们将在部署 .apk 文件时使用。因此,只需创建这些文件或通过以下方式开始一个新项目:phonegap create NewProjectName,然后编辑您创建的 www 文件夹中的 html 文件。

【讨论】:

  • 你是说缺少屏幕和图标文件吗?
  • 在收到失败错误之前根据消息谈论图标文件:/Users/mathewmorse/Documents/www/susu/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest. xml:24:23-37 : AAPT: 找不到与给定名称匹配的资源(在“图标”处,值为“@drawable/icon”)。
  • 好的,所以在我的 XML 文件中,我有那些对不存在的文件的引用。这解决了我的问题。构建放置在哪里?
  • /yourprojectdirectpry/platforms/android/build/outputs/apk
  • 太棒了,谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-11-11
  • 1970-01-01
  • 2016-02-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多