美文网首页
包冲突依赖分析

包冲突依赖分析

作者: CentForever | 来源:发表于2022-05-25 17:01 被阅读0次

分析依赖

常见指令

  • gradlew :app:dependencyInsight --configuration debugCompileClasspath --dependency work-runtime
  • ./gradlew -q :ecabin:dependencyInsight --dependency support-annotations --configuration compile
  • ./gradlew :app:androidDependencies
  • 指令前的:app是你的module名
  • configuration 参数用于指定 variant,例如你还可以传入 releaseCompileClasspath
─   ~/AndroidStudioProjects/FileDownloader ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────── at  16:39:12 ─╮
╰─❯ ./gradlew :app:dependencyInsight --configuration debugCompileClasspath --dependency work-runtime                                                                            ─╯

> Task :app:dependencyInsight
No dependencies matching given input were found in configuration ':app:debugCompileClasspath'

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

╭─   ~/AndroidStudioProjects/FileDownloader ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────── at  16:40:20 ─╮
╰─❯ ./gradlew :ecabin:dependencyInsight --configuration debugCompileClasspath --dependency work-runtime                                                                         ─╯

> Task :ecabin:dependencyInsight
androidx.work:work-runtime:2.7.1
   variant "releaseVariantReleaseApiPublication" [
      org.gradle.category                             = library (not requested)
      org.gradle.dependency.bundling                  = external (not requested)
      org.gradle.libraryelements                      = aar (not requested)
      org.gradle.usage                                = java-api
      org.gradle.status                               = release (not requested)

      Requested attributes not found in the selected variant:
         com.android.build.api.attributes.BuildTypeAttr  = debug
         org.gradle.jvm.environment                      = android
         com.android.build.api.attributes.AgpVersionAttr = 7.2.0
   ]
   Selection reasons:
      - By constraint : debugRuntimeClasspath uses version 2.7.1

androidx.work:work-runtime:2.7.1
\--- debugCompileClasspath

androidx.work:work-runtime:{strictly 2.7.1} -> 2.7.1
\--- debugCompileClasspath

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

注意事项

  • gradle.properties 添加org.gradle.java.home=/Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home

参考

QA

image.png

相关文章

  • 包冲突依赖分析

    分析依赖 常见指令 gradlew :app:dependencyInsight --configuration ...

  • maven依赖冲突以及解决方法

    什么是依赖冲突 依赖冲突是指项目依赖的某一个jar包,有多个不同的版本,因而造成类包版本冲突 依赖冲突的原因 依赖...

  • Android Studio常见问题整理

    包冲突问题处理 查看app的依赖情况 解决依赖包冲突的方式 在处理依赖包冲突时发现.以下两种方式的作用不一 方式①...

  • 解决项目中jar包冲突的终极方案

    项目中经常会碰到jar包冲突,而很多情况下冲突的包是由于其他包依赖引入的,这个时候我们无法直接分辨冲突包是哪个依赖...

  • 彻底认识包(依赖)冲突

    什么是包(依赖)冲突? 包冲突是指在一个项目的不同部分引用(依赖)的代码库、资源包的版本号不一致。 包冲突的实质是...

  • Maven中依赖冲突解决方案

    在使用Maven中我们导入jar包坐标时会产生依赖传递,而依赖传递难免会发生jar包间的依赖冲突,解决jar包冲突...

  • androidstudio gradle 解决包冲突的方法

    exclue :附录 去掉全部依赖 去掉部分冲突 强制依赖某个版本 包依赖冲突的时候 转载:https://bl...

  • Maven解决依赖冲突

    maven依赖冲突以及解决方法 什么是依赖冲突 依赖冲突是指项目依赖的某一个jar包,有多个不同的版本,因而造成类...

  • maven jar包冲突原理与解决办法

    jar 包冲突原因 大概就是jar包冲突(今天遇到的是第一种) 依赖传递 因为Maven拥有传递依赖的特性,因此真...

  • flutter package 版本冲突

    当你的项目需要安装的依赖包越多,遇到包冲突可能性就越大,尤其是当依赖的包有重大更新时 解决办法: 1.将冲突的包版...

网友评论

      本文标题:包冲突依赖分析

      本文链接:https://www.haomeiwen.com/subject/juaeprtx.html