Skip to content

Build fails for react-native-fs: 'Namespace not specified' error on Android #1255

@jyotigupta007

Description

@jyotigupta007

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-fs@2.20.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-fs/android/build.gradle b/node_modules/react-native-fs/android/build.gradle
index ddef857..99f949c 100644
--- a/node_modules/react-native-fs/android/build.gradle
+++ b/node_modules/react-native-fs/android/build.gradle
@@ -15,6 +15,8 @@ buildscript {
 apply plugin: 'com.android.library'
 
 android {
+    namespace 'com.rnfs'
+
     compileSdkVersion safeExtGet('compileSdkVersion', 26)
     buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
 
@@ -22,7 +24,7 @@ android {
         minSdkVersion safeExtGet('minSdkVersion', 19)
         targetSdkVersion safeExtGet('targetSdkVersion', 26)
         versionCode 1
-        versionName "1.0"
+        versionName '1.0'
     }
     lintOptions {
         abortOnError false

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions