2

While integrating React Native into an existing Android project, we get the following error when we try to sync the project:

A problem occurred evaluating project ':react-native-restart'. Unsupported value: 28. Format must be one of:

  • android-31
  • android-31-ext2
  • android-T
  • vendorName:addonName:31

The error is thrown by node_modules/react-native-restart/android/build.gradle, on this line:

compileSdkVersion safeExtGet('compileSdkVersion')

In the Android project build.gradle we have:

compileSdkVersion 31
minSdkVersion 26
targetSdkVersion 31

Any idea?

1 Answer 1

2

Because it is defined in a package level here https://github.com/avishayil/react-native-restart/blob/master/android/gradle.properties

compileSdkVersion=28
minSdkVersion=16
targetSdkVersion=28

You can change it in your node_modules and save changes using patch-package

https://github.com/ds300/patch-package

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.