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

java.lang.NoSuchFieldError in SqlDelightReferenceContributor.kt:67 #3324

Closed
square-clippy opened this issue Jun 19, 2022 · 5 comments · Fixed by #3422
Closed

java.lang.NoSuchFieldError in SqlDelightReferenceContributor.kt:67 #3324

square-clippy opened this issue Jun 19, 2022 · 5 comments · Fixed by #3422
Labels

Comments

@square-clippy
Copy link
Collaborator

Error in SQL Delight IntelliJ Plugin

java.lang.NoSuchFieldError in SqlDelightReferenceContributor.kt:67
Companion

View on Bugsnag

Stacktrace

SqlDelightReferenceContributor.kt:67 - app.cash.sqldelight.intellij.SqlDelightReferenceContributor$JavaTypeReference.resolve
SqlDelightClassNameElementAnnotator.kt:42 - app.cash.sqldelight.intellij.SqlDelightClassNameElementAnnotator.annotate
SqlDelightHighlightVisitor.kt:53 - app.cash.sqldelight.intellij.lang.SqlDelightHighlightVisitor.analyze

View full stacktrace

Created automatically via Bugsnag

@vanniktech
Copy link
Contributor

I get this as well when opening a project that uses sqldelight with IntelliJ 2022.2:

java.lang.NoSuchFieldError: Companion
	at app.cash.sqldelight.intellij.SqlDelightReferenceContributor$JavaTypeReference.resolve(SqlDelightReferenceContributor.kt:67)
	at com.intellij.codeInsight.TargetElementUtilBase.getReferencedElement(TargetElementUtilBase.java:177)
	at com.intellij.codeInsight.TargetElementUtilBase.doGetReferenceOrReferencedElement(TargetElementUtilBase.java:165)
	at com.intellij.codeInsight.TargetElementUtilBase.getReferenceOrReferencedElement(TargetElementUtilBase.java:210)
	at com.intellij.codeInsight.TargetElementUtilBase.getReferencedElement(TargetElementUtilBase.java:254)
	at com.intellij.codeInsight.TargetElementUtilBase.doFindTargetElement(TargetElementUtilBase.java:233)
	at com.intellij.codeInsight.TargetElementUtilBase.findTargetElement(TargetElementUtilBase.java:298)
	at com.intellij.codeInsight.TargetElementUtil.findTargetElement(TargetElementUtil.java:147)
	at com.intellij.model.psi.impl.TargetsKt.fromTargetEvaluator(targets.kt:173)
	at com.intellij.model.psi.impl.TargetsKt.declarationsOrReferences(targets.kt:134)
	at com.intellij.model.psi.impl.TargetsKt.declaredReferencedData(targets.kt:41)
	at com.intellij.model.psi.impl.TargetsKt.targetSymbols(targets.kt:23)
	at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.getTargetSymbols(IdentifierHighlighterPass.java:194)
	at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.highlightReferencesAndDeclarations(IdentifierHighlighterPass.java:186)
	at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.doCollectInformation(IdentifierHighlighterPass.java:91)
	at com.intellij.codeInsight.highlighting.BackgroundHighlighter.lambda$updateHighlighted$1(BackgroundHighlighter.java:150)
	at com.intellij.codeInsight.highlighting.BackgroundHighlightingUtil.lambda$lookForInjectedFileInOtherThread$0(BackgroundHighlightingUtil.java:54)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:536)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:501)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1154)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:75)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:158)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:115)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:66)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:112)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:75)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:501)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:408)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)

@vanniktech
Copy link
Contributor

Also using Kotlin 1.7.10 which might make a difference.

@madisp
Copy link
Contributor

madisp commented Aug 7, 2022

same here, I think the underlying Kotlin plugin has been changed. I can take a stab at fixing this, but ideally this should be done in a version-agnostic way, either using some sort of adapters or reflection.

what would the preferred way be here?

@vanniktech
Copy link
Contributor

I think we need: #3358

It seems like Moshi is failing there

@madisp
Copy link
Contributor

madisp commented Aug 7, 2022

It would break backwards compat though? OTOH for alpha it could be fine to require a later Kotlin plugin.

EDIT: nevermind, that PR is about bumping IJ plugin development plugin itself, for this to link properly the underlying IDEA version should be bumped:

https://github.com/cashapp/sqldelight/blob/master/gradle/libs.versions.toml#L5

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

Successfully merging a pull request may close this issue.

3 participants