Android compilation error: org.jetbrains.plugins . gradle.tooling.uti

Time:2020-5-22

A new project based on react native version 0.60.5 was created. The following error was built when compiling the project with Android Studio:

org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.getModuleIdentifier()

According to the type of error reporting, it is the version of gradle. Google found that the IDE version of Android (3.1.2) is too low to be compatible with the gradle version of the project.
The version in the project is, by viewing / gradle / wrapper / gradle- wrapper.properties The contents of the file are as follows: 5.4.1

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Considering the compatibility of the project, it is currently considered to reduce the version of gradle, as follows:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

You think that’s it? too young too simple.
Rebuild will report the following error:

Could not get unknown property 'mergeResourcesProvider' for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl.

What should I do? Go ahead.
Enter the build.gradle Document, amend to read:

dependencies {
        classpath("com.android.tools.build:gradle:3.4.1")
        //Modify the above gradle version to the following:
        classpath("com.android.tools.build:gradle:3.3.0")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

It’s OK to rebuild the project.

Welcome to my official account, Junwei said.
Android compilation error: org.jetbrains.plugins . gradle.tooling.uti
Personal website: https://wayne214.github.io