Recently we updated our project to use Kotlin 1.6.10 from 1.4.x in order to support some other changes. After this change was made, Kotlin files using the PermissionsDispatcher annotations throw IllegalArgumentExceptions when trying to compile:
Caused by: java.lang.IllegalArgumentException: Can't escape identifier arrayOf("android.permission.READ_EXTERNAL_STORAGE") because it contains illegal characters: .
This is for the following annotations:
@NeedsPermission(Manifest.permission.READ_EXTERNAL_STORAGE)@OnShowRationale(Manifest.permission.READ_EXTERNAL_STORAGE)@OnPermissionDenied(Manifest.permission.READ_EXTERNAL_STORAGE)
The same exact annotations compile fine across Java files where we use them. I'm positive it's these annotations, since commenting out any of the PermissionsDispatcher code references in this one class will allow the app to compile (although not function for this case).
Expected
Kotlin files using PermissionsDispatcher will compile.
Actual
An IllegalArgumentException is thrown for the PermissionsDispatcher annotations in Kotlin files.
Overview
Recently we updated our project to use Kotlin 1.6.10 from 1.4.x in order to support some other changes. After this change was made, Kotlin files using the PermissionsDispatcher annotations throw IllegalArgumentExceptions when trying to compile:
This is for the following annotations:
@NeedsPermission(Manifest.permission.READ_EXTERNAL_STORAGE)
@OnShowRationale(Manifest.permission.READ_EXTERNAL_STORAGE)
@OnPermissionDenied(Manifest.permission.READ_EXTERNAL_STORAGE)
The same exact annotations compile fine across Java files where we use them. I'm positive it's these annotations, since commenting out any of the PermissionsDispatcher code references in this one class will allow the app to compile (although not function for this case).
Expected
Kotlin files using PermissionsDispatcher will compile.
Actual
An IllegalArgumentException is thrown for the PermissionsDispatcher annotations in Kotlin files.
Environment
- Which library version are you using?
- On which devices do you observe the issue? All, physical and emulators.