Not able to get geocoder results after suggestions in Kotlin 200.1.0

464
4
07-25-2023 03:15 AM
sahilkr8138
New Contributor II

I am trying to fetch address using Geocode Suggestion API and Geocode result API
When I normally load results from

locatorTask.geocode(query, geocodeParams)

 then it returns the results but when I try

locatorTask.suggest(query)

and after click on one of the suggestion result

locatorTask.geocode(suggestion, geocodeParams)

then app get crashed every time with crash


FATAL EXCEPTION: OkHttp Dispatcher
java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Util;
at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.kt:81)
at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.kt:59)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:74)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:64)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at com.arcgismaps.http.internal.ntlm.NtlmInterceptor.intercept(NtlmInterceptor.kt:53)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:533)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.internal.Util" on path: DexPathList
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.kt:81) 
at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.kt:59) 
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:74) 
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) 
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:64) 
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) 
at com.arcgismaps.http.internal.ntlm.NtlmInterceptor.intercept(NtlmInterceptor.kt:53) 
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) 
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205) 
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:533) 


0 Kudos
4 Replies
Erick_1
Esri Contributor

Hello @sahilkr8138 

Are you using OkHttp in your app ? If so, what version are you using?

0 Kudos
sahilkr8138
New Contributor II

yes @Erick_1 .OkHttp version used: com.squareup.okhttp3:okhttp:4.10.0

0 Kudos
Erick_1
Esri Contributor

Can you provide some isolated test code to reproduce this bug?

 

0 Kudos
sahilkr8138
New Contributor II

@Erick_1  we cant share the exact code in which we are facing this, but I assure that I used the same code which is provided in the sample github repositories for map implementation.

I created some samples , all sample are working fine if implemented alone, but when we implemented in our live code then its crashing. Always shows the above error when we first search for suggestions first and then search for location using that suggestion.

Alone search for location with dummy location address is working fine but if we serch for suggestion first then its crashing on geocode API.

Also we used the 100.1 versoion of map version, then its working fine. It only occurs when we change the version to 200.1.

0 Kudos