A problem occurred configuring project ':CordovaLib'. An error occurred while running subprocess

H:\IonicSpace\MyApp>"I:\Program Files\Java\jdk1.8.0_73/bin/java.exe"    "-Dorg.gradle.appname=gradlew" -classpath "H:\IonicSpace\MyApp\platforms\android\\gradle\wrapper\gradle-wrapper.jar" org.gradle.wrapper.GradleWrapperMain cdvBuildDebug -b H:\IonicSpace\MyApp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> Could not resolve all files for configuration ':CordovaLib:classpath'.

H:\IonicSpace\MyApp>if "1" == "0" goto mainEnd

H:\IonicSpace\MyApp>rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

H:\IonicSpace\MyApp>rem the _cmd.exe /c_ return code!

H:\IonicSpace\MyApp>if not "" == "" exit 1

H:\IonicSpace\MyApp>exit /b 1
Command finished with error code 1: cmd /s /c "H:\IonicSpace\MyApp\platforms\android\gradlew.bat cdvBuildDebug -b H:\IonicSpace\MyApp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m"
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> Could not resolve all files for configuration ':CordovaLib:classpath'.
   > Could not download maven-ant-tasks.jar (org.apache.maven:maven-ant-tasks:2.1.3)
      > Could not get resource 'https://jcenter.bintray.com/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar'.
         > Could not GET 'https://jcenter.bintray.com/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar'.
            > Remote host closed connection during handshake
   > Could not download commons-collections.jar (commons-collections:commons-collections:3.2.1)
      > Could not get resource 'https://jcenter.bintray.com/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar'.
         > Could not GET 'https://jcenter.bintray.com/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar'.
            > Remote host closed connection during handshake
   > Could not download xercesImpl.jar (xerces:xercesImpl:2.9.1)
      > Could not get resource 'https://jcenter.bintray.com/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar'.
         > Could not GET 'https://jcenter.bintray.com/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar'.
            > Remote host closed connection during handshake

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

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

BUILD FAILED in 2m 25s
    at ChildProcess.whenDone (H:\IonicSpace\MyApp\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
   > Could not download maven-ant-tasks.jar (org.apache.maven:maven-ant-tasks:2.1.3)
      > Could not get resource 'https://jcenter.bintray.com/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar'.
         > Could not GET 'https://jcenter.bintray.com/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar'.
            > Remote host closed connection during handshake
   > Could not download commons-collections.jar (commons-collections:commons-collections:3.2.1)
      > Could not get resource 'https://jcenter.bintray.com/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar'.
         > Could not GET 'https://jcenter.bintray.com/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar'.
            > Remote host closed connection during handshake
   > Could not download xercesImpl.jar (xerces:xercesImpl:2.9.1)
      > Could not get resource 'https://jcenter.bintray.com/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar'.
         > Could not GET 'https://jcenter.bintray.com/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar'.
            > Remote host closed connection during handshake

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

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

BUILD FAILED in 2m 25s
cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> Could not resolve all files for configuration ':CordovaLib:classpath'.
   > Could not download maven-ant-tasks.jar (org.apache.maven:maven-ant-tasks:2.1.3)
      > Could not get resource 'https://jcenter.bintray.com/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar'.
         > Could not GET 'https://jcenter.bintray.com/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar'.
            > Remote host closed connection during handshake
   > Could not download commons-collections.jar (commons-collections:commons-collections:3.2.1)
      > Could not get resource 'https://jcenter.bintray.com/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar'.
         > Could not GET 'https://jcenter.bintray.com/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar'.
            > Remote host closed connection during handshake
   > Could not download xercesImpl.jar (xerces:xercesImpl:2.9.1)
      > Could not get resource 'https://jcenter.bintray.com/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar'.
         > Could not GET 'https://jcenter.bintray.com/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar'.
            > Remote host closed connection during handshake

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

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

BUILD FAILED in 2m 25s
这个地方可能用得到,如果是这样的问题的话,
[ERROR] An error occurred while running subprocess cordova.
        cordova build android --verbose exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.
  ionic:cli-framework:utils:process onBeforeExit handler: process.exit received +0ms
  ionic:cli-framework:utils:process onBeforeExit handler: running 2 functions +10ms
  ionic:cli-framework:utils:process error while killing process tree for 10448: { Error: Command failed: taskkill /pid 10448 /T /F
  ionic:cli-framework:utils:process ����: û���ҵ����� "10448"��
  ionic:cli-framework:utils:process
  ionic:cli-framework:utils:process     at ChildProcess.exithandler (child_process.js:276:12)
  ionic:cli-framework:utils:process     at emitTwo (events.js:126:13)
  ionic:cli-framework:utils:process     at ChildProcess.emit (events.js:214:7)
  ionic:cli-framework:utils:process     at maybeClose (internal/child_process.js:915:16)
  ionic:cli-framework:utils:process     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
  ionic:cli-framework:utils:process   killed: false,
  ionic:cli-framework:utils:process   code: 128,
  ionic:cli-framework:utils:process   signal: null,
  ionic:cli-framework:utils:process   cmd: 'taskkill /pid 10448 /T /F' } +192ms
  ionic:cli-framework:utils:process onBeforeExit handler: error from function: { Error: Command failed: taskkill /pid 10448 /T /F
  ionic:cli-framework:utils:process ����: û���ҵ����� "10448"��
  ionic:cli-framework:utils:process
  ionic:cli-framework:utils:process     at ChildProcess.exithandler (child_process.js:276:12)
  ionic:cli-framework:utils:process     at emitTwo (events.js:126:13)
  ionic:cli-framework:utils:process     at ChildProcess.emit (events.js:214:7)
  ionic:cli-framework:utils:process     at maybeClose (internal/child_process.js:915:16)
  ionic:cli-framework:utils:process     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
  ionic:cli-framework:utils:process   killed: false,
  ionic:cli-framework:utils:process   code: 128,
  ionic:cli-framework:utils:process   signal: null,
  ionic:cli-framework:utils:process   cmd: 'taskkill /pid 10448 /T /F' } +6ms
  ionic:cli-framework:utils:process error while killing process tree for 3320: { Error: Command failed: taskkill /pid 3320 /T /F
  ionic:cli-framework:utils:process ����: û���ҵ����� "3320"��
  ionic:cli-framework:utils:process
  ionic:cli-framework:utils:process     at ChildProcess.exithandler (child_process.js:276:12)
  ionic:cli-framework:utils:process     at emitTwo (events.js:126:13)
  ionic:cli-framework:utils:process     at ChildProcess.emit (events.js:214:7)
  ionic:cli-framework:utils:process     at maybeClose (internal/child_process.js:915:16)
  ionic:cli-framework:utils:process     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
  ionic:cli-framework:utils:process   killed: false,
  ionic:cli-framework:utils:process   code: 128,
  ionic:cli-framework:utils:process   signal: null,
  ionic:cli-framework:utils:process   cmd: 'taskkill /pid 3320 /T /F' } +30ms
  ionic:cli-framework:utils:process onBeforeExit handler: error from function: { Error: Command failed: taskkill /pid 3320 /T /F
  ionic:cli-framework:utils:process ����: û���ҵ����� "3320"��
  ionic:cli-framework:utils:process
  ionic:cli-framework:utils:process     at ChildProcess.exithandler (child_process.js:276:12)
  ionic:cli-framework:utils:process     at emitTwo (events.js:126:13)
  ionic:cli-framework:utils:process     at ChildProcess.emit (events.js:214:7)
  ionic:cli-framework:utils:process     at maybeClose (internal/child_process.js:915:16)
  ionic:cli-framework:utils:process     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
  ionic:cli-framework:utils:process   killed: false,
  ionic:cli-framework:utils:process   code: 128,
  ionic:cli-framework:utils:process   signal: null,
  ionic:cli-framework:utils:process   cmd: 'taskkill /pid 3320 /T /F' } +0ms
  ionic:cli-framework:utils:process onBeforeExit handler: exiting (exit code 1) +0ms
PS H:\IonicSpace\MyApp> ionic cordova build android
> ng run app:ionic-cordova-build --platform=android
��ֹ�����������(Y/N)?
终止批处理操作吗(Y/N)? y
PS H:\IonicSpace\MyApp>
PS H:\IonicSpace\MyApp>
PS H:\IonicSpace\MyApp>
PS H:\IonicSpace\MyApp>
PS H:\IonicSpace\MyApp> ionic cordova build android

以上错误的原因是gradle的版本是不对的,应该用gradle-4.10-rc-1版本(为什么真的不知道–)。
下载完之后记得配置Gradle的环境变量。并且,注意,要关闭原来跑命令的DOS窗口,重新开,不然环境变量不起作用的。
另外如果报错说missing 什么平台啥的,那就是SDK tools 没装好。

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 这个错误信息是指在配置项目':app'时出现了问题。 这可能是由于多种因素引起的,比如项目配置文件中的错误、依赖项的版本不兼容等等。要解决这个问题,可以尝试以下几个步骤: 1. 检查项目配置文件是否正确。确保所有配置项都正确设置,并且没有拼写错误或其他语法错误。 2. 确保使用的所有依赖项的版本兼容。可以尝试更新依赖项的版本,或者降低它们的版本,以确保它们能够与您的项目一起正常工作。 3. 尝试清除项目并重新构建。有时候,项目中的缓存文件可能会导致配置错误,清除它们可以解决问题。 如果以上步骤无法解决问题,您可能需要进一步调查错误日志以找出更详细的错误信息。 ### 回答2: 这个问题通常会出现在Android Studio中,它指的是在构建或编译应用程序时发现了错误并无法完成该操作。在遇到这个问题时,我们需要对其进行调试以找到错误的根本原因并解决它。 引起这种问题的原因可能有很多,但最常见的原因是Gradle文件中存在错误。这可能是由于不正确的依赖项、未知的构建选项或语法错误等问题导致的。因此,我们需要仔细检查Gradle文件并修复任何错误。 此外,还有可能是由于Android SDK或NDK缺失或不兼容导致的。如果这是问题的根本原因,我们可以通过打开SDK管理器并下载或升级SDK和NDK来解决它。 另一种可能的情况是Android Studio本身存在问题。在这种情况下,我们可以尝试更新或重新安装Android Studio,并确保使用最新版本。 总之,遇到“a problem occurred configuring project ':app'”这个问题,需要进行系统性的调试和排查,以找到错误的根本原因并解决它。这需要耐心和技巧,并且需要遵循最佳实践和工程技能来解决问题。 ### 回答3: 在Android Studio开发中,有时会遇到“a problem occurred configuring project ':app'”这个错误提示。这个错误的出现是由多种原因造成的,最常见的原因是Gradle配置文件的错误或未正确安装Android Studio的原因。 首先需要检查Gradle配置文件中是否存在语法错误,并确保Gradle配置文件中的所有引用库都已正确引入。同时,需要仔细检查项目的SDK版本和Gradle版本是否符合要求。如果Gradle版本过低或者不兼容,也会导致这个错误的出现。 另外,如果使用的是Windows操作系统,还需要检查系统环境变量是否正确设置。如果系统环境变量设置不正确,Gradle无法正常运行,也会导致这个错误的出现。 如果以上方法都无法解决问题,可以尝试在Android Studio中清除缓存和重新构建项目。在Android Studio菜单栏中选择“Build”-“Clean Project”和“Rebuild Project”,这两个操作会清除任何缓存并重新生成项目文件。 总之,解决“a problem occurred configuring project ':app'”错误有多种方法,要根据具体情况进行分析和解决。需要仔细检查Gradle配置文件、SDK版本、Gradle版本以及系统环境变量等因素,逐一排除可能的问题,最终找到正确的解决方法。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值