Gradle sync failed: Unsupported method: NativeArtifact.getSourceFolders().

错误如下:

8:33	Gradle sync failed: Unsupported method: NativeArtifact.getSourceFolders().
		The version of Gradle you connect to does not support that method.
		To resolve the problem you can change/upgrade the target version of Gradle you connect to.
		Alternatively, you can ignore this exception and read other information from the model.
		Consult IDE log for more details (Help | Show Log) (3s 37ms)

这是因为使用的gradle版本太高导致。找到以下语句修改即可: 

dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
发布了2631 篇原创文章 · 获赞 342 · 访问量 206万+

猜你喜欢

转载自blog.csdn.net/quantum7/article/details/105338119