Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got java.lang.NoSuchMethodError when running ./closeAndReleaseRepository #204

Closed
kevindavee opened this issue May 3, 2021 · 6 comments
Closed

Comments

@kevindavee
Copy link

Hi guys,

I'm getting this error when I try to run ./closeAndReleaseRepository both in my local machine and also my CD machine.

Caused by: java.lang.NoSuchMethodError: 'byte[] kotlin.collections.ArraysKt.copyInto(byte[], byte[], int, int, int)'
        at okio.Segment.writeTo(Segment.kt:169)
        at okio.Segment.compact(Segment.kt:152)
        at okio.Buffer.write(Buffer.kt:1842)
        at okio.Buffer.read(Buffer.kt:1854)
        at okio.Buffer.writeAll(Buffer.kt:1642)
        at okio.Options$Companion.buildTrieRecursive(Options.kt:187)
        at okio.Options$Companion.buildTrieRecursive(Options.kt:174)
        at okio.Options$Companion.buildTrieRecursive$default(Options.kt:113)
        at okio.Options$Companion.of(Options.kt:72)
        at okhttp3.internal.Util.<clinit>(Util.kt:71)
        at okhttp3.OkHttpClient.<clinit>(OkHttpClient.kt:1073)
        at io.codearte.gradle.nexus.BaseStagingTask.createClient(BaseStagingTask.groovy:72)
        at io.codearte.gradle.nexus.CloseRepositoryTask.closeRepository(CloseRepositoryTask.groovy:19)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:786)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:753)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
        ... 31 more

I'm not really sure what is this error about. Can someone help me?

@szpak
Copy link
Member

szpak commented May 3, 2021

Gradle 7?

@kevindavee
Copy link
Author

I use Gradle 4.9.0

@szpak
Copy link
Member

szpak commented May 3, 2021

Do you use Groovy-based configuration (build.gradle) or Kotlin-based (build.gradle.kts)?

@kevindavee
Copy link
Author

I use Groovy based configuration (build.gradle)

@szpak
Copy link
Member

szpak commented May 3, 2021

In #188, the network library has been changed to okhttp 4, which under the hood uses Kotlin. Gradle 4.9 is quite old and I suspect it might provide older Kotlin version which affects the execution. You could:

  1. Upgrade Gradle to 6.x (or at least 5.x) to check if it helps.
  2. Downgrade plugin version to 0.22.0 (if the Gradle change is problematic).
  3. Consider migration to gradle-nexus-publish-plugin which is a successor of that plugin (especially if you are getting started with the plugin).

@kevindavee
Copy link
Author

Gradle 5.0 fix the issue! Thanks @szpak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants