Android Studio 3.0 Canary 4不支持的方法NativeArtifact.getRuntimeFiles()

mon*_*eyM 6 android android-studio

我的项目在android studio 2.3下运行良好.但是使用3.0时,它无法刷新此错误:

Error:Unsupported method: NativeArtifact.getRuntimeFiles().
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.
Run Code Online (Sandbox Code Playgroud)

我正在使用Gradle 2.14.1和Gradle android插件2.2.0.升级Gradle(至3.5)无法解决问题.

有没有其他人有这个问题,并能找到任何解决方法?

小智 8

我使用'com.android.tools.build:gradle:3.3.0'有相同的错误消息.

我找到了两种修复此错误的方法:

  • 将Android Studio更新到3.3版(帮助 - >检查更新...)
  • 或者在build.gradle中切换到"com.android.tools.build:gradle:3.2.1".


小智 6

尝试更改build.gradle

 dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
}
Run Code Online (Sandbox Code Playgroud)