Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build ios with Sonoma on M1 and Python 3.9.6 #1767

Closed
spyke555 opened this issue May 2, 2024 · 4 comments
Closed

Failed to build ios with Sonoma on M1 and Python 3.9.6 #1767

spyke555 opened this issue May 2, 2024 · 4 comments
Labels
bug A crash or error in behavior. iOS The issue relates to Apple iOS mobile support.

Comments

@spyke555
Copy link

spyke555 commented May 2, 2024

Describe the bug

Setting up a Mac Mini development environment and I've been able to get the macos and andoird builds working using a new helloworld app, however ios build are failing.

Looks like the build is failing at the code signing step. I've followed suggestions provided here without success:

Code Sign Error in macOS Monterey, Xcode - resource fork, Finder information, or similar detritus not allowed

I did also try building in xcode which seemed to work but helloworld app would not run in simulator.

I have seen others mention issues with Sonoma but they were using Python 3.12, should I consider upgradeing to that? Any other suggestions / guidance would be appreciated.

Steps to reproduce

On an M1 Mac Mini:

  1. Update OS to Sonoma 14.4.1
  2. Update Xcode to 15.3
  3. Follow MacOS tutorials 0 and 1 to confirm development environment setup
  4. Create IOS app with: briefcase create ios
  5. Build IOS app with: briefcase build ios

Expected behavior

Per tutorial 5, would expect build to complete. Would expect some form of error message indicating what needs to be corrected to move forward.

Screenshots

Screenshot 2024-05-02 at 6 15 09 AM

Environment

  • Operating System: MacOS Sonoma 14.4.1, Xcode 15.3
  • Python version: 3.9.6
  • Software versions:
    • Briefcase: 0.3.17

Logs

briefcase.2024_05_02-06_06_19.build.log

Additional context

No response

@spyke555 spyke555 added the bug A crash or error in behavior. label May 2, 2024
@rmartin16 rmartin16 added the iOS The issue relates to Apple iOS mobile support. label May 2, 2024
@rmartin16
Copy link
Member

FWIW, I cannot reproduce this after upgrading to 14.4.1 and Xcode 15.3. Notably, though, I'm running Sonoma in a VM on Intel hardware.

Adding error text for seo.

           [helloworld] Building Xcode project...                                                                                                                       xcode.py:393
                                                                                                                                                                   subprocess.py:711
           >>> Running Command:                                                                                                                                    subprocess.py:711
           >>>     xcodebuild build -project '/Users/sandy/Documents/Programming/BeeWare/helloworld/build/helloworld/ios/xcode/Hello World.xcodeproj' -destination subprocess.py:711
           'platform="iOS Simulator"' -configuration Debug -arch arm64 -sdk iphonesimulator -quiet                                                                                  
           >>> Working Directory:                                                                                                                                  subprocess.py:711
           >>>     /Users/sandy/Documents/Programming/BeeWare/helloworld                                                                                           subprocess.py:711
[06:06:19] /Users/sandy/Documents/Programming/BeeWare/helloworld/build/helloworld/ios/xcode/build/Debug-iphonesimulator/Hello World.app: resource fork, Finder     subprocess.py:681
           information, or similar detritus not allowed                                                                                                                             
           Command CodeSign failed with a nonzero exit code                                                                                                        subprocess.py:681
           note: Run script build phase 'Purge Python Binary Modules for Non-Target Platforms' will be run during every build because the option to run the script subprocess.py:681
           phase "Based on dependency analysis" is unchecked. (in target 'Hello World' from project 'Hello World')                                                                  
           note: Run script build phase 'Sign Python Binary Modules' will be run during every build because the option to run the script phase "Based on           subprocess.py:681
           dependency analysis" is unchecked. (in target 'Hello World' from project 'Hello World')                                                                                  
           ** BUILD FAILED **                                                                                                                                      subprocess.py:681
                                                                                                                                                                   subprocess.py:681
           >>> Return code: 65                                                                                                                                     subprocess.py:711
           Building...                                                                                                                                                  xcode.py:418
                                                                                                                                                                      __main__.py:44
           Unable to build app helloworld.                                                                                                                            __main__.py:45

@spyke555
Copy link
Author

spyke555 commented May 2, 2024

Thanks martin16,

This machine is used for development only, so will try a full wipe and reinstall and report back if that helped. At least it's possible with this OS version. Appreciate the feedback.

@freakboy3742
Copy link
Member

Sorry to hear you're having problems; unfortunately, I'm in the same boat as rmartin16 - I can't reproduce what you're seeing.

A couple of avenues for exploration:

  • Try running briefcase open iOS; this will open Xcode on your project, and allow you to use Xcode directly to run the project (look for the play button in the top bar, and the list of devices; select an iOS simulator). That might give more detail on how/why the codesign is failing. It might even be a case of not accepting a license agreement somewhere - there's a couple of things that get done the very first time you run Xcode, and it's possible you're missing one of those. It might also help to clean the project before a build (Product > Clean build folder from the menu)
  • It's possible one of the downloads was corrupted - either the project template, or the binary support package. If you delete ~/Library/Caches/org.beeware.briefcase/support and ~/.cookiecutters/briefcase-iOS-Xcode-template, then re-generate the project (delete the build folder, then re-run `briefcase run iOS), it will re-download those artefacts. Keep an eye out for any messages about download issues.
  • It looks like you're using the Python that ships with Xcode; I haven't heard any reports of this being a problem, but it's not impossible. Try installing an official Python.org release, recreate your venv, re-install briefcase, then re-generate the project.

@spyke555
Copy link
Author

spyke555 commented May 3, 2024

Thank you for the feedback guys!

I've gone nuclear and erased the Mac mini and did an OS re-install to start fresh. Installed Xcode only and then briefcase. From there did a new > dev which worked. Then did create iOS > build iOS > run iOS and after the command line tools downloaded at the build step Simulator came up and started the hello world app.

So it was definitely an issue with my config / downloads but not sure which.

@spyke555 spyke555 closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. iOS The issue relates to Apple iOS mobile support.
Projects
None yet
Development

No branches or pull requests

3 participants