Skip to content

Commit 834721f

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Fix src/main/res warnings due to AGP9 (#57637)
Summary: Fixes this warning that will break soon due to AGP9: ``` > Task :packages:react-native:ReactAndroid:generateDebugResources Nested resources detected. + src/main/res -- src/main/res/devsupport -- src/main/res/shell -- src/main/res/views/alert -- src/main/res/views/modal -- src/main/res/views/uimanager -- src/main/res/views/view Nested resources means you have layout like this: res.srcDirs = [ 'src/main/res/', 'src/main/res/category1' ] However, you should use following structure instead: res.srcDirs = [packages:rn-tester:android:app:de 'src/main/res/common', 'src/main/res/category1', 'src/main/res/category2' ] This Warning will be transformed into Error in version VERSION_9_0 ``` ## Changelog: [INTERNAL] - Pull Request resolved: #57637 Test Plan: CI Reviewed By: javache Differential Revision: D113546520 Pulled By: cortinico fbshipit-source-id: 5ccad2642b3e777a5a14fa64ff9128a9862416c2
1 parent 2b992a0 commit 834721f

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

packages/react-native/ReactAndroid/build.gradle.kts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -625,16 +625,19 @@ android {
625625

626626
sourceSets {
627627
named("main") {
628-
res.directories.addAll(
629-
listOf(
630-
"src/main/res/devsupport",
631-
"src/main/res/shell",
632-
"src/main/res/views/alert",
633-
"src/main/res/views/modal",
634-
"src/main/res/views/uimanager",
635-
"src/main/res/views/view",
636-
)
637-
)
628+
res.directories.apply {
629+
clear()
630+
addAll(
631+
listOf(
632+
"src/main/res/devsupport",
633+
"src/main/res/shell",
634+
"src/main/res/views/alert",
635+
"src/main/res/views/modal",
636+
"src/main/res/views/uimanager",
637+
"src/main/res/views/view",
638+
)
639+
)
640+
}
638641
}
639642
}
640643

0 commit comments

Comments
 (0)