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

'ReactCommon/RCTTurboModule.h' file not found #410

Open
ShaoGongBra opened this issue Sep 7, 2024 · 22 comments
Open

'ReactCommon/RCTTurboModule.h' file not found #410

ShaoGongBra opened this issue Sep 7, 2024 · 22 comments

Comments

@ShaoGongBra
Copy link

RN0.75 opens a new architecture and packages IOS, resulting in this error

@serhii-yalla
Copy link

the same issue

@MateoParodi
Copy link

+1

2 similar comments
@khushal87
Copy link

+1

@veerabharathkumar
Copy link

+1

@ashwini-ksingh
Copy link

Facing the same issue.

@sandipsarkar13
Copy link

+1

@ashwini-ksingh
Copy link

Adding install_modules_dependencies(s) solved the issue for me.

Patch File:

diff --git a/package.json b/package.json
index 7a73b6e0d42d5eacd9d9d15017d019ed67a09a0a..408f7d6b3d79036518b4da904daa706eef15b241 100644
--- a/package.json
+++ b/package.json
@@ -169,12 +169,8 @@
     ]
   },
   "codegenConfig": {
-    "libraries": [
-      {
-        "name": "RNImageResizerSpec",
-        "type": "modules",
-        "jsSrcsDir": "src"
-      }
-    ]
+     "name": "RNImageResizerSpec",
+     "type": "modules",
+     "jsSrcsDir": "src"
   }
 }
diff --git a/react-native-image-resizer.podspec b/react-native-image-resizer.podspec
index c7ba7d9e261abbb890cccf0c9dd58eba118083be..749803239f7765994408d525e3cf7cff787e847a 100644
--- a/react-native-image-resizer.podspec
+++ b/react-native-image-resizer.podspec
@@ -32,6 +32,7 @@ Pod::Spec.new do |s|
     s.dependency "RCTRequired"
     s.dependency "RCTTypeSafety"
     s.dependency "ReactCommon/turbomodule/core"
+    install_modules_dependencies(s)
   end
 end

Note: package.json changes are related to warning shown while building (#413)

@nickvgn
Copy link

nickvgn commented Oct 13, 2024

+1

2 similar comments
@ravindraguptacapgemini
Copy link

+1

@kdn0325
Copy link

kdn0325 commented Oct 28, 2024

+1

@khushal87
Copy link

This is reproducible easily when enabling the new arch on RN 0.75.4

@khushal87
Copy link

@taboulot can you give it a look?

@Jin-seop
Copy link

Jin-seop commented Oct 30, 2024

+1

@kdn0325
Copy link

kdn0325 commented Oct 31, 2024

I updated to react native 0.76.0 version and got this issue when using it 😢

@yuriiburov
Copy link

+1 after enabling the new arch

@Stas-Buzunko
Copy link

the same issue using 0.76.1

@joseviniciusnunes
Copy link

+1

@macksal
Copy link

macksal commented Nov 11, 2024

Same problem on react-native 0.76.1, expo 52.

Testing the workaround mentioned above seems to have fixed the build error, but I haven't launched the application to fully verify it. (I am still getting build errors from an unrelated dependency).

@zhiqingchen
Copy link

#410 (comment)

works for me

@edritech93
Copy link

same issue
"react-native": "0.76.1",
"@bam.tech/react-native-image-resizer": "^3.0.10",

@prasanna-colan
Copy link

prasanna-colan commented Nov 14, 2024

Faced the same issue in "react-native": "0.76.1"

Solved by Adding install_modules_dependencies(s) below the line s.dependency "ReactCommon/turbomodule/core" in node_modules/@bam.tech/react-native-image-resizer/react-native-image-resizer.podspec

OR

Without installing the patch, using post install,
inside script, "postinstall": "node ./scripts/fixPodspec.js" in package.json

Create a file: scripts/fixPodspec.js

const fs = require('fs');
const path = require('path');

const podspecPath = path.resolve('node_modules/@bam.tech/react-native-image-resizer/react-native-image-resizer.podspec');

fs.readFile(podspecPath, 'utf8', (err, data) => {
  if (err) {
    console.error('Error reading podspec file:', err);
    return;
  }

  // Check if the modification is already done, to avoid redundant edits
  if (!data.includes('install_modules_dependencies(s)')) {
    const modifiedData = data.replace(
      's.dependency "ReactCommon/turbomodule/core"',
      's.dependency "ReactCommon/turbomodule/core"\n  install_modules_dependencies(s)'
    );

    fs.writeFile(podspecPath, modifiedData, 'utf8', (err) => {
      if (err) {
        console.error('Error writing podspec file:', err);
      } else {
        console.log('Podspec file updated successfully.');
      }
    });
  }
});

Then run npm i

It works to me

@gh-pro
Copy link

gh-pro commented Nov 19, 2024

it's work for me

Adding install_modules_dependencies(s) solved the issue for me.

Patch File:

diff --git a/package.json b/package.json
index 7a73b6e0d42d5eacd9d9d15017d019ed67a09a0a..408f7d6b3d79036518b4da904daa706eef15b241 100644
--- a/package.json
+++ b/package.json
@@ -169,12 +169,8 @@
     ]
   },
   "codegenConfig": {
-    "libraries": [
-      {
-        "name": "RNImageResizerSpec",
-        "type": "modules",
-        "jsSrcsDir": "src"
-      }
-    ]
+     "name": "RNImageResizerSpec",
+     "type": "modules",
+     "jsSrcsDir": "src"
   }
 }
diff --git a/react-native-image-resizer.podspec b/react-native-image-resizer.podspec
index c7ba7d9e261abbb890cccf0c9dd58eba118083be..749803239f7765994408d525e3cf7cff787e847a 100644
--- a/react-native-image-resizer.podspec
+++ b/react-native-image-resizer.podspec
@@ -32,6 +32,7 @@ Pod::Spec.new do |s|
     s.dependency "RCTRequired"
     s.dependency "RCTTypeSafety"
     s.dependency "ReactCommon/turbomodule/core"
+    install_modules_dependencies(s)
   end
 end

Note: package.json changes are related to warning shown while building (#413)

Hy, thanks you. It's work for me.

Etape to fix this

Go to node_modules/@bam.tech/react-native-image-resizer/react-native-image-resizer.podspec

adding this
install_modules_dependencies(s)
after
s.dependency "ReactCommon/turbomodule/core"

open package.json on same directory and replace content of "codegenConfig": {
"libraries": [
{
"name": "RNImageResizerSpec",
"type": "modules",
"jsSrcsDir": "src"
}
]
}

by this "codegenConfig": {
"name": "RNImageResizerSpec",
"type": "modules",
"jsSrcsDir": "src"
}

on terminal => yarn install or npm install
and cd ios => exec bundle exec pod install
on xcode, clean build and its work

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