shinydevelopment / SimulatorStatusMagic

Clean up your status bar for taking screenshots on the iOS simulator.
MIT License
2.35k stars 140 forks source link

Uploading to App Store? #61

Closed KjellConnelly closed 6 years ago

KjellConnelly commented 6 years ago

Hi! I'm using Simulator Status Magic on my React Native iOS app, and I got it working to some degree. I am also using Fastlane to automate my deployment. But I came across an issue where it's saying:

ERROR ITMS-90087: "Unsupported Architectures. The executable for ReactNativeWeb.app/Frameworks/SimulatorStatusMagiciOS.framework contains unsupported architectures '[x86_64, i386]'."
ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'ReactNativeWeb.app/Frameworks/SimulatorStatusMagiciOS.framework/SimulatorStatusMagiciOS' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."

This only happens when I try to deploy, not when I run on simulator, or on device.

Steps I used to install SimulatorStatusMagic:

1) Download the source code and open the XCode project 2) Run the target SimulatorStatusMagicUniversalFramework which generates a universal framework for both device and simulator. 3) Drag and drop the generated framework into your project. 4) #import header into appDelegate 5) Obj-C code to enable/disable it 6) I also had to add the generated framework to Embedded Binaries in Xcode, otherwise, it wouldn't run. 7) Turned off bitcode on my target since the universal framework wasn't built with bitcode.

I know I don't need SimulatorStatusMagic to be included when I build for the app store, but I don't want to have to manually remove/add it every time I switch between creating screenshots and archiving. Any ideas on how to get this framework to play nicely in all circumstances?

daveverwer commented 6 years ago

Funny how this issue also came up just a couple of days ago here.

Unfortunately, as the framework uses private APIs it can never be included in an App Store build. However, this should be useful!

KjellConnelly commented 6 years ago

@daveverwer Thanks for the reply and the updated info :)

I took two steps forward, and one back, so maybe you can still help. I removed the .framework from my xcode project, and just left in in the same directory as my xcode project is in. Then I added the run script to grab that framework and put it into the generate app's Frameworks folder. I also added the #if DEBUG / #endif code to my AppDelegate.m file.

I've verified that when I run the app in release mode, everything seems to work fine (haven't tried to upload yet though). But when I run in debug mode, I get this error:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_SDStatusBarManager", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64

And when I try to run on device, it has the same message, except for arm64.

Any ideas? If I remove the actual method calls, but leave the #import, the app will still run fine (and the framework is copied to the Frameworks folder as expected).

KjellConnelly commented 6 years ago

Whoops - I think I figured out my issue... search paths...

I'm always having trouble with search paths in xcode, and here is another example of it. Was using an absolute path to SDStatusBarManager.h. By changing it to a relative path, Xcode was finally able to get it together and be able to start up properly :)