Yesterday, i updated my android studio to release 2.3.1.
Since then i am getting the following error
Gradle sync failed: Cause: invalid CEN header (bad signature)
while syncing the gradle project
the idea.log file shows the following:
2017-04-06 19:02:04,357 [ 21782] WARN - nal.AbstractExternalSystemTask - Cause: invalid CEN header (bad signature) com.intellij.openapi.externalSystem.model.ExternalSystemException: Cause: invalid CEN header (bad signature)
at com.android.tools.idea.gradle.project.sync.idea.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:86)
at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:361)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:769)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:749)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:227)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:112)
Caused by: java.util.zip.ZipException: invalid CEN header (bad signature)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.loadModuleProperties(DefaultModuleRegistry.java:184)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.loadModule(DefaultModuleRegistry.java:88)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.getModule(DefaultModuleRegistry.java:77)
at org.gradle.api.internal.classpath.DefaultPluginModuleRegistry.getPluginModules(DefaultPluginModuleRegistry.java:39)
at org.gradle.api.internal.DynamicModulesClassPathProvider.findClassPath(DynamicModulesClassPathProvider.java:47)
at org.gradle.api.internal.DefaultClassPathRegistry.getClassPath(DefaultClassPathRegistry.java:34)
at org.gradle.initialization.DefaultClassLoaderRegistry.<init>(DefaultClassLoaderRegistry.java:31)
at org.gradle.internal.service.scopes.GlobalScopeServices.createClassLoaderRegistry(GlobalScopeServices.java:224)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498)
As some of the other threads mentioned, have done the following so far:
Removed the gradle-xxx.zip file from the tools and re-downloaded the zip file, but does not seem to have worked.
I also created a dummy project to see if this is project specific issue but got the same issue
I have also removed the SDK tools and SDK from sdk manager and installed them again but got the same error
am totally stuck now and dont see a way forward :(, any suggestions would help
Finally got it fixed by changing the setting in the build.gradle from
com.android.tools.build:gradle:3.0.0
to
com.android.tools.build:gradle:2.3.1