Hello, I am an Android developer, I really like the arrow library, and I have used the arrow library for a long time in the project.
But I encountered a problem when upgrading to 0.10.0 version:
The app crashed at startup:
java.lang.NoClassDefFoundError: arrow.fx.internal.Platform$_trampoline$1
at arrow.fx.internal.Platform.<clinit>(Utils.kt:204)
at arrow.fx.IO$Async.unsafeRunTimedTotal$arrow_fx(IO.kt:1017)
at arrow.fx.IO.unsafeRunTimed(IO.kt:862)
at arrow.fx.IO.unsafeRunSync(IO.kt:851)
I found this because the internal Util of arrow-fx uses the java8 API withInitial:
@PublishedApi
internal val _trampoline = ThreadLocal.withInitial {
TrampolineExecutor(underlying)
}
/**
* Creates a thread local variable. The initial value of the variable is
* determined by invoking the {@code get} method on the {@code Supplier}.
*
* @param <S> the type of the thread local's value
* @param supplier the supplier to be used to determine the initial value
* @return a new thread local variable
* @throws NullPointerException if the specified supplier is null
* @since 1.8
*/
public static <S> ThreadLocal<S> withInitial(Supplier<? extends S> supplier) {
return new SuppliedThreadLocal<>(supplier);
}
Hello, I am an Android developer, I really like the arrow library, and I have used the arrow library for a long time in the project. But I encountered a problem when upgrading to 0.10.0 version: The app crashed at startup:
I found this because the internal Util of arrow-fx uses the java8 API
withInitial
:In Android, just can use this API since SDK26 (Android8.0). Https://developer.android.com/studio/write/java8-support
This problem caused me can not to use the latest version of the arrow in the project right now.