Skip to content

Commit

Permalink
fix: unresolved reference: attr after upgrading to 0.73.0-rc.2 (softw…
Browse files Browse the repository at this point in the history
…are-mansion#1919)

## Description

Small PR which probably resolves
[software-mansion#1515](software-mansion#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.
  • Loading branch information
ivanignatiev authored and ja1ns committed Oct 9, 2024
1 parent a55f7b4 commit 852db62
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 852db62

Please sign in to comment.