leor
leor
  • 发布:2025-04-20 12:47
  • 更新:2025-04-20 13:31
  • 阅读:953

uts 云打包androidx.core:core依赖冲突。

分类:uts
{  
  "dependencies": [  
    {  
      "id": "com.pangle.global:pag-sdk",  
      "source": "implementation ('com.pangle.global:pag-sdk:7.1.0.5')"  
    }  
  ],  
  "minSdkVersion": 21,  
  "project": {  
    "repositories": [  
      "google()",  
      "mavenCentral()",  
      "maven { url 'https://artifact.bytedance.com/repository/pangle' }"  
    ]  
  }  
}

这是我的 uts 插件的 config.json 配置。在提交云端打包时出现androidx.core:core依赖版本冲突。下面是完整的错误信息:

AILURE: Build failed with an exception.  
[HBuilder] 03:14:41.697   
[HBuilder] 03:14:41.697 * What went wrong:  
[HBuilder] 03:14:41.697 Execution failed for task ':uni_modules:ysquare-pagnle:compileReleaseKotlin'.  
[HBuilder] 03:14:41.697 > Could not resolve all files for configuration ':uni_modules:ysquare-pagnle:releaseCompileClasspath'.  
[HBuilder] 03:14:41.697    > Could not resolve androidx.core:core:1.6.0.  
[HBuilder] 03:14:41.697      Required by:  
[HBuilder] 03:14:41.697          project :uni_modules:ysquare-pagnle  
[HBuilder] 03:14:41.698          project :uni_modules:ysquare-pagnle > androidx.core:core-ktx:1.6.0  
[HBuilder] 03:14:41.698       > Cannot find a version of 'androidx.core:core' that satisfies the version constraints:  
[HBuilder] 03:14:41.698            Dependency path '408e8350-1d52-11f0-85d9-37be88892141.uni_modules:ysquare-pagnle:unspecified' --> 'androidx.core:core:1.6.0'  
[HBuilder] 03:14:41.698            Constraint path '408e8350-1d52-11f0-85d9-37be88892141.uni_modules:ysquare-pagnle:unspecified' --> 'androidx.core:core:{strictly 1.1.0}' because of the following reason: version resolved in configuration ':uni_modules:ysquare-pagnle:releaseRuntimeClasspath' by consistent resolution  
[HBuilder] 03:14:41.698            Dependency path '408e8350-1d52-11f0-85d9-37be88892141.uni_modules:ysquare-pagnle:unspecified' --> 'androidx.core:core-ktx:1.6.0' (releaseApiPublication) --> 'androidx.core:core:1.6.0'  
[HBuilder] 03:14:41.698   
[HBuilder] 03:14:41.698 > There is 1 more failure with an identical cause.  
[HBuilder] 03:14:41.698   
[HBuilder] 03:14:41.698 * Try:  
[HBuilder] 03:14:41.698 > Run with --stacktrace option to get the stack trace.  
[HBuilder] 03:14:41.698 > Run with --info or --debug option to get more log output.  
[HBuilder] 03:14:41.698 > Run with --scan to get full insights.  
[HBuilder] 03:14:41.698 > Get more help at https://help.gradle.org.  
[HBuilder] 03:14:41.698   
[HBuilder] 03:14:41.698 BUILD FAILED in 1m 4s

我通过导出到本地原生Android Studio可以正常打包成功。

错误日志链接:https://app.liuyingyong.cn/build/errorLog/408e8350-1d52-11f0-85d9-37be88892141

2025-04-20 12:47 负责人:无 分享
已邀请:
leor

leor (作者)

请各位大佬指导一下,并没有依赖很多其他复杂的依赖项。但是出现这个错误。不知道什么问题

leor

leor (作者)

解决了,pangle官方sdk依赖了androidx.core:core1.1.0,通过 source修改排除pangle的androidx.core:core的依赖就正常了。

{  
  "dependencies": [  
    {  
      "id": "com.pangle.global:pag-sdk",  
      "source": "implementation('com.pangle.global:pag-sdk:7.1.0.5') {exclude group: 'androidx.core', module: 'core'}"  
    }  
  ],  
  "minSdkVersion": 21,  
  "project": {  
    "repositories": [  
      "google()",  
      "mavenCentral()",  
      "maven { url 'https://artifact.bytedance.com/repository/pangle' }"  
    ]  
  }  
}

要回复问题请先登录注册