'Error archiving or generating signed bundle of my App whereas it works fine in debug mode

I am using react-native 0.61.5. For all the previous versions of my App, everything worked fine: I was running expo publish and then archiving the App on Xcode and generating a signed bundle on Android Studio. But spontaneously, now I cannot archive or generate a signed bundle (the App is still working fine in debug mode).

this is the error I get on iOS

and on Android

I also try to re-open previous versions that I was able to publish fine but now they also have the same error.

Would someone understand what is happening? :)

Thanks in advance!



Solution 1:[1]

Trying cleaning your build folder and trying again. Sometimes there may be some form of file corruption or mismatch of data within the build folder, if not cleaned for a while.

Use cd android

Then ./gradlew clean

For APK ./gradlew assembleRelease

For AAB ./gradlew bundleRelease

Try the equivalent for iOS within xCode.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Aleksandar Zoric