1.Unsupported method: NativeArtifact.getSourceFolders().
一、問題描述
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.
二、解決問題
上面的意思就是所使用的 gradle 外掛的版本里面找不到 NativeArtifact.getSourceFolders() 方法。原來使用的是
classpath 'com.android.tools.build:gradle:3.0.1-alpha02'
看來是不穩定版,但在ofollow,noindex">Andriod 原始碼 查到這個方法在舊版本中都有的,所以可能是alpha02版本在同步外掛的時候出了問題。改成如下後解決
classpath 'com.android.tools.build:gradle:3.0.1'