Precautions and solutions after Android studio 3.0 upgrade

The maximum version of gradle plugin is 4.0*

When an old project uses a new version, the gradle plugin may conflict

resolvent:

Go to the gradle installation directory (file - > other settings - > default settings, and then search for gradle. There is a service directory path on the right to see your gradle directory). Under the. Gradle \ wrapper \ dists directory, find the file with the same version number as that in the gradle-wrapper.properties of the project (such as gradle-3.3-all), delete it and recompile it

Cannot choose between the following configurations. The reason for this problem is that the project references other projects, such as compileproject (: Library),

resolvent:

After Android studio 3.0, you need to use the following methods:

With the release of Android gradle plug-in version 2.2, the author of Android apt recently issued a statement on the official website, confirmed that Android apt will not be maintained in the future, and recommended that you use the same capabilities provided by the official Android plug-in. In other words, Android apt launched about three years ago is about to bid farewell to developers and exit the stage of history. The Android gradle plug-in provides a function called annotationprocessor to completely replace Android apt. the replacement steps are as follows:

Remove the relevant configuration of Android apt in the build.gradle file of the module, that is, delete the configuration similar to the following:

Modify the dependency imported by apt in the build.gradle file of the module to be imported by annotationprocessor. The configuration before modification is as follows:

The modified configuration is as follows:

summary

The above is the precautions for the use of Android studio3.0 after upgrade introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>