th3rdwave / react-native-safe-area-context

A flexible way to handle safe area insets in JS. Also works on Android and Web!
MIT License
2.14k stars 197 forks source link

[Android] Task :react-native-safe-area-context:compileReleaseKotlin FAILED #481

Closed bulkinav closed 6 months ago

bulkinav commented 6 months ago

"react-native": "0.73.6" "react-native-safe-area-context": "4.9.0"

IS_NEW_ARCHITECTURE_ENABLED = TRUE bridgelessEnabled = FALSE

Android Studio 2023.2.1

buildToolsVersion = "34.0.0" minSdkVersion = 23 // Android 6.0 and above compileSdkVersion = 34 // Android 14 (gives access to new APIs) targetSdkVersion = 33 // Android 13 ndkVersion = "25.1.8937393" kotlinVersion = "1.8.22"


Hello,

When I'm trying to build the my project (release or begug - it does not matter) with IS_NEW_ARCHITECTURE_ENABLED = TRUE, the following error occurs:

> Task :react-native-safe-area-context:compileReleaseKotlin FAILED
e: file:/app-react/node_modules/react-native-safe-area-context/android/src/fabric/java/com/th3rdwave/safeareacontext/InsetsChangeEvent.kt:7:16 Redeclaration: InsetsChangeEvent
e: file:/app-react/node_modules/react-native-safe-area-context/android/src/fabric/java/com/th3rdwave/safeareacontext/UIManagerHelperCompat.kt:8:1 Conflicting overloads: public fun getReactContext(view: View): ReactContext defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt, public fun getReactContext(view: View): ReactContext defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt
e: file:/app-react/node_modules/react-native-safe-area-context/android/src/fabric/java/com/th3rdwave/safeareacontext/UIManagerHelperCompat.kt:12:1 Conflicting overloads: public fun getSurfaceId(context: Context): Int defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt, public fun getSurfaceId(context: Context): Int defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt
e: file:/app-react/node_modules/react-native-safe-area-context/android/src/paper/java/com/th3rdwave/safeareacontext/InsetsChangeEvent.kt:9:16 Redeclaration: InsetsChangeEvent
e: file:/app-react/node_modules/react-native-safe-area-context/android/src/paper/java/com/th3rdwave/safeareacontext/UIManagerHelperCompat.kt:9:1 Conflicting overloads: public fun getReactContext(view: View): ReactContext defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt, public fun getReactContext(view: View): ReactContext defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt
e: file:/app-react/node_modules/react-native-safe-area-context/android/src/paper/java/com/th3rdwave/safeareacontext/UIManagerHelperCompat.kt:18:1 Conflicting overloads: public fun getSurfaceId(context: Context): Int defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt, public fun getSurfaceId(context: Context): Int defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt
404-html commented 6 months ago

I am experiencing the same on RN 0.74.0-rc.3

newArchEnabled=false
hermesEnabled=true
jacobp100 commented 6 months ago

The main issue is for the new arch. We’ll happily take fixes for issues you find, but because the new arch is still considered alpha/beta, support is patchy

For the second issue, I think someone has done fixes for the RC versions, but you’re best to wait until it’s fully shipped

If you find a root cause or a minimal repro, please do open a new issue or PR. I’ll close this because it won’t get actioned, and just keep the active issues a bit cleaner