gradlew常用命令笔记

  • 查看错误信息:

  • gradlew compileDebugSources

  • .\gradlew compileDebug --stacktrace

  • .\gradlew compileDebugSources

  • 查看依赖

  • gradlew :app:dependencies

  • 查看依赖关系

  • ./gradlew :app:dependencies –configuration compile

  • 剔除重复依赖

 api('com.github.niorgai:StatusBarCompat:2.3.3', {
        exclude group: 'androidx.appcompat:appcompat'
        exclude group: 'com.google.android.material:material'
    })
  • ./gradlew -v 版本号

  • ./gradlew clean 清除app目录下的build文件夹

  • ./gradlew build 检查依赖并编译打包

  • /gradlew build 命令把debug、release环境的包都打出来

  • ./gradlew assembleDebug 编译并打Debug包

  • ./gradlew assembleRelease 编译并打Release的包

  • ./gradlew aR

  • ./gradlew installRelease Release模式打包并安装

  • ./gradlew iR

  • ./gradlew uninstallRelease 卸载Release模式包

上一篇:IDEA创建SpringBoot项目报错:Initialization failed for ‘https://start.spring.io’


下一篇:Android Library 发布开源库 JCenter & JitPack 攻略