I use expo sdk 52 and react-native-crisp-chat-sdk 0.20.0.
The expo prebuild command creates my MainApplication file in kotlin (MainApplication.kt).
The crisp expo config plugin assumes it to be written in java though, which is why the matchers and the replacing don't work.
There are 2 issues in my oppinion:
- The plugin needs to support kotlin
- The plugin fails silently which makes future failures not so obvious, even though they are likely when dealing with string manipulation in expo config plugins. It would be nice as a pattern if the plugin checks if adding a line, e.g. a import was successful and throw if not, to make such errors more obvious.
In the expo code it looks like the plugin functions even provide the language as a variable, which can be used to build case distinctions:
https://github.com/expo/expo/blob/6a25dace4f3d77a5412949c57a8e68882762b2b1/packages/install-expo-modules/src/plugins/android/withAndroidModulesMainApplication.ts#L11-L21