-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
kotlin 1.8 Modifiers [PRIVATE] are not allowed on Kotlin parameters. Allowed modifiers: [VARARG, NOINLINE, CROSSINLINE] #779
Comments
if google dagger2 version is 2.4.5 |
I'm receiving this error as well seems to be the same issue as #775 |
I too have the same problem. Caused by: java.lang.IllegalArgumentException: Modifiers [PRIVATE] are not allowed on Kotlin parameters. Allowed modifiers: [VARARG, NOINLINE, CROSSINLINE] |
I believe I used this workaround |
Reason for the change: Based on the issue: permissions-dispatcher#779 Bug reason: When upgrading Kotlin or base library versions, some libraries that use KotlinPoet may also be upgraded to version 1.11 or higher. KotlinPoet 1.11.0 has the following release note: • Fix: Enforce only allowed parameter modifiers in ParameterSpec (i.e. crossinline, vararg, and noinline). For more details, please refer to: https://github.com/square/kotlinpoet/releases When generating the PermissionRequest class for methods annotated with @NeedsPermission, the private constructor will cause an error. Reproduction steps: Upgrade KotlinPoet to 1.11.0 Add a new parameter "callback" to the MainActivity#showCamera method in the sample Modification: Do not pass the KModifier.*PRIVATE parameter
I find reason for this issus,and i create a pr for this: #782 |
version:4.9.2
Caused by: java.lang.IllegalArgumentException: Modifiers [PRIVATE] are not allowed on Kotlin parameters. Allowed modifiers: [VARARG, NOINLINE, CROSSINLINE]
at com.squareup.kotlinpoet.ParameterSpec.(ParameterSpec.kt:41)
at com.squareup.kotlinpoet.ParameterSpec.(ParameterSpec.kt:29)
at com.squareup.kotlinpoet.ParameterSpec$Builder.build(ParameterSpec.kt:157)
at com.squareup.kotlinpoet.FunSpec$Builder.addParameter(FunSpec.kt:465)
at permissions.dispatcher.processor.impl.kotlin.KotlinBaseProcessorUnit.createPermissionRequestClass(KotlinBaseProcessorUnit.kt:452)
at permissions.dispatcher.processor.impl.kotlin.KotlinBaseProcessorUnit.createPermissionRequestClasses(KotlinBaseProcessorUnit.kt:415)
at permissions.dispatcher.processor.impl.kotlin.KotlinBaseProcessorUnit.createFile(KotlinBaseProcessorUnit.kt:43)
at permissions.dispatcher.processor.impl.kotlin.KotlinBaseProcessorUnit.createFile(KotlinBaseProcessorUnit.kt:17)
at permissions.dispatcher.processor.PermissionsProcessor.processKotlin(PermissionsProcessor.kt:68)
at permissions.dispatcher.processor.PermissionsProcessor.process(PermissionsProcessor.kt:58)
at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt:90)
at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:197)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:980)
... 44 more
The text was updated successfully, but these errors were encountered: