Gradle sync失败 - Android studio 3.0.1

时间:2017-11-22 03:17:46

标签: android gradle android-gradle

我正在尝试将现有项目(apigee的示例项目)导入Android Studio 3.0.1。我收到以下错误:

  

Gradle sync失败:没有方法签名:org.gradle.internal.classloader.FilteringClassLoader.allowPackage()适用于参数类型:(java.lang.String)values:[org.apache.tools.zip] < / p>

注意:我确实将graddle-wrapper.properties文件条目从distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-all.zip更改为distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip,因为我遇到了之前的错误。

项目结构中的Gradle版本也是4.1。

以下是日志摘录:

2017-11-21 19:45:01,324 [se-915-b01]   INFO - tor.impl.FileEditorManagerImpl - Project opening took 875 ms 
2017-11-21 19:45:02,350 [ thread 20]   INFO - .project.GradleProjectResolver - Gradle project resolve error 
org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.1-all.zip'.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
....
Caused by: org.gradle.internal.exceptions.LocationAwareException: Build file 'C:\apigee-android-sdk-2.0.14\source\build.gradle' line: 2
A problem occurred evaluating root project 'apigee-android'.
    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
......
Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'apigee-android'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:92)
....
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [class 'com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin']
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:150)
....
Caused by: groovy.lang.MissingMethodException: No signature of method: org.gradle.internal.classloader.FilteringClassLoader.allowPackage() is applicable for argument types: (java.lang.String) values: [org.apache.tools.zip]
    at com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.apply(ShadowBasePlugin.groovy:36)
......
2017-11-21 19:45:02,361 [ thread 20]   WARN - nal.AbstractExternalSystemTask - No signature of method: org.gradle.internal.classloader.FilteringClassLoader.allowPackage() is applicable for argument types: (java.lang.String) values: [org.apache.tools.zip] 
com.intellij.openapi.externalSystem.model.LocationAwareExternalSystemException: No signature of method: org.gradle.internal.classloader.FilteringClassLoader.allowPackage() is applicable for argument types: (java.lang.String) values: [org.apache.tools.zip]
    at com.android.tools.idea.gradle.project.sync.idea.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:81)
......
Caused by: groovy.lang.MissingMethodException: No signature of method: org.gradle.internal.classloader.FilteringClassLoader.allowPackage() is applicable for argument types: (java.lang.String) values: [org.apache.tools.zip]
    at com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.apply(ShadowBasePlugin.groovy:36)

0 个答案:

没有答案