Gareth
Gareth

Reputation: 21

Upgrade sdk version from 33 to 35 for android in react native project

When trying to upgrade the android sdk version from 33 to 35 within a react native project. The project fails to build. Here is the Error:

node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (114, 12): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.

I follow these 4 steps and encounter the error:

  1. Build.gradle (Android) I have changed the values to: compileSdkVersion = 35 targetSdkVersion = 35

  2. Build.gradle (Android) I have upgraded gradle like so: classpath("com.android.tools.build:gradle:8.1.1")

3.gradle-wrapper.properties I have upgraded gradle to 8.0 like so: distributionUrl=https://services.gradle.org/distributions/gradle-8.0-all.zip

  1. In the package.json here are the versions of react: "react": "18.1.0", "react-native": "0.70.2"

When I try to upgrade react native this also fails and I believe this is because I have added other dependencies like firestore which stop a successful upgrade however I can't remove these dependecies for the the upgrade as they are needed very much.

How can I upgrade from sdk 33 to 35 for android in a react native project given the information above???

Upvotes: 1

Views: 642

Answers (0)

Related Questions