Meituan-Dianping / Robust

Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

android studio4.2.1编译demo报错

dijiubuzhan opened this issue · comments

异常类型:app编译异常

Robust版本:如:0.4.96

Gradle版本:6.5

系统:如:Windows

Compile Sdk Version:29(android 10.0 (Q))

Build Toll Version:29.0.2

android studio版本:4.2.1

堆栈/日志:

Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'com.github.dcendents.android-maven']
Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'AndroidMavenPlugin'.
Caused by: java.lang.IllegalArgumentException: Unable to determine constructor argument #1: missing parameter of type Factory, or no service of type Factory.

使用android studio3.5.2编译没问题,所以问题是Robust对android studio版本的兼容性问题

  1. Open your root project file - build.gradle
  2. Modify the repositories as follows:
buildscript {
    repositories {
        mavenLocal()
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.meituan.robust:gradle-plugin:0.4.96'
        classpath 'com.meituan.robust:auto-patch-plugin:0.4.96'
        classpath 'me.tatarka:gradle-retrolambda:3.2.0'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
        classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
    }
    configurations.classpath.exclude group: 'com.android.tools.external.lombok'
}
configurations.all {
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()

        maven {
            url "http://depot.sankuai.com/nexus/content/groups/public/"
        }
    }
    tasks.withType(JavaCompile) { options.encoding = "UTF-8" }
}