簡體   English   中英

Visual Studio 2015錯誤代碼1在Building Cordova App for Android上

[英]Visual Studio 2015 Error code 1 On Building Cordova App for Android

我正在嘗試以某種方式在Visual Studio上構建我的First Cordova應用程序。 我什至無法為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的工具告訴您,沒關系,所有東西都已正確安裝。

我已經創建了一個密鑰庫

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

順便說一句我正在嘗試使用Debug Config構建它

有人讓這個東西起作用嗎? 您能確切解釋一下您做了什么嗎?

而且,沒有這個問題不是關於SO的任何問題的重復,我已經完成了一項研究,答案也沒有用。

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

我的防火牆正在產生此問題。 Java SDK試圖下載一些庫,但我的防火牆阻止了它,因此Gradle無法編譯,結果我的Gradle安裝損壞了。 這是我為解決此問題而采取的步驟:

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

  • 關閉防火牆或取消阻止Java

  • 重新編譯

給我同樣的錯誤,但是有不同的解決方案。

這是我的解決方案:

通過查看輸出消息,我了解了在運行“ 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安裝構建工具時,該問題消失了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM