Main method cannot be run after Android Studio is upgraded to 3.0 or 4.0

Since upgrading Android Studio 3.0 4.0, I can no longer run the Main method of java and report an error directly, as shown in the figure:

Some netizens said that adding "android.enableAapt2=false" to the gradle.properties of the project did not work in personal testing, but it would also cause

appcompat-v7:28.0.0.aar文件中的资源丢失,最直接的解决办法就是:

Add it under the .idea/gradle.xml/<GradleProjectSettings> node of the project

<option name="delegatedBuild" value="false" />
重新编译问题解决.

 

Guess you like

Origin blog.csdn.net/zhao8856234/article/details/108801631