You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Jenkins本地构建Ionic Android项目失败:依赖解析错误求助

问题分析与解决方案

Hey there! Let's break down what's going on with your Android build failure in Jenkins, and fix it step by step.

核心错误原因

This is not a dependency issue — the real problem lies in your network proxy configuration. The repeated error corphttpsproxyhost.yourdomain: Name or service not known tells us that the Jenkins machine can't resolve the proxy server's domain name. Because of this, Gradle can't reach the remote repositories (jcenter and maven.google.com) to download the Android Gradle Plugin 3.0.0 files it needs to configure the build.

In short: Your Jenkins environment has an incorrect/unresolvable HTTP/HTTPS proxy set up, which is blocking Gradle's dependency download requests.

解决步骤

Here's how to fix this:

  1. Check Jenkins Global Proxy Settings

    • Go to your Jenkins dashboard → Manage Jenkins → Configure System.
    • Find the "Proxy Server" section. Verify if the proxy host corphttpsproxyhost.yourdomain is correct. Try pinging this domain from the Jenkins machine — if it fails, you either have a typo in the proxy address, or your machine's DNS can't resolve this internal proxy domain. Correct the host name or fix the DNS resolution.
  2. Inspect Gradle Proxy Configuration

    • Gradle might have its own proxy settings separate from Jenkins. Check the gradle.properties file (either in your project's root directory, or in the Jenkins user's .gradle folder) for lines like:
      systemProp.http.proxyHost=corphttpsproxyhost.yourdomain
      systemProp.http.proxyPort=XXXX
      systemProp.https.proxyHost=corphttpsproxyhost.yourdomain
      systemProp.https.proxyPort=XXXX
      
    • If these exist, confirm the proxy details are accurate. If you don't need a proxy (e.g., your local network can access maven repositories directly), comment out these lines.
  3. Verify Network Connectivity

    • On the Jenkins machine, run this command manually to test if you can reach the dependency URL:
      curl https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
      
    • If curl throws the same "name or service not known" error, focus on fixing your network/proxy setup first — this is the root block.
  4. Optional: Use Domestic Maven Mirrors

    • If you're having trouble accessing foreign repositories, replace the default repositories in your project's android/build.gradle with domestic mirrors (like Alibaba Cloud) to bypass proxy issues:
      buildscript {
          repositories {
              maven { url 'https://maven.aliyun.com/repository/public' }
              maven { url 'https://maven.aliyun.com/repository/google' }
              jcenter()
              google()
          }
          dependencies {
              classpath 'com.android.tools.build:gradle:3.0.0'
          }
      }
      
    • This will make Gradle prioritize downloading dependencies from faster, more accessible domestic sources.

内容的提问来源于stack exchange,提问作者Akshay Paliwal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 07:25:44