We have a Xamarin Forms Application updated to 5.0 all the builds are successful including the Android binding libraries. Switched from Proguard to r8 due to multiple errors occurring on release build.
The main issue we have is on release mode where some features on Here SDK for Android (Premium Edition) versions 3.16 to 3.20 are no longer working like SearchRequest and TextAutoSuggestionRequest. Both of these are working if Code shrinker is set to blank or running in Debug. When in Release and r8 SearchRequest doesn't return any result. While TextAutoSuggestionRequest would crash the application with the following error:
W System.err: java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to com.nokia.maps.AutoSuggestImpl
W System.err: at com.nokia.maps.PlacesTextAutoSuggestionResult.a(Unknown Source:34)
W System.err: at com.nokia.maps.PlacesBaseRequest.c(Unknown Source:253)
W System.err: at com.nokia.maps.PlacesBaseRequest.onResult(Unknown Source:57)
W System.err: at com.nokia.maps.PlacesBaseRequest.poll(Native Method)
W System.err: at com.nokia.maps.PlacesBaseRequest.d(Unknown Source:0)
W System.err: at com.nokia.maps.PlacesBaseRequest$h.a(Unknown Source:33)
W System.err: at com.nokia.maps.PlacesBaseRequest$h.doInBackground(Unknown Source:2)
W System.err: at android.os.AsyncTask$2.call(AsyncTask.java:333)
W System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
W System.err: at java.lang.Thread.run(Thread.java:764)
W System.err: java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to com.nokia.maps.AutoSuggestImpl
W System.err: at com.nokia.maps.PlacesTextAutoSuggestionResult.a(Unknown Source:34)
W System.err: at com.nokia.maps.PlacesBaseRequest.c(Unknown Source:253)
W System.err: at com.nokia.maps.PlacesBaseRequest.onResult(Unknown Source:57)
W System.err: at com.nokia.maps.PlacesBaseRequest.poll(Native Method)
W System.err: at com.nokia.maps.PlacesBaseRequest.d(Unknown Source:0)
W System.err: at com.nokia.maps.PlacesBaseRequest$h.a(Unknown Source:33)
W System.err: at com.nokia.maps.PlacesBaseRequest$h.doInBackground(Unknown Source:2)
W System.err: at android.os.AsyncTask$2.call(AsyncTask.java:333)
W System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
W System.err: at java.lang.Thread.run(Thread.java:764)
I used the same config file from Proguard settings and adding more -keep class lines almost adding all the package names
Also tried the following but not working:
- disable Multidex
- AOT Compilation + Use LVVM
- tried VS 2022 Enterprise from VS 2019
Is there anything I missed to make r8 build be deployed with out issue?
Thank you,