0

I'm new to iOS development and I'm already starting to hate it :)

I cannot paste code as I'm afraid it's not a code problem, but something related to xcode or the fact I own an M1 Mac.

I'm migrating an old iOS app written in Objective-C with some parts in Swift 3, and the problem started migrating Swift 3 to 4.

The app throws different errors when building. I guess they're all related to Cocoapods libraries (at least most of them are AWS SDK related). I have to say I have Cocoapods installed and running.

I've found references saying there are problems with new M1 Macs, but cannot find a working solution to this.

I've checked this:

Error: Could not build Objective-C module 'Firebase'

and this:

Xcode errors appearing and disappearing with every build (clean doesn't help)

and in one they suggest "Get Info" over Xcode app and enable open with "Rosetta", but even I've tried that it didn't work (have no idea what is Rosetta though).

Of course I've done the common troubleshooting like this:

  1. Clean + rebuild
  2. pod install
  3. pod update
  4. Exclude arquitectures > arm64 (mentioned in another SO question)

Nothing works and I'm stuck.

This is a screenshot of my current build attempt:

enter image description here

Any help to make my app build?

Edit 1:

I was adviced to use SPM instead of Cocoapods, and I'm considering that, but the problem is my app uses AWS SDK, and as far as I know there is no official AWS SDK for SPM yet. Apart from that I'm afraid I'll have to rewrite a lot of code if I switch the package manager, because I'm sure I won't find the same exact packages so the code fits without refactoring and rewriting.

My app is very old, true, and like it or not I know I'll end rewriting it, but meanwhile, and to muddle through, it's important for me to get it to build and run.

Diego Perez
  • 2,188
  • 2
  • 30
  • 58
  • Switch to SPM if you can – lorem ipsum Nov 24 '22 at 16:28
  • The problem is I'm new to iOS development and have not enough knowledge (and time) to migrate from Cocoapods to Swift Package Manager @lorem ipsum. – Diego Perez Nov 24 '22 at 16:33
  • Swift Package Manager, usually in the getting started section of the documentation for the package you are using you will find cocoapods and SPM directions, remove all the cocoapods and use SPM – lorem ipsum Nov 24 '22 at 16:33
  • well if you don't have time neither does anybody else here, migrating versions usually takes a lot of time but cocoapods are very problematic with M1 it will be overall easier with SPM – lorem ipsum Nov 24 '22 at 16:34
  • Do I have any guarantee that with SPM all build problems will be gone? – Diego Perez Nov 24 '22 at 16:34
  • You never get a guarantee for anything, nobody here knows anything about your project and by definition most licenses say that it isn't guaranteed. – lorem ipsum Nov 24 '22 at 16:35
  • Ok, thank you very much @lorem ipsum. I'll follow your suggestion. – Diego Perez Nov 24 '22 at 16:36
  • Nothing will be easy, you are trying to migrate a project that is 7ish years old? it will likely take a looong time – lorem ipsum Nov 24 '22 at 16:39
  • If you are new to iOS development I would advise against making your first project (or even an early project) trying to build a very old app. Build files/make files and such are some of the thorniest problems on any development platform, and even experienced developers struggle with such things. Start with a current project, and set that one aside until you get more experience. – Duncan C Nov 24 '22 at 18:08
  • I appreciate your advice @Duncan C. My app is very old, true, and like it or not I know I'll end rewriting it, but meanwhile, and to muddle through, it's important for me to get it to build and run. – Diego Perez Nov 24 '22 at 18:46
  • It was silly of me @lorem ipsum, because I thought it could be harder, but I was finally able to move to SPM with no problems. I have to say that not all my packages are available for SPM, but at least the conflicting one, AWS SDK. Now it's giving me a different compiling error, but this is for another post, so I'll close this one. Maybe you could write your suggestion as an answer and I'll mark it as correct. – Diego Perez Nov 25 '22 at 07:30
  • Lol, no problem, we have all had the avalanche of errors at some point or the other, I get the frustration. I’m glad you chose to switch – lorem ipsum Nov 25 '22 at 11:14

1 Answers1

0

Try switching to Swift Package Manager and let Xcode manage the dependencies across languages and platforms.

lorem ipsum
  • 21,175
  • 5
  • 24
  • 48