美文网首页
Gradle升级

Gradle升级

作者: b_e | 来源:发表于2020-12-12 15:01 被阅读0次

Gradle插件版本

https://developer.android.google.cn/studio/releases/gradle-plugin.html#updating-plugin

升级gradle 3

Project的build.gradle

repositories{}

添加 google()

kotlin_version

替换为 1.3.31

dependencies{}

使用 classpath 'com.android.tools.build:gradle:3.2.1'
删除 classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

gradle-wrapper.properties

使用 distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

Module的build.gradle

dependencies{}

替换

  • compile -> implementation
  • apt -> annotationProcessor
  • testCompile -> testImplementation
  • androidTestCompile -> androidTestImplementation
  • debugCompile -> debugImplementation configuration:已经不支持需要删除
  • releaseCompile -> releaseImplementation configuration:已经不支持需要删除

kotlin替换

  • apt -> kapt 同时添加apply plugin: 'kotlin-kapt'

android.defaultConfig{}

添加 javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }

需要删除

  1. apply plugin: 'android-apt'
  2. apt {}
  3. buildToolsVersion
  4. publishNonDefault true
  5. shrinkResources true

AndroidAnnotations相关

版本

需要 4.0.0 以上

Rest包

dependencies{}中引入

annotationProcessor "org.androidannotations:rest-spring:$AAVersion"
implementation "org.androidannotations:rest-spring-api:$AAVersion"

相关文章

网友评论

      本文标题:Gradle升级

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