numandev1 / react-native-compressor

🗜️Compress Image, Video, and Audio same like Whatsapp 🚀✨
MIT License
952 stars 94 forks source link

Not building in Android and iOS for React Native 76.0 new arch enabled project #314

Open Gautham495 opened 1 month ago

Gautham495 commented 1 month ago

Current behavior

Does not build in android and ios for new arch.

Works well in old arch

Expected behavior

Should build properly without showing 5 duplicate symbols error in ios.

Platform

React Native Version

76.0

React Native Compressor Version

Latest Version.

@numandev1 - Check it out when you have free time please.

github-actions[bot] commented 1 month ago

👋 @Gautham495 Thanks for opening your issue here! If you find this package useful hit the star🌟!

gelodgreat commented 4 weeks ago

up for this

gontovnik commented 3 weeks ago

Facing the same problem. The team has shared that even the old architecture but 76.0 is not building

vbylen commented 3 weeks ago

Can confirm react-native-compressor is making builds fail on 0.76 new arch

xiaoyaotan12345 commented 3 weeks ago

Me too, the build failed with a rate of 0.76.

AhmadAltomy commented 3 weeks ago
diff --git a/node_modules/react-native-compressor/package.json b/node_modules/react-native-compressor/package.json
index 8adf7dc..8dd43a6 100644
--- a/node_modules/react-native-compressor/package.json
+++ b/node_modules/react-native-compressor/package.json
@@ -197,11 +197,6 @@
         "name": "RNCompressorSpec",
         "type": "modules",
         "jsSrcsDir": "src"
-      },
-      {
-        "name": "RNVideoCompressorSpec",
-        "type": "modules",
-        "jsSrcsDir": "src"
       }
     ]
   }

This changes fixes the build for me

Gautham495 commented 3 weeks ago

@AhmadAltomy

This fixes it for android. Thanks.

Akyna commented 2 weeks ago

Facing the same problem

    "react-native": "0.76.1",
    "react-native-compressor": "^1.9.0",

for IOS

...
duplicate symbol '_OBJC_IVAR_$_NativeCompressorSpecBase._eventEmitterCallback' in:
    /Users/......../ReactCodegen/libReactCodegen.a[60](RNVideoCompressorSpec-generated.o)
    /Users/......./ReactCodegen/libReactCodegen.a[38](RNCompressorSpec-generated.o)
ld: 5 duplicate symbols
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
sincerely-manny commented 2 weeks ago
diff --git a/node_modules/react-native-compressor/package.json b/node_modules/react-native-compressor/package.json
index 8adf7dc..8dd43a6 100644
--- a/node_modules/react-native-compressor/package.json
+++ b/node_modules/react-native-compressor/package.json
@@ -197,11 +197,6 @@
         "name": "RNCompressorSpec",
         "type": "modules",
         "jsSrcsDir": "src"
-      },
-      {
-        "name": "RNVideoCompressorSpec",
-        "type": "modules",
-        "jsSrcsDir": "src"
       }
     ]
   }

This changes fixes the build for me

confirmed for ios, thanks!

andresribeiro commented 1 week ago

+1

diff --git a/node_modules/react-native-compressor/package.json b/node_modules/react-native-compressor/package.json
index 8adf7dc..8dd43a6 100644
--- a/node_modules/react-native-compressor/package.json
+++ b/node_modules/react-native-compressor/package.json
@@ -197,11 +197,6 @@
         "name": "RNCompressorSpec",
         "type": "modules",
         "jsSrcsDir": "src"
-      },
-      {
-        "name": "RNVideoCompressorSpec",
-        "type": "modules",
-        "jsSrcsDir": "src"
       }
     ]
   }

This changes fixes the build for me

thank you. a patch fixed the build

ajkraus04 commented 1 week ago

Can someone explain how to create a patch or use this solution in my app?

andresribeiro commented 1 week ago

@ajkraus04 for npm, use patch-package yarn path for yarn bun patch for bun pnpm patch for pnpm

Faivv commented 1 week ago

Build was successful for Android but not for IOS. Eventually, for IOS, downgrade to react-native 0.75.2 solved the problem for me.

niki-bri commented 6 days ago

Any updates? According to the react native directory, react-native-compressor supports the new architecture.

Shaninnik commented 5 days ago

For us it does not build even with old arch and Expo 52/react-native 0.76.2 on iOS