diff --git a/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt b/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt index a7581e039324..6c4feba0987f 100644 --- a/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt +++ b/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt @@ -34,13 +34,19 @@ internal object AgpConfiguratorUtils { ext.buildTypes { val debug = getByName("debug").apply { - manifestPlaceholders["usesCleartextTraffic"] = "true" + if (!manifestPlaceholders.containsKey("usesCleartextTraffic")) { + manifestPlaceholders["usesCleartextTraffic"] = "true" + } } getByName("release").apply { - manifestPlaceholders["usesCleartextTraffic"] = "false" + if (!manifestPlaceholders.containsKey("usesCleartextTraffic")) { + manifestPlaceholders["usesCleartextTraffic"] = "false" + } } maybeCreate("debugOptimized").apply { - manifestPlaceholders["usesCleartextTraffic"] = "true" + if (!manifestPlaceholders.containsKey("usesCleartextTraffic")) { + manifestPlaceholders["usesCleartextTraffic"] = "true" + } initWith(debug) matchingFallbacks += listOf("release") externalNativeBuild { cmake { arguments("-DCMAKE_BUILD_TYPE=Release") } } diff --git a/private/react-native-fantom/runner/screenshots/__tests__/screenshotUtils-test.js b/private/react-native-fantom/runner/screenshots/__tests__/screenshotUtils-test.js index af0c7f10c698..6e2ef8a5cd7f 100644 --- a/private/react-native-fantom/runner/screenshots/__tests__/screenshotUtils-test.js +++ b/private/react-native-fantom/runner/screenshots/__tests__/screenshotUtils-test.js @@ -184,9 +184,9 @@ it('continues generating differences after missing, corrupt or unwritable files' it('creates new images next to Jest snapshots', () => { const result = createResult(true, false); processScreenshotResults(getConfig(), [result], 'new', passedTests); - expect(result.expectedPath).toContain( - '__snapshots__/example-test.js.screenshots/', - ); + // Normalize paths to work on Windows (path.join uses \ on Windows) + const expectedPath = result.expectedPath.replace(/\\/g, '/'); + expect(expectedPath).toContain('__snapshots__/example-test.js.screenshots/'); expect(fs.readFileSync(result.expectedPath, 'utf8')).toBe('new image'); expect( result.receivedPath == null || !fs.existsSync(result.receivedPath),