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: https://github.com/react/react-native/pull/57637

Test Plan: CI

Reviewed By: javache

Differential Revision: D113546520

Pulled By: cortinico

fbshipit-source-id: 5ccad2642b3e777a5a14fa64ff9128a9862416c2
This commit is contained in:
Nicola Corti authored and meta-codesync[bot] committed 2026-07-24 16:39:01 -07:00
1 parent 2b992a0d4b
commit 834721f124
1 file changed
+13 -10
@@ -625,16 +625,19 @@ android {
sourceSets {
named("main") {
res.directories.addAll(
listOf(
"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",
)
)
res.directories.apply {
clear()
addAll(
listOf(
"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",
)
)
}
}
}