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

Unknown constant pool type #1150

Open
249106156 opened this issue Apr 1, 2024 · 9 comments
Open

Unknown constant pool type #1150

249106156 opened this issue Apr 1, 2024 · 9 comments
Labels
bug Something isn't working enhancement New feature or request more information needed

Comments

@249106156
Copy link

Build scan link

Plugin version
1.30.0

Gradle version
8.6

JDK version
17

(Optional) Kotlin and Kotlin Gradle Plugin (KGP) version
1.9.0

(Optional) Android Gradle Plugin (AGP) version
8.2.0

(Optional) reason output for bugs relating to incorrect advice

Describe the bug
When running the task buildHealth, an error throws with Unknown constant pool type. I review the source code and find src/main/kotlin/com/autonomousapps/internal/ConstantPoolParser.kt throws exception. But the root cause cannot be located from my project. Is it possible to enhance the log with the location?

To Reproduce
Steps to reproduce the behavior:

  1. ...

Expected behavior
Enhance the exception log with the cause location, like which class or constant causes the error.

Additional context

@autonomousapps
Copy link
Owner

So this is a feature request to add more logging? Given the nature of that code, I'm not entirely sure logging the unknown byte will be useful, but I suppose it can't hurt.

Do you have a stacktrace or minimal reproducer?

@249106156
Copy link
Author

So this is a feature request to add more logging? Given the nature of that code, I'm not entirely sure logging the unknown byte will be useful, but I suppose it can't hurt.

Do you have a stacktrace or minimal reproducer?

I am afraid not and I don't have more detailed info. Every time I run buildHealth, console outputs an exception with Unknown constant pool type. I cannot locate where and how this exception throws from my codebase. It blocks me to use this plugin in my project.

@autonomousapps
Copy link
Owner

Hm some logging that indicates the file this trips over might help. I'll add that. Or if you're comfortable debugging, you could do that right now; there are instructions in the wiki.

@autonomousapps
Copy link
Owner

Ok, latest commit adds additional logging so we can see the exact class file this trips over.

@249106156
Copy link
Author

Ok, latest commit adds additional logging so we can see the exact class file this trips over.

Thank you very much. But the latest release version v1.31.0 does not include this enhancement. I will test it once it it available, thanks.

@autonomousapps
Copy link
Owner

@249106156 you could also test a snapshot. Not sure when the next release will be, but if you test a snapshot and provide more information on the issue, I might be able to resolve it for that next release 👍

@249106156
Copy link
Author

@autonomousapps, I tested the snapshot and tried to fix errors by commenting out source code. But I don't understand why errors throw in my source code, even though they are just normal value assignments. I think we need to figure out the root cause instead of commenting out code.
Any clue why it is happening?

@autonomousapps
Copy link
Owner

Can you share the code you commented out?

I see that you're using Kotlin 1.9.0. Can you try Kotlin 1.9.22 or .23?

@9tilov
Copy link

9tilov commented May 19, 2024

I have the same issue. I updated Kotlin version to 1.9.22 but it didn't help.

Caused by: java.lang.RuntimeException: Unknown constant pool type: byte '17' at pos '79'
	at com.autonomousapps.internal.ConstantPoolParser.parseConstantPoolClassReferences(ConstantPoolParser.kt:83)
	at com.autonomousapps.internal.ConstantPoolParser.getConstantPoolClassReferences$dependency_analysis_gradle_plugin(ConstantPoolParser.kt:45)
	at com.autonomousapps.internal.BytecodeReader.parse(BytecodeParsers.kt:66)
	at com.autonomousapps.internal.ClassFilesParser.parseBytecode(BytecodeParsers.kt:39)
	at com.autonomousapps.internal.ClassReferenceParser.analyze$dependency_analysis_gradle_plugin(BytecodeParsers.kt:24)
	at com.autonomousapps.tasks.ClassListExploderTask$ClassListExploderWorkAction.execute(ClassListExploderTask.kt:63)
	at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
	at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
	at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
	at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
	at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:170)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)
	at org.gradle.internal.Factories$1.create(Factories.java:31)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249)
	at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109)
	at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:114)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request more information needed
Projects
None yet
Development

No branches or pull requests

3 participants