Open JajaComp opened 5 years ago
As a workaround, you could simply rewrite DefaultHeaders feature to avoid using java.time package.
However, I would expect it to not work anyway since Netty may require a lot of API that doesn't fit.
I experienced a similar problem
uiAutomatorHelper(com.dtmilano.android.culebratester2.UiAutomatorHelper)
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Duration;
at com.typesafe.config.impl.ConfigImpl.fromAnyRef(ConfigImpl.java:243)
at com.typesafe.config.impl.ConfigImpl.fromPathMap(ConfigImpl.java:200)
at com.typesafe.config.ConfigFactory.parseMap(ConfigFactory.java:1038)
at io.ktor.server.engine.CommandLineKt.commandLineEnvironment(CommandLine.kt:32)
at io.ktor.server.cio.EngineMain.main(EngineMain.kt:20)
...
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.time.Duration" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.dtmilano.android.culebratester2.test-2/base.apk", zip file "/data/app/com.dtmilano.android.culebratester2-2/base.apk", zip file "/system/priv-app/MetricsApi/MetricsApi.apk", zip file "/system/priv-app/com.amazon.dp.logger/com.amazon.dp.logger.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 37 more
...
on Android API < 26, even though KtorApplication.kt does not include
...
install(DefaultHeaders)
...
Other than that, it works perfectly well on Android API >= 26.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Ktor Version and Engine Used (client or server and name) io.ktor:ktor-server-netty:1.2.5
Describe the bug Ktor not work on Android API =< 25
To Reproduce When i try to create server i get error:
ZoneId was added in android just in API 26