Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove namespace from AndroidManifest.xml's package attribute and move it to the module's build.gradle file #857

Open
rahulsaipandit opened this issue Sep 20, 2023 · 0 comments

Comments

@rahulsaipandit
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Using this package generates an error -
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.

Here is the diff that solved my problem:

diff --git a/node_modules/rn-fetch-blob/android/build.gradle b/node_modules/rn-fetch-blob/android/build.gradle
index a4ca7a4..7fd5c79 100644
--- a/node_modules/rn-fetch-blob/android/build.gradle
+++ b/node_modules/rn-fetch-blob/android/build.gradle
@@ -21,6 +21,7 @@ buildscript {
 }
 
 android {
+	namespace "com.RNFetchBlob"
     compileSdkVersion safeExtGet('compileSdkVersion', 28)
     buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
     defaultConfig {
diff --git a/node_modules/rn-fetch-blob/android/src/main/AndroidManifest.xml b/node_modules/rn-fetch-blob/android/src/main/AndroidManifest.xml
index 1c92420..5795152 100644
--- a/node_modules/rn-fetch-blob/android/src/main/AndroidManifest.xml
+++ b/node_modules/rn-fetch-blob/android/src/main/AndroidManifest.xml
@@ -1,5 +1,4 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.RNFetchBlob">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
 
     <!-- Required to access Google Play Licensing -->
     <uses-permission android:name="com.android.vending.CHECK_LICENSE" />

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant