Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Android): Fix project doesn't compile when nonTransitiveRClass is set to true #1942

Closed
wants to merge 1 commit into from

Conversation

lukmccall
Copy link
Member

@lukmccall lukmccall commented Oct 23, 2023

Description

A follow-up to the #1515.
Fixes:

e: .../ScreenStackHeaderConfig.kt:391:46 Unresolved reference: attr

when the nonTransitiveRClass option is set to true.

The nonTransitiveRClass is a handy tool that can significantly reduce the size of your app and speed up the build time. It is important to support it. There is one reference to a resource incompatible with this rule: ' R.attr.colorPrimary. To make it work, you must import it from the android` package to indicate the build system where that resource is located.

Changes

Use the absolute path to import the attribute.

Test code and steps to reproduce

  • create a new RN project
  • add react-native-screens
  • add android.nonTransitiveRClass=true to gradle.properties

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

@tboba
Copy link
Member

tboba commented Oct 23, 2023

HI @lukmccall, thanks for creating this PR!
I believe this change is already included in #1919, but I appreciate the time you've spent on testing the change and collaborating to react-native-screens ❤️

I'll close this PR for now as it is a duplicate, but please ask any questions related to that change there if you've got any!

Cheers 🙏

@tboba tboba closed this Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants