Generated Android APK ignoring changes


In our Expo Android project we replaced the following code in with our custom OkHttpClient

   public static OkHttpClient.Builder okHttpClientBuilder(OkHttpClient.Builder builder) {
     // Customize/override OkHttp client here
     return builder;

When tested on a simulator our changes are working. However, when we generate the production APK, our changes are no longer working. Is there a process to properly compile/build our project for production?


Any help here? I have tried all available approaches but I am missing something fundamental. My customized code works in debug. But when I run the app in release mode it is completely ignored. How is MainApplication.Java processed?

Any example on how to do the override of the client?