From cec9a34f6cd2a82bba76e15761da6b588bc3f574 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Sat, 29 Oct 2022 06:35:38 -0700 Subject: [PATCH] Sets the namespace via Gradle and not via AndroidManifest (#35094) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/35094 Currently the build on console is firing this warning: ``` > Task :app:processDebugMainManifest package="com.androidtemplateproject" found in source AndroidManifest.xml: /tmp/AndroidTemplateProject/android/app/src/main/AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. ``` This diff fixes it so users won't see it anymore on 0.71 Changelog: [Android] [Fixed] - Sets the namespace via Gradle and not via AndroidManifest Reviewed By: cipolleschi Differential Revision: D40724654 fbshipit-source-id: 9b01748a22e9993b60e17bf25acbc68ba8e4eb77 --- packages/rn-tester/android/app/build.gradle | 1 + packages/rn-tester/android/app/src/main/AndroidManifest.xml | 3 +-- template/android/app/build.gradle | 1 + template/android/app/src/main/AndroidManifest.xml | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/rn-tester/android/app/build.gradle b/packages/rn-tester/android/app/build.gradle index c7d5c448d5bd29..4e3ca30c3855d1 100644 --- a/packages/rn-tester/android/app/build.gradle +++ b/packages/rn-tester/android/app/build.gradle @@ -88,6 +88,7 @@ def reactNativeArchitectures() { android { buildToolsVersion = "31.0.0" compileSdkVersion 31 + namespace "com.facebook.react.uiapp" // Used to override the NDK path/version on internal CI or by allowing // users to customize the NDK path/version from their root project (e.g. for M1 support) diff --git a/packages/rn-tester/android/app/src/main/AndroidManifest.xml b/packages/rn-tester/android/app/src/main/AndroidManifest.xml index 5bdcb1a686b3af..640e56c12a6f56 100644 --- a/packages/rn-tester/android/app/src/main/AndroidManifest.xml +++ b/packages/rn-tester/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:android="http://schemas.android.com/apk/res/android"> +