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

TypeNotPresentException: Type org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension in Kotlin jvm library #432

Closed
eugene-krivobokov opened this issue Jun 25, 2021 · 2 comments

Comments

@eugene-krivobokov
Copy link
Contributor

Build scan link

https://scans.gradle.com/s/gde5zkyzhipge/failure#1

Plugin version

0.74.0

Gradle version

6.9

(Optional) Android Gradle Plugin (AGP) version

no AGP

Describe the bug

Can't apply the plugin in simple project with Kotlin jvm module:

java.lang.TypeNotPresentException: Type org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension not present	
at org.gradle.api.reflect.TypeOf.captureTypeArgument(TypeOf.java:291)	
at org.gradle.api.reflect.TypeOf.<init>(TypeOf.java:97)	
at com.autonomousapps.DependencyAnalysisPlugin$configureKotlinJvmProject$1$$special$$inlined$the$1.<init>(TypeOfExtensions.kt:28)	
at com.autonomousapps.DependencyAnalysisPlugin$configureKotlinJvmProject$1.execute(DependencyAnalysisPlugin.kt:1076)	
at com.autonomousapps.DependencyAnalysisPlugin$configureKotlinJvmProject$1.execute(DependencyAnalysisPlugin.kt:58)

To Reproduce
Steps to reproduce the behavior:

  1. Checkout https://github.com/eugene-krivobokov/dependency-analysis-KotlinProjectExtension-issue
  2. ./gradlew :library:projectHealth

Expected behavior

Task executes without error or plugin explains what is wrong with the project.

Additional context

@autonomousapps
Copy link
Owner

This is actually expected. Fortunately, the solution is very simple. I have just added a FAQ that includes this question (because I get it regularly). Let me know if you have any questions after consulting it. I'm closing this issue for now.

@autonomousapps
Copy link
Owner

Hm, I suppose I should add: if you want to try to add something to the plugin to catch and explain this error to users, I'm open to such a PR.

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

No branches or pull requests

2 participants