2015-09-12 126 views
1

我試圖在Visual Studio上構建我的第一個Cordova應用程序,並且以某種方式。我什至不能讓我的應用程序編譯爲Android。我不知道我做錯了什麼。Visual Studio 2015錯誤代碼1在Android上構建Cordova應用程序

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依賴關係檢查器的工具告訴它,它是好的,每一件事情都安裝正確。

我已經創建了一個密鑰存儲

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: [email protected] 
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 ========== 

順便說一句我正在試圖用Debug Config來構建它

任何人都得到了這個東西的工作?你能解釋一下你做了什麼嗎?

而且沒有這個問題不是重複的任何問題,所以我已經做了一個研究,答案沒有用。

回答

0

我能夠通過手動編譯應用程序來解決問題。

我的防火牆正在產生問題。 Java SDK試圖下載一些庫,我的防火牆阻止了它,所以Gradle無法編譯,結果我的Gradle安裝被破壞了。下面是我對解決這個問題的步驟:

  • 刪除C:\Users\Parsa Gachkar\.gradle

  • 關閉防火牆或解鎖的Java

  • 重新編譯

+0

如何解鎖Java? – Krishna

+0

@Krishnavrinsoft檢查此[鏈接](http://www.technipages.com/blockunblock-programs-in-windows-firewall)了!並解除阻止java.exe! – ParsaG72

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 ========== 

所以我跑了「的build.bat」由CMD文件,它給了我更多的信息:

* 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管理器安裝構建工具問題消失。

相關問題