Issue
In my unit tests I use Kotlin's backticked methods for better readability, e.g.
@Test fun `Foo should return bar`()
It works nice and well for tests in <module>/src/test
directory, but when I try to do the same in <module>/src/androidTest
I get an exception:
Error:java.lang.IllegalArgumentException: bad descriptor: Lcom/packageName/MainActivityTest$Foo should return bar$1;
Error:Execution failed for task ':sample:transformClassesWithDexBuilderForDebugAndroidTest'. > com.android.build.api.transform.TransformException: org.gradle.tooling.BuildException: com.android.dx.cf.iface.ParseException: bad descriptor: Lcom/packageName/MainActivityTest$Foo should return bar$1;
Is there some trick to make it work?
Solution
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.
Answered By - Cristan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.