Skip to content

bugfix: space characters are not allowed prior to DEX version 040#63

Open
gt4dev wants to merge 1 commit intoKotlin:mainfrom
gt4dev:main
Open

bugfix: space characters are not allowed prior to DEX version 040#63
gt4dev wants to merge 1 commit intoKotlin:mainfrom
gt4dev:main

Conversation

@gt4dev
Copy link

@gt4dev gt4dev commented Feb 3, 2026

On command gradlew :library:assembleAndroidTest build crashes with error:

ERROR: C:\projects\kmp-templates\multiplatform-library-template\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)
        at com.android.build.gradle.internal.tasks.DexArchiveBuilderTaskDelegate.doProcess(DexArchiveBuilderTaskDelegate.kt:215)
        at com.android.build.gradle.internal.tasks.DexArchiveBuilderTask.doTaskAction(DexArchiveBuilderTask.kt:225)
        at com.android.build.gradle.internal.tasks.NewIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(BaseTask.kt:82)
        at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:51)
...

Error is caused by spaces in fun 'test 3rd element' in commonTest.
I renamed it to fun test_3rd_element

Interesting that this function in folder androidTest had been already changed.
I renamed this function to fun test_3rd_element to keep consistent naming in both places androidTest, commonTest.

BTW1. Another solution for this problem would be to boost android-minSdk to API 30 from current 24.
But IMO it's weak solution as about 10% of Android devices still use API < 30.


Related issue #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant