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

PayU支付网关项目构建报错:无法解析releaseRuntimeClasspath配置依赖

PayU支付网关依赖解析失败(502 Bad Gateway)解决方法

问题背景

项目自去年起使用PayU支付网关,此前运行正常,近期启动时出现依赖解析错误,核心报错信息如下:

> Could not resolve all artifacts for configuration ':payu-non-seam-less-react:releaseRuntimeClasspath'.
   > Could not resolve in.payu:payu-crash-logger:[1.0.4,1.1.0).
     Required by:
         project :payu-non-seam-less-react > in.payu:payu-checkout-pro:1.8.9
         project :payu-non-seam-less-react > in.payu:payu-checkout-pro:1.8.9 > in.payu:payu-sdk:5.4.7
      > Failed to list versions for in.payu:payu-crash-logger.
         > Unable to load Maven meta-data from https://phonepe.bintray.com/PhonePeIntentSDK/in/payu/payu-crash-logger/maven-metadata.xml.
            > Could not get resource 'https://phonepe.bintray.com/PhonePeIntentSDK/in/payu/payu-crash-logger/maven-metadata.xml'.    
               > Could not GET 'https://phonepe.bintray.com/PhonePeIntentSDK/in/payu/payu-crash-logger/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

错误截图

问题原因

PhonePe的Bintray仓库已停止服务(Bintray官方在2021年终止了免费服务),导致依赖请求返回502错误,而旧版本的PayU SDK(如payu-checkout-pro:1.8.9)仍配置从该失效仓库拉取payu-crash-logger依赖。

解决步骤

  • 替换仓库源:在项目根目录或对应模块的build.gradle文件中,添加PayU官方维护的仓库,并移除失效的PhonePe Bintray仓库配置:

    repositories {
        mavenCentral()
        // 添加PayU官方仓库
        maven { url "https://artifactory.payu.in/artifactory/payu-release" }
        // 移除旧的PhonePe Bintray仓库(如果存在)
        // maven { url "https://phonepe.bintray.com/PhonePeIntentSDK" }
    }
    
  • 锁定依赖版本:避免动态版本范围[1.0.4,1.1.0)带来的解析问题,直接强制指定payu-crash-logger的稳定版本:

    configurations.all {
        resolutionStrategy.force 'in.payu:payu-crash-logger:1.0.9' // 选择版本范围内的稳定版
    }
    
  • 升级PayU SDK版本:旧版本SDK存在仓库配置过时问题,建议升级到PayU官方最新的payu-checkout-pro稳定版本,新版本已修复依赖源相关问题。

  • 清理Gradle缓存:执行以下命令清理本地缓存并重新拉取依赖:

    ./gradlew clean build --refresh-dependencies
    

内容的提问来源于stack exchange,提问作者Deepak Singh

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.12 19:31:04