Tudor
Tudor

Reputation: 1

Why am I getting a "Starting in Kotlin 2.0, the Compose Compiler Gradle plugin is required..." error when trying to compile an Expo App?

So after running ➤ npx expo run:android

I got this weird error:

env: load .env.local
env: export SENTRY_AUTH_TOKEN
› Building app...
Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* Where:
Build file '/code/myapp/android/build.gradle' line: 27

* What went wrong:
A problem occurred evaluating root project 'MyApp'.
> Failed to apply plugin 'com.facebook.react.rootproject'.
   > A problem occurred configuring project ':app'.
      > Starting in Kotlin 2.0, the Compose Compiler Gradle plugin is required
        when compose is enabled. See the following link for more information:
        https://d.android.com/r/studio-ui/compose-compiler

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 4s
10 actionable tasks: 10 up-to-date
Error: /code/myapp/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=x86_64,arm64-v8a exited with non-zero code: 1
Error: /code/myapp/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=x86_64,arm64-v8a exited with non-zero code: 1
    at ChildProcess.completionListener (/code/myapp/node_modules/@expo/spawn-async/src/spawnAsync.ts:67:13)
    at Object.onceWrapper (node:events:634:26)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1104:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
    ...
    at spawnAsync (/code/myapp/node_modules/@expo/spawn-async/src/spawnAsync.ts:28:21)
    at spawnGradleAsync (/code/myapp/node_modules/@expo/cli/src/start/platforms/android/gradle.ts:134:28)
    at assembleAsync (/code/myapp/node_modules/@expo/cli/src/start/platforms/android/gradle.ts:83:16)
    at runAndroidAsync (/code/myapp/node_modules/@expo/cli/src/run/android/runAndroidAsync.ts:48:24)

I thought it would compile properly. Tried updating the packages to their latest versions with --legacy-peer-deps, that didn't do much unfortunately. Is there any way I could fix this error?

Upvotes: 0

Views: 29

Answers (0)

Related Questions