我正在尝试导入gradle项目,但一直出现此错误:
org.gradle.tooling.GradleConnectionException:无法使用Gradle发行版'https://services.gradle.org/distributions/gradle-5.6-bin.zip'获取'GradleBuild'类型的模型。 在org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:55) 在org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29) 在org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:43) 在org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor $ 1 $ 1.run(DefaultAsyncConsumerActionExecutor.java:62) 在org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) 在org.gradle.internal.concurrent.ManagedExecutorImpl $ 1.run(ManagedExecutorImpl.java:48) 在java.base / java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 在java.base / java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:628) 在org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) 在java.base / java.lang.Thread.run(Thread.java:834) 在org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46) 在org.gradle.tooling.internal.consumer.DefaultModelBuilder.get(DefaultModelBuilder.java:51) 在org.eclipse.buildship.core.internal.util.gradle.CompatProjectConnection $ CompatModelBuilder.get(CompatProjectConnection.java:254) 在org.eclipse.buildship.core.internal.util.gradle.IdeAttachedProjectConnection.getModel(IdeAttachedProjectConnection.java:82) 在org.eclipse.buildship.core.internal.workspace.DefaultModelProvider.queryModel(DefaultModelProvider.java:114) 在org.eclipse.buildship.core.internal.workspace.DefaultModelProvider.lambda $ null $ 0(DefaultModelProvider.java:49) 在org.eclipse.buildship.core.internal.DefaultGradleBuild $ GradleConnectionOperation.runInToolingApi(DefaultGradleBuild.java:328) 在org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager $ WorkspaceRunnableAdapter.run(DefaultToolingApiOperationManager.java:57)处 在org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2295) 在org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2322) 在org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager.run(DefaultToolingApiOperationManager.java:38) 在org.eclipse.buildship.core.internal.DefaultGradleBuild.withConnection(DefaultGradleBuild.java:121) 在org.eclipse.buildship.core.internal.workspace.DefaultModelProvider.lambda $ fetchModel $ 1(DefaultModelProvider.java:48) com.google.common.cache.LocalCache $ LocalManualCache $ 1.load(LocalCache.java:4878) 在com.google.common.cache.LocalCache $ LoadingValueReference.loadFuture(LocalCache.java:3529) 在com.google.common.cache.LocalCache $ Segment.loadSync(LocalCache.java:2278) 在com.google.common.cache.LocalCache $ Segment.lockedGetOrLoad(LocalCache.java:2155) 在com.google.common.cache.LocalCache $ Segment.get(LocalCache.java:2045) 在com.google.common.cache.LocalCache.get(LocalCache.java:3953) 在com.google.common.cache.LocalCache $ LocalManualCache.get(LocalCache.java:4873) 在org.eclipse.buildship.core.internal.workspace.DefaultModelProvider.getFromCache(DefaultModelProvider.java:97) 在org.eclipse.buildship.core.internal.workspace.DefaultModelProvider.executeOperation(DefaultModelProvider.java:89) 在org.eclipse.buildship.core.internal.workspace.DefaultModelProvider.fetchModel(DefaultModelProvider.java:47) 在org.eclipse.buildship.ui.internal.wizard.project.ProjectPreviewWizardPage.fetchGradleBuildStructure(ProjectPreviewWizardPage.java:458)上 在org.eclipse.buildship.ui.internal.wizard.project.ProjectPreviewWizardPage.access $ 700(ProjectPreviewWizardPage.java:80) 在org.eclipse.buildship.ui.internal.wizard.project.ProjectPreviewWizardPage $ UpdatePreviewOperation.runInToolingApi(ProjectPreviewWizardPage.java:479) 在org.eclipse.buildship.core.internal.operation.ToolingApiOperations $ 1.runInToolingApi(ToolingApiOperations.java:59) 在org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager $ WorkspaceRunnableAdapter.run(DefaultToolingApiOperationManager.java:57)处 在org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2295) 在org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2322) 在org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager.run(DefaultToolingApiOperationManager.java:38) 在org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager.run(DefaultToolingApiOperationManager.java:32) 在org.eclipse.buildship.ui.internal.wizard.project.ProjectPreviewWizardPage $ 4.run(ProjectPreviewWizardPage.java:313) 在org.eclipse.jface.operation.ModalContext $ ModalContextThread.run(ModalContext.java:122) 引起原因:org.gradle.api.UncheckedIOException:java.io.StreamCorruptedException:无效的类型代码:00 在org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:61) 在org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41) 在org.gradle.tooling.internal.provider.serialization.PayloadSerializer.deserialize(PayloadSerializer.java:76) 在org.gradle.tooling.internal.provider.ProviderConnection.throwFailure(ProviderConnection.java:206) 在org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:194) 在org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:136) 在org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.java:203) 在org.gradle.tooling.internal.consumer.connection.CancellableModelBuilderBackedModelProducer.produceModel(CancellableModelBuilderBackedModelProducer.java:54) 在org.gradle.tooling.internal.consumer.connection.PluginClasspathInjectionSupportedCheckModelProducer.produceModel(PluginClasspathInjectionSupportedCheckModelProducer.java:38) 在org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:62) 在org.gradle.tooling.internal.consumer.connection.ParameterValidatingConsumerConnection.run(ParameterValidatingConsumerConnection.java:47) 在org.gradle.tooling.internal.consumer.DefaultModelBuilder $ 1.run(DefaultModelBuilder.java:64) 在org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:87) 在org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45) 在org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:61) 在org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38) 在org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor $ 1 $ 1.run(DefaultAsyncConsumerActionExecutor.java:60) 在org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) 在org.gradle.internal.concurrent.ManagedExecutorImpl $ 1.run(ManagedExecutorImpl.java:48) 在java.base / java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 在java.base / java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:628) 在org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) 在java.base / java.lang.Thread.run(Thread.java:834) 原因:java.io.StreamCorruptedException:无效的类型代码:00 在java.base / java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1622) 在java.base / java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2355) 在java.base / java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2249) 在java.base / java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2087) 在java.base / java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594) 在java.base / java.io.ObjectInputStream.readArray(ObjectInputStream.java:1993) 在java.base / java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1588) 在java.base / java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2355) 在java.base / java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2249) 在java.base / java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2087) 在java.base / java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594) 在java.base / java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2355) 在java.base / java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2249) 在java.base / java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2087) 在java.base / java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594) 在java.base / java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2355) 在java.base / java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2249) 在java.base / java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2087) 在java.base / java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594) 在java.base / java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2355) 在java.base / java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2249) 在java.base / java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2087) 在java.base / java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594) 在java.base / java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2355) 在java.base / java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2249) 在java.base / java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2087) 在java.base / java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594) 在java.base / java.io.ObjectInputStream.readObject(ObjectInputStream.java:430) 在org.gradle.tooling.internal.provider.serialization.PayloadSerializer.deserialize(PayloadSerializer.java:74) ...另外20个
在Eclipse的问题部分中,它说:
无法使用Gradle发行版“ https://services.gradle.org/distributions/gradle-5.6-bin.zip”运行分阶段的构建操作。 java.io.StreamCorruptedException:无效的类型代码:00 类型代码无效:00
我的操作系统是Linux Ubuntu 18.04。有什么想法吗?
答案 0 :(得分:0)
尝试一下:
ls -l ~/.gradle/wrapper/dists/
rm -rf ~/.gradle/wrapper/dists/gradle-5.6.bin.zip/
然后重新启动Android Studio,并等待gradle bin下载。