I am trying to create an APK from react native expo application but upon doing the command to generate the apk (eas build), I run into the following error :
[stderr]
FAILURE: Build failed with an exception.
[stderr]
- What went wrong:
[stderr]
Execution failed for task ':expo-splash-screen:compileReleaseKotlin'.
[stderr]
A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[stderr]
Compilation error. See log for more details
[stderr]
- Try:
[stderr]
Run with --stacktrace option to get the stack trace.
[stderr]
Run with --info or --debug option to get more log output.
[stderr]
Run with --scan to get full insights.
[stderr]
- Get more help at https://help.gradle.org
[stderr]
BUILD FAILED in 6m 32s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
I thought the error could be from splash in the app.json file but I can't see what's wrong in it.
{
"expo": {
"name": "Talky",
"slug": "talky",
"scheme": "com.bertdelaspeed.talky",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/Talky_logo.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/Talky_splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
}
}
}
The solution I figured out is to first do:
1. npx expo prebuild
That should generate an android directory then you can do
2. CTRL + SHIFT + F (in Vs code or Search) and search 'expo-splash-screen'
You should find it in 3 places: package.json, package-lock.json and node_modules
3. Delete it from all of those places and run your build command again