Description:
Every time I run pnpm android, the build fails with multiple Kotlin compilation errors in MainApplication.kt.
However, if I delete the android and ios directories, run pnpm prebuild, and then pnpm android, the build succeeds temporarily.
I’m also unable to build the app using Expo in this broken state.
Steps Taken:
Run pnpm android without deleting android and ios directories.
Build fails with compilation errors.
Expected Behavior:
The Android app should build successfully without having to delete and regenerate the native project files.
Actual Behavior:
The build fails with errors such as:
Overload resolution ambiguity between candidates...
Conflicting declarations...
Unresolved reference 'not'...
Unresolved reference 'add'...
Environment:
Expo SDK: 53.0.12
Node: 20.14.2
pnpm: 10.12.3
Kotlin: 2.0.21
Gradle: 8.13
Android Gradle Plugin: 8.8.2
Platform: macOS
Additional Context:
This happens consistently after making changes to the native code or running pnpm android multiple times without regenerating the native project.
The issue seems related to conflicting declarations and duplicated lifecycle callback definitions in MainApplication.kt after the prebuild step.