Since the kotlin.reflect package is only made available in debug and dex, the import statement will cause build error when creating release apk. And unfortunately, It seems that Kotlin does not have any language feature that is similar to conditional symbol (C#) or conditional preprocessor (C/C++), the only possible is using static code analysis (or anything it is called) which is done after checking imports, Therefore conditionally disabling the import statement is impossible.
So I removed the reflection-based debugging code and library dependency and make the debugged class visibility to internal instead, as it is still inside the vshlauncher module.
Since the
kotlin.reflect
package is only made available indebug
anddex
, the import statement will cause build error when creatingrelease
apk. And unfortunately, It seems that Kotlin does not have any language feature that is similar to conditional symbol (C#) or conditional preprocessor (C/C++), the only possible is using static code analysis (or anything it is called) which is done after checking imports, Therefore conditionally disabling the import statement is impossible.So I removed the reflection-based debugging code and library dependency and make the debugged class visibility to
internal
instead, as it is still inside the vshlauncher module.