-
-
Notifications
You must be signed in to change notification settings - Fork 527
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: Unresolved reference: attr after upgrading to 0.73.0-rc.2 #1919
fix: Unresolved reference: attr after upgrading to 0.73.0-rc.2 #1919
Conversation
Hi @ivanignatiev! I remember we've already got similar issue and there was just a problem with a cache (see #1104) - can you please ensure that cleaning the build cache (via |
Hi, this fix helped me solve the same problem, but using RN 0.72.6. |
Hi @adolfogc, have you tried running |
@tboba I will check from my side this evening to confirm and give you more details |
Hi @tboba, I am using PNPM and rnx-kit, so I ran the following: git clean -fdx
# Install without the patch
pnpm install
pnpm react-native rnx-start --reset-cache However, the problem persists: * What went wrong:
Execution failed for task ':react-native-screens:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details |
Test with [email protected]: npx [email protected] init AwesomeProject --version 0.72.6
npm run android # BUILD - OK
npm install -s react-native-screens
npm run android # BUILD - OK Test with [email protected]: npx [email protected] init AwesomeProject2 --version 0.73.0-rc.2
npm run android # BUILD - OK
npm install -s react-native-screens
npm run android # BUILD - FAILED
FAILURE: Build failed with an exception.
# * What went wrong:
# A problem occurred configuring project ':react-native-screens'.
# > com.android.builder.errors.EvalIssueException: defaultConfig contains custom BuildConfig fields, but the feature is # disabled.
# To enable the feature, add the following to your module-level build.gradle:
# `android.buildFeatures.buildConfig true`
# Adding buildFeatures.buildConfig true just after namespace in build.grandle
npm run android # BUILD - FAILED
# > Task :react-native-screens:compileDebugKotlin FAILED
# e: file:///Users/ivanignatiev/Projects/AwesomeProject2/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt:391:46 Unresolved reference: attr
npm run android --reset-cache # BUILD - FAILED
# > Task :react-native-screens:compileDebugKotlin FAILED
# e: file:///Users/ivanignatiev/Projects/AwesomeProject2/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt:391:46 Unresolved reference: attr react-info:
Should I add |
I am using Java 17.0.8.1 ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing <3 I'll modify the PR description to give better explanation why this change is needed.
@kkafar thank you for clear explanation ! |
# Why With AGP 8, non-transitive R classes are now enabled by default, requiring the resource file names to be fully qualified. Given that React Native 0.73 depends on AGP 8.0 we must update react-native-screens to include [this](software-mansion/react-native-screens#1919) fix. # How - `et uvm -m react-native-screens -c 3.27.0` # Test Plan - unversioned expo go + ncl screens - bare expo + ncl screens # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
# Why With AGP 8, non-transitive R classes are now enabled by default, requiring the resource file names to be fully qualified. Given that React Native 0.73 depends on AGP 8.0 we must update react-native-screens to include [this](software-mansion/react-native-screens#1919) fix. # How - `et uvm -m react-native-screens -c 3.27.0` # Test Plan - unversioned expo go + ncl screens - bare expo + ncl screens # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
…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.
Description
Small PR which probably resolves #1515.
For my case, I got this build issue after upgrading from 0.72.5 to 0.73.0-rc.2:
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 fromfalse
totrue
. This requires resource file names to be fully qualified. React Native 0.73 depends on AGP 8.0 thus we get the build issues.