Skip to content

Commit

Permalink
Sets the namespace via Gradle and not via AndroidManifest (#35094)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
cortinico authored and facebook-github-bot committed Oct 29, 2022
1 parent ec5a430 commit cec9a34
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions packages/rn-tester/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.facebook.react.uiapp">
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-feature
android:name="android.software.leanback"
Expand Down
1 change: 1 addition & 0 deletions template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ android {

compileSdkVersion rootProject.ext.compileSdkVersion

namespace "com.helloworld"
defaultConfig {
applicationId "com.helloworld"
minSdkVersion rootProject.ext.minSdkVersion
Expand Down
3 changes: 1 addition & 2 deletions template/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.helloworld">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down

0 comments on commit cec9a34

Please sign in to comment.