Kotlin / Kotlin/multiplatform-library-template
Android test crashes with space characters in 'test 3rd element' - spaces are not allowed in DEX
- Dominant language
- Kotlin
- Stars
- 340
- Forks
- 61
- PR merge metrics
- No merged PRs in 30d
Description
Hi
When starting tests in Android `KMP library template` crashes.
To reproduce call:
`gradlew :library:assembleAndroidDeviceTest`
Build crashes with error: `D8: com.android.tools.r8.internal.ax: Space characters in SimpleName 'test 3rd element' are not allowed prior to DEX version 040`
```
C:\..\multiplatform-library-template-main\library\build\classes\kotlin\android\deviceTest\io\github\kotlin\fibonacci\FibiTest.class: D8: com.android.tools.r8.internal.ax: Space characters in SimpleName 'test 3rd element' are not allowed prior to DEX version 040
org.gradle.workers.WorkerExecutionException: There was a failure while executing work items
at org.gradle.workers.internal.DefaultWorkerExecutor.workerExecutionException(DefaultWorkerExecutor.java:223)
at org.gradle.workers.internal.DefaultWorkerExecutor.await(DefaultWorkerExecutor.java:205)
...
```
I'm wondering how to workaround it.
Seems the simplest solution is to avoid spaces in sources: `commonTest, androidMain + Test.`
And wait for a moment when DEX will allow 'spaces in names'
Do you have other ideas?
Cheers
GT
Contributor guide
No contributing guide indexed for this repository
Research direction
Run `gradlew :library:assembleAndroidDeviceTest` and inspect the Android device-test sources that produce `io\github\kotlin\fibonacci\FibiTest.class`, especially the test named `test 3rd element`. Confirm which source name contains spaces, then make the Android device-test build complete without the D8 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100