Android - do I need to configure for production/release versions?

Using Algolia in an android/ios app, have been testing in the developer/debug version thus far, and found that in the release version on Android that I may be able to connect the client but I’m unable to observe any results. I’m confused since I’ve tested the same API key between android and ios with success, but the android release version doesn’t seem to connect/invoke the search at all.

Have searched through the docs but not much found. I have even tested this by hardcoding the API key/App id into the code (not a final implementation - just trying to narrow down the cause). Any thoughts on where I can look to fix this? Not sure what code samples might be needed for this question but if you feel something might be useful, let me know and I’ll post it

Hi there! Sorry to hear about this issue you are facing. To confirm, even when you hardcode the keys into the Android app, you are not able to get any search response?

Could you please share a code snippet for how you are trying to make a search and any error messages you are receiving?

Hello, thanks for the response! - I’ll admit I’ve actually found the solution and it wasn’t with the algolia code but rather with my release configuration in android. Forgot about Proguard, and it was attempting to shrink the imported algolia libraries since they weren’t all directly used. So my mistake!

Had to add the following lines to my proguard-rules.pro file:

-dontshrink
-dontoptimize
-dontpreverify
-verbose

-keep public class com.algolia.search.saas.** { *; }
-keep public class com.algolia.search.** { *; }
-keep public class com.algolia.instantsearch.helper.** { *; }
-keep public class com.algolia.instantsearch.core.** { *; }
1 Like

Glad to hear you figured it out. Thanks for sharing what the issue was!