openai-java
openai-java copied to clipboard
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Duration Getting this issue in Android 7
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Duration;
at com.theokanning.openai.service.OpenAiService.
I am getting this error in android 7 as Duration class is above the API level of android 7. Is there any workaround for this?
Can you use the other constructor? Create an ExecutorService with the timeout you want which is a long, not a Duration and then pass the executor service to the constructor.
public OpenAiService(final OpenAiApi api, final ExecutorService executorService) {
https://developer.android.com/reference/java/util/concurrent/ExecutorService