Cannot use Kotlin backticked method names in androidTest - bad descriptor exception
As @nhaarman mentioned, Android does not support backticked function names. From the Kotlin Coding Conventions:
In tests (and only in tests), it's acceptable to use method names with spaces enclosed in backticks. (Note that such method names are currently not supported by the Android runtime.) Underscores in method names are also allowed in test code.
class MyTestCase { @Test fun `ensure everything works`() { ... } @Test fun ensureEverythingWorks_onAndroid() { ... } }
Support for spaces in function names has been added and is now available in API 30.
To use it, set buildToolsVersion
, compileSdkVersion
and targetSdkVersion
to 30+ and run your tests on an Android 30+ device. If you want to use this in anything else than tests, you'll have to set minSdkVersion
to 30+ as well.