升级可能遇到的问题:
- NoClassDefFoundError: com/squareup/javapoet/TypeName
- No signature of method: build_xxxxx.android()?
- What went wrong:
Could not resolve all dependencies for configuration ':detachedConfiguration13'.
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://maven.aliyun.com/nexus/content/groups/public/)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
gradle.properties
GRADLE_BUILD_TOOL_VERSION=4.2.0
apk/build.gradle
classpath 'com.android.tools.build:gradle:'+GRADLE_BUILD_TOOL_VERSION
gradle-wraper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
- 废弃方法替代
compile根据用例,该配置已被 api 或 implementation 替换。
同样适用于 *Compile 变体,例如 debugCompile。
provided
该配置已被 compileOnly 替换。
同样适用于 *Provided 变体,例如 releaseProvided。
apk
该配置已被 runtimeOnly 替换。
publish
该配置已被 runtimeOnly 替换。
- packageBuildConfig false
+ buildFeatures {
+ buildConfig = false
+ }
- javaCompileOptions {
- annotationProcessorOptions {
- includeCompileClasspath = true
- }
- }
- provided 'com.squareup:javapoet:1.9.0'
+ compileOnly 'com.squareup:javapoet:1.9.0'
+ annotationProcessor 'com.squareup:javapoet:1.9.0'
- buildToolsVersion = '28.0.3'
+ buildToolsVersion = '29.0.2'
网友评论