FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-google-mobile-ads:compileReleaseKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
I got the above error while building the expo app on the eas server. Had tried to resolve it by changing those kotlin version in the app.json through the expo-build-properties plugin.
Endup in my local environment, I managed to build the app into the emulator but when trying to build one in the EAS server for submission it failed and showing the error mentioned above.
I had referred some issues on github as well https://github.com/invertase/react-native-google-mobile-ads/issues/480
but seems like not much helping. Seeking for some help from the community.
These are my package versions:
"react-native-google-mobile-ads": "^14.8.0",
"expo": "^51.0.35",
"kotlinVersion": "1.9.10"
Gradle 8.8, Java 22 (gradle and java is auto used by the EAS Server)
End of the day, I managed to solve it by just remove the symbol ^ away from the package version.
"react-native-google-mobile-ads": "^14.8.0",
"react-native-google-mobile-ads": "14.8.0",
So when I build in the EAS server, the server will get this version of the google mobile Ads instead of the the latest version.