react-native-image-resizer icon indicating copy to clipboard operation
react-native-image-resizer copied to clipboard

'ReactCommon/RCTTurboModule.h' file not found

Open ShaoGongBra opened this issue 1 year ago • 8 comments
trafficstars

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

ShaoGongBra avatar Sep 07 '24 16:09 ShaoGongBra

the same issue

serhii-yalla avatar Sep 10 '24 15:09 serhii-yalla

+1

MateoParodi avatar Sep 16 '24 15:09 MateoParodi

+1

khushal87 avatar Sep 19 '24 12:09 khushal87

+1

veerabharathkumar avatar Sep 20 '24 10:09 veerabharathkumar

Facing the same issue.

ashwini-ksingh avatar Oct 01 '24 07:10 ashwini-ksingh

+1

sandipsarkar13 avatar Oct 01 '24 12:10 sandipsarkar13

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)

ashwini-ksingh avatar Oct 03 '24 10:10 ashwini-ksingh

+1

nickvgn avatar Oct 13 '24 01:10 nickvgn

+1

ravindraguptacapgemini avatar Oct 25 '24 11:10 ravindraguptacapgemini

+1

kdn0325 avatar Oct 28 '24 06:10 kdn0325

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

khushal87 avatar Oct 29 '24 08:10 khushal87

@taboulot can you give it a look?

khushal87 avatar Oct 29 '24 08:10 khushal87

+1

Jin-seop avatar Oct 30 '24 01:10 Jin-seop

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

kdn0325 avatar Oct 31 '24 09:10 kdn0325

+1 after enabling the new arch

yuriiburov avatar Nov 05 '24 13:11 yuriiburov

the same issue using 0.76.1

Stas-Buzunko avatar Nov 08 '24 10:11 Stas-Buzunko

+1

joseviniciusnunes avatar Nov 08 '24 20:11 joseviniciusnunes

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).

macksal avatar Nov 11 '24 08:11 macksal

https://github.com/bamlab/react-native-image-resizer/issues/410#issuecomment-2391113068

works for me

zhiqingchen avatar Nov 12 '24 09:11 zhiqingchen

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

edritech93 avatar Nov 13 '24 09:11 edritech93

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

prasanna-colan avatar Nov 14 '24 10:11 prasanna-colan

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

gh-pro avatar Nov 19 '24 18:11 gh-pro

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 25 '25 09:01 stale[bot]

This issue has been automatically closed. Thank you for your contributions.

stale[bot] avatar Feb 01 '25 18:02 stale[bot]