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
This commit is contained in:
Nicola Corti 2022-10-29 06:35:38 -07:00 коммит произвёл Facebook GitHub Bot
Родитель ec5a4301a3
Коммит cec9a34f6c
4 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -88,6 +88,7 @@ def reactNativeArchitectures() {
android { android {
buildToolsVersion = "31.0.0" buildToolsVersion = "31.0.0"
compileSdkVersion 31 compileSdkVersion 31
namespace "com.facebook.react.uiapp"
// Used to override the NDK path/version on internal CI or by allowing // 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) // users to customize the NDK path/version from their root project (e.g. for M1 support)

Просмотреть файл

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest <manifest
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android">
package="com.facebook.react.uiapp">
<uses-feature <uses-feature
android:name="android.software.leanback" android:name="android.software.leanback"

Просмотреть файл

@ -93,6 +93,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion
namespace "com.helloworld"
defaultConfig { defaultConfig {
applicationId "com.helloworld" applicationId "com.helloworld"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion

Просмотреть файл

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="com.helloworld">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />