React native ios xcode producing corrupt archives

I have an app being built with React Native. When I go to archive it, the organizer doesn't open, but I can see it in finder at "/Users/user182072/Library/Developer/Xcode/archives". When I double click, it shows the following error: "The archive could not be installed. The archive may be corrupt or unreadable."

When running the app on a simulator (iPhone or iPad), it runs correctly, with no errors produced.

I suspect that it might have something to do with the build phases. The Compile Sources includes "AppDelegate.m", "File.swift", and "main.m". Copy Bundle Resources includes "GoogleService-info.plist", "main.jsbundle", "Images.xcassets" and "LaunchScreen.storyboard".

I got this error last week, somehow got it fixed, and when I went to archive again yesterday, the error came back. Not sure anymore where to look or what to fix. I don't know if I've given enough info for help, please let me know if not.

Answered by hafizbhuyan in 710501022

Finally got the archives to be successfully built, and this is what I believe fixed it.

Under the "Products" folder, my [AppName].app was highlighted in red. After going to the Product -> Build, it ran and successfully finished and the [AppName].app was no longer red. Without cleaning the build folder, I just ran Product -> Archive and it successfully Archived. When opening the archive in Finder, "Products", "dSYMs", "BCSymbolMaps", "SCMBlueprint" and the Info.plist were all there.

Before doing that, I also ran 'pod deintegrate' and then 'pod install', but not sure if that was part of the solution.

Hopefully this helps someone else that might be experiencing the same issues.

Happy Building!

Update: after looking through the archives and comparing the ones that worked last week with the corrupted ones this week, I have found some differences. The corrupted ones only had 3 folders: "Products", "dSYMs", and "BCSymbolMaps". The working archives had those three folders plus "SCMBlueprint" and the Info.plist.

Every time I try to add the Info.plist to the Copy Bundle Resources, I get the error saying "Multiple Commands Produce ... Info.plist". I've looked everywhere, but can't seem to find how to fix it. The SCMBlueprint, not sure how to get that, I'm assuming it's produced with the Info.plist.

Accepted Answer

Finally got the archives to be successfully built, and this is what I believe fixed it.

Under the "Products" folder, my [AppName].app was highlighted in red. After going to the Product -> Build, it ran and successfully finished and the [AppName].app was no longer red. Without cleaning the build folder, I just ran Product -> Archive and it successfully Archived. When opening the archive in Finder, "Products", "dSYMs", "BCSymbolMaps", "SCMBlueprint" and the Info.plist were all there.

Before doing that, I also ran 'pod deintegrate' and then 'pod install', but not sure if that was part of the solution.

Hopefully this helps someone else that might be experiencing the same issues.

Happy Building!

React native ios xcode producing corrupt archives
 
 
Q