我正在尝试在Visual Studio上以某种方式构建我的第一个Cordova应用程序。我甚至无法得到我的应用程序Compiled for android。我不知道我做错了什么。
Severity Code Description Project File Line
Error cmd: Command failed with exit code 1 ParsasProgrammerCompanionApp c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\ERROR building one of the platforms 1
Severity Code Description Project File Line
Error cmd: Command failed with exit code 1 ParsasProgrammerCompanionApp c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\MDAVSCLI 1
用于Cordova Dependency Checker的工具告诉它没事,所有东西都安装得正确。
我已经创建了一个Keystore
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -validity 10000
并更新了我的ant.properties文件:
key.store="my-release-key.keystore "
key.alias="alias_name "
key.store.password="xxx"
key.alias.password="xxx"
(我尝试使用绝对和相对路径,但仍然没有运气)
这是我正在获取的日志
1>------ Build started: Project: ParsasProgrammerCompanionApp, Configuration: Debug Android ------
1> Your environment has been set up for using Node.js 0.12.2 (ia32) and npm.
1> ------ Ensuring correct global installation of package from source package directory: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac
1> ------ Name from source package.json: vs-tac
1> ------ Version from source package.json: 1.0.4
1> ------ Package already installed globally at correct version.
1> ------ Cordova tools 5.1.1 already installed.
1> ------ Build Settings:
1> ------ Build Settings:
1> ------ platformConfigurationBldDir: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\bld\Android\Debug
1> ------ platformConfigurationBinDir: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\bin\Android\Debug
1> ------ buildCommand: build
1> ------ platform: Android
1> ------ cordovaPlatform: android
1> ------ configuration: Debug
1> ------ cordovaConfiguration: Debug
1> ------ projectName: ParsasProgrammerCompanionApp
1> ------ projectSourceDir: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp
1> ------ npmInstallDir: C:\Users\Parsa Gachkar\AppData\Roaming\npm
1> ------ buildTarget: AndroidEmulator
1> ------ language: en-US
1> ------ changeList.changedFilesIos: bower.json,res\icons\android\icon-72-hdpi.png,res\screens\android\screen-mdpi-landscape.png,merges\android\scripts\android2.3-jscompat.js,merges\windows\scripts\winstore-jscompat.js,res\icons\ios\icon-60.png,res\screens\ios\screen-iphone-landscape-736h.png,res\icons\windows\StoreLogo.scale-100.png,www\scripts\index.js,res\icons\android\icon-48-mdpi.png,res\icons\ios\icon-72.png,res\icons\ios\icon-76.png,res\screens\ios\screen-ipad-portrait-2x.png,res\screens\ios\screen-iphone-portrait-2x.png,res\icons\windows\Square71x71Logo.scale-240.png,merges\android\scripts\platformOverrides.js,res\screens\android\screen-hdpi-portrait.png,www\css\index.css,res\icons\windows\StoreLogo.scale-240.png,res\screens\ios\screen-ipad-landscape.png,res\icons\ios\icon-60-3x.png,res\screens\wp8\SplashScreenImage.jpg,res\screens\ios\screen-ipad-landscape-2x.png,res\screens\ios\screen-iphone-568h-2x.png,res\icons\windows\Square150x150Logo.scale-100.png,package.json,res\screens\android\screen-ldpi-landscape.png,res\icons\windows\Wide310x150Logo.scale-240.png,res\icons\windows\Wide310x150Logo.scale-100.png,res\icons\ios\icon-72-2x.png,res\icons\ios\icon-76-2x.png,res\icons\ios\icon-small.png,res\icons\windows\Square30x30Logo.scale-100.png,build.json,res\icons\wp8\Background.png,www\index.html,res\icons\ios\icon-40.png,res\icons\ios\icon-60-2x.png,res\screens\android\screen-ldpi-portrait.png,res\native\android\ant.properties,res\icons\windows\Square310x310Logo.scale-100.png,www\scripts\platformOverrides.js,taco.json,res\icons\windows\Square150x150Logo.scale-240.png,res\icons\android\icon-36-ldpi.png,merges\windows\scripts\platformOverrides.js,res\screens\ios\screen-iphone-portrait.png,Project_Readme.html,res\screens\android\screen-xhdpi-portrait.png,res\icons\ios\icon-50-2x.png,res\icons\ios\icon-57-2x.png,res\icons\ios\icon-50.png,res\icons\ios\icon-57.png,res\icons\ios\icon-small-2x.png,res\icons\windows\Square70x70Logo.scale-100.png,res\screens\windows\SplashScreen.scale-240.png,res\icons\android\icon-96-xhdpi.png,res\icons\wp8\ApplicationIcon.png,res\icons\ios\icon-40-2x.png,res\screens\ios\screen-iphone-portrait-667h.png,res\screens\android\screen-hdpi-landscape.png,res\screens\windows\SplashScreenPhone.scale-240.png,res\screens\windows\SplashScreen.scale-100.png,res\screens\ios\screen-iphone-portrait-736h.png,res\screens\ios\screen-ipad-portrait.png,res\screens\android\screen-xhdpi-landscape.png,res\icons\windows\Square44x44Logo.scale-240.png,res\screens\android\screen-mdpi-portrait.png,config.xml,plugins\cordova-plugin-whitelist\NOTICE,plugins\cordova-plugin-whitelist\src\android\WhitelistPlugin.java,plugins\cordova-plugin-whitelist\whitelist.js,plugins\fetch.json,plugins\cordova-plugin-whitelist\plugin.xml,plugins\cordova-plugin-whitelist\package.json,plugins\cordova-plugin-whitelist\CONTRIBUTING.md,plugins\cordova-plugin-whitelist\LICENSE,plugins\cordova-plugin-whitelist\src\ios\CDVNavigationWhitelistPlugin.h,plugins\cordova-plugin-whitelist\RELEASENOTES.md,plugins\cordova-plugin-whitelist\src\ios\CDVNavigationWhitelistPlugin.m,plugins\cordova-plugin-whitelist\README.md,www\images\Parsag.jpg,www\images\20150804_195327.jpg,www\css\Roboto-Regular.ttf,www\css\B Yekan.ttf,www\css\css\ionicons.css,www\css\css\ionicons.min.css,www\css\fonts\ionicons.svg,www\css\fonts\ionicons.ttf,www\css\fonts\ionicons.eot,www\css\fonts\ionicons.woff,parsa-key.keystore,res\native\android\parsa-key.keystore
1> ------ changeList.deletedFilesIos:
1> ------ changeList.addedPluginsIos:
1> ------ changeList.deletedPluginsIos:
1> ------ changeList.addedPlugins:
1> ------ changeList.deletedPlugins:
1> ------ Platform android already exists
1> ------ Copying native files from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\native\android to platforms\android
1> ------ Copied c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\native\android\ant.properties to platforms\android\ant.properties
1> ------ Copied c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\native\android\parsa-key.keystore to platforms\android\parsa-key.keystore
1> ------ Done copying native files to platforms\android
1> ------ Updating plugins
1> ------ Currently installed plugins: cordova-plugin-whitelist@1.0.0
1> ------ Currently installed dependent plugins:
1> ------ Currently configured plugins:
1> ------ Preparing platform: android
1> Generating config.xml from defaults for platform "android"
1> Calling plugman.prepare for platform "android"
1> Preparing android project
1> Processing configuration changes for plugins.
1> Iterating over installed plugins: [ 'cordova-plugin-whitelist' ]
1> Writing out cordova_plugins.js...
1> Wrote out Android application name to "ParsasProgrammerCompanionApp"
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-land-hdpi\screen.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-land-ldpi\screen.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-land-mdpi\screen.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-land-xhdpi\screen.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-port-hdpi\screen.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-port-ldpi\screen.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-port-mdpi\screen.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-port-xhdpi\screen.png
1> splash screens: [{"src":"res/screens/android/screen-hdpi-landscape.png","density":"land-hdpi","platform":"android"},{"src":"res/screens/android/screen-ldpi-landscape.png","density":"land-ldpi","platform":"android"},{"src":"res/screens/android/screen-mdpi-landscape.png","density":"land-mdpi","platform":"android"},{"src":"res/screens/android/screen-xhdpi-landscape.png","density":"land-xhdpi","platform":"android"},{"src":"res/screens/android/screen-hdpi-portrait.png","density":"port-hdpi","platform":"android"},{"src":"res/screens/android/screen-ldpi-portrait.png","density":"port-ldpi","platform":"android"},{"src":"res/screens/android/screen-mdpi-portrait.png","density":"port-mdpi","platform":"android"},{"src":"res/screens/android/screen-xhdpi-portrait.png","density":"port-xhdpi","platform":"android"}]
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\screens\android\screen-hdpi-landscape.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-land-hdpi\screen.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\screens\android\screen-ldpi-landscape.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-land-ldpi\screen.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\screens\android\screen-mdpi-landscape.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-land-mdpi\screen.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\screens\android\screen-xhdpi-landscape.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-land-xhdpi\screen.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\screens\android\screen-hdpi-portrait.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-port-hdpi\screen.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\screens\android\screen-ldpi-portrait.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-port-ldpi\screen.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\screens\android\screen-mdpi-portrait.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-port-mdpi\screen.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\screens\android\screen-xhdpi-portrait.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-port-xhdpi\screen.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-hdpi\icon.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-ldpi\icon.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-mdpi\icon.png
1> deleted: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-xhdpi\icon.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\icons\android\icon-36-ldpi.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-ldpi\icon.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\icons\android\icon-48-mdpi.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-mdpi\icon.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\icons\android\icon-72-hdpi.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-hdpi\icon.png
1> copying image from c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\res\icons\android\icon-96-xhdpi.png to c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\res\drawable-xhdpi\icon.png
1> Wrote out Android package name to "io.cordova.myappf45017"
1> ------ Copied c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\bin\Android\Debug\VSBuildInfo.xml to platforms\android\assets\www\VSBuildInfo.xml
1> ------ Building platform: android
1> Debug
1> ------ Build configuration options: --debug
1> Running command: cmd "/s /c ""c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\cordova\build.bat" --debug "--buildConfig=c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\build.json"""
1> ANDROID_HOME=C:\Android-SDK\Android-SDK-Full-2014-12-03-EhsanAvr.Com
1> JAVA_HOME=C:\Program Files\Java\jdk1.8.0_60\
1> c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\build.json
1> Reading build config file: c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\build.json
1> Running: c:\Users\Parsa Gachkar\Documents\Visual Studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\gradlew cdvBuildDebug -b c:\Users\Parsa Gachkar\Documents\Visual Studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\build.gradle -Dorg.gradle.daemon=true
1> Unzipping C:\Users\Parsa Gachkar\.gradle\wrapper\dists\gradle-2.2.1-all\2m8005s69iu8v0oiejfej094b\gradle-2.2.1-all.zip to C:\Users\Parsa Gachkar\.gradle\wrapper\dists\gradle-2.2.1-all\2m8005s69iu8v0oiejfej094b
1> Command finished with error code 1: cmd /s /c ""c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\cordova\build.bat" --debug "--buildConfig=c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\build.json""
1>ERROR building one of the platforms : error : cmd: Command failed with exit code 1
1> You may not have the required environment or OS to build this project
1>MDAVSCLI : error : cmd: Command failed with exit code 1
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
BTW我正在尝试使用Debug Config构建它
谁有这个东西工作?你能解释一下你到底做了什么吗?并且这个问题不是关于SO的任何问题的重复,我已经完成了研究并且答案没有用。
答案 0 :(得分:0)
我能够通过手动编译应用程序来解决问题。
我的防火墙正在产生这个问题。 Java SDK试图下载一些库,我的防火墙阻止它,因此Gradle无法编译,结果我的Gradle安装已损坏。以下是我为解决此问题而采取的步骤:
删除prepareOnReuse()
关闭防火墙或取消阻止Java
重新编译
答案 1 :(得分:0)
我遇到了同样的错误,但它有一个不同的解决方案。
这是我的解决方案:
通过查看输出消息我理解“build.bat”运行时出现问题:
1> Command finished with error code 1: cmd /s /c ""c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\platforms\android\cordova\build.bat" --debug "--buildConfig=c:\users\parsa gachkar\documents\visual studio 2015\Projects\ParsasProgrammerCompanionApp\ParsasProgrammerCompanionApp\build.json""
1>ERROR building one of the platforms : error : cmd: Command failed with exit code 1
1> You may not have the required environment or OS to build this project
1>MDAVSCLI : error : cmd: Command failed with exit code 1
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
所以我运行了CMD的“build.bat”文件,它给了我更多信息:
* What went wrong:
A problem occurred evaluating root project 'android'.
> No installed build tools found. Please install the Android build tools version 19.1.0 or higher.
当我从Android SDK Manager安装构建工具时,问题就消失了。