react-native-safe-area-context: Compile Error with v4


> Task :react-native-safe-area-context:compileDebugJavaWithJavac FAILED
/myapp/node_modules/react-native-safe-area-context/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaProviderManager.java:62: error: cannot find symbol
              UIManagerHelper.getSurfaceId(reactContext), reactTag, insets, frame));
                             ^
  symbol:   method getSurfaceId(ReactContext)
  location: class UIManagerHelper
/myapp/node_modules/react-native-safe-area-context/android/src/main/java/com/th3rdwave/safeareacontext/InsetsChangeEvent.java:15: error: no suitable constructor found for Event(int,int)
    super(surfaceId, viewTag);
    ^
    constructor Event.Event() is not applicable
      (actual and formal argument lists differ in length)
    constructor Event.Event(int) is not applicable
      (actual and formal argument lists differ in length)
Note: /myapp/node_modules/react-native-safe-area-context/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaUtils.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /myapp/node_modules/react-native-safe-area-context/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaContextPackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

React Native Version: 0.64.3

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 29

Commits related to this issue

Most upvoted comments

just set compilesdk version from 29; to => compileSdkVersion = 30 in android/build.gradle

I downgraded my react-native-safe-area-context to 3.3.2 and react-native-screens to 3.10.1 and it worked . Help me in resolving this error https://github.com/facebook/react-native/issues/33194

🎉 🎉 🎉 If you are using Yarn, try to:

yarn remove react-native-safe-area-context
yarn start --reset-cache
yarn add react-native-safe-area-context

Do the same with other package managers

just set compilesdk version from 29; to => compileSdkVersion = 30 in android/build.gradle

thank you ! it solved my problem with error: react-native-safe-area-context:compileDebugKotlin

@Developeranees Cheers! That solved my issue 😃

@janicduplessis I can confirm that the issue has been fixed with 4.1.0. Works fine with react-native-screens 3.13.0 as well.

@jwisbeck you need to install 4.1.0, not 4.0.1

@Developeranees thanks that solved my problem. The project was done in expo before but started throwing error: react-native-safe-area-context:compileDebugKotlin after i moved to react cli. thanks for your solution

just set compilesdk version from 29; to => compileSdkVersion = 30 in android/build.gradle

Thanks a Ton!! this worked for me with this error: react-native-safe-area-context:compileDebugKotlin