From 852db621925d675cbb632ed98bf191f827a3f6a9 Mon Sep 17 00:00:00 2001 From: Ivan Ignatiev Date: Mon, 23 Oct 2023 12:07:16 +0200 Subject: [PATCH] fix: unresolved reference: attr after upgrading to 0.73.0-rc.2 (#1919) ## Description Small PR which probably resolves [#1515](https://github.com/software-mansion/react-native-screens/issues/1515). For my case, I got this build issue after upgrading from 0.72.5 to 0.73.0-rc.2: ``` > Task :react-native-screens:compileDebugKotlin FAILED e: file:///Users/ivanignatiev/GitHub/****/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt:391:46 Unresolved reference: attr ``` I do not know Java or Kotlin, so, please guide me if additional work is needed. @kkafar: Since AGP 8.0 the default value for `android.nonTransitiveRClass` property [has changed from `false` to `true`](https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes). This requires resource file names to be fully qualified. React Native 0.73 depends on AGP 8.0 thus we get the build issues. --- .../java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt b/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt index c0c9726e8d..a031f2f7c4 100644 --- a/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +++ b/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt @@ -390,7 +390,7 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) { // set primary color as background by default val tv = TypedValue() - if (context.theme.resolveAttribute(R.attr.colorPrimary, tv, true)) { + if (context.theme.resolveAttribute(android.R.attr.colorPrimary, tv, true)) { toolbar.setBackgroundColor(tv.data) } toolbar.clipChildren = false