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

Running on M1, failed archiving #131

Closed
Zalexei opened this issue Mar 20, 2021 · 26 comments
Closed

Running on M1, failed archiving #131

Zalexei opened this issue Mar 20, 2021 · 26 comments

Comments

@Zalexei
Copy link

Zalexei commented Mar 20, 2021

Hi. Running utility on M1. It automatically tries to archive with Macbook device (first in the list).
The error is that device (macbook m1) is missing in provisioning profile (even though iphone is connected to macbook)
When I create new profile Xcode gives ('Xcode failed to provision this target.').
Is it possible to select other device?

---- LOGS
Provide the project file manually
Please drag-and-drop your Xcode Project (.xcodeproj) or Workspace (.xcworkspace) file,
the one you usually open in Xcode, then hit Enter.
(Note: if you have a Workspace file you should most likely use that) : /Users/abc/Developer/app/ios/Runner.xcodeproj

🔦 Scanning Schemes ...
$ xcodebuild "-project" "/Users/abc/Developer/app/ios/Runner.xcodeproj" "-list"

Xcode (xcodebuild) version: Xcode 12.4 (Build version 12D4e)

🔦 Running an Xcode Archive, to get all the required code signing settings...
$ xcodebuild "-project" "/Users/apc/Developer/app/ios/Runner.xcodeproj" "-scheme" "Runner" "clean" "archive" "-archivePath" "/var/folders/dw/xl3p4j5s7q32s8nq3fzhh_rw0000gn/T/__codesigndoc__014643693/Runner.xcarchive"
..

Last lines of the build log:
IDEArchivePathOverride = /var/folders/dw/xl3p4j5s7q32s8nq3fzhh_rw0000gn/T/__codesigndoc__014643693/Runner.xcarchive

note: Using new build system
note: Building targets in parallel
error: Could not delete /Users/abc/Developer/app/build/ios because it was not created by the build system.

** CLEAN FAILED **

note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
error: Provisioning profile "iOS Team Provisioning Profile: com.app.ios" doesn't include the currently selected device "Alexei’s MacBook Pro" (identifier 5105DACA-2DE8-553C-8E2E-713CEE825EDF). (in target 'Runner' from project 'Runner')

** ARCHIVE FAILED **
Please check the build log to see what caused the error.

Xcode Archive failed.
Open the project: /Users/abc/Developer/app/ios/Runner.xcodeproj
and make sure that you can build an Archive, with the scheme: Runner

💡 Saving xcodebuild output into file: /Users/abc/codesigndoc_exports/xcodebuild-output.log


First of all please make sure that you can Archive your app from Xcode.
codesigndoc only works if you can archive your app from Xcode.
If you can, and you get a valid .ipa/.app file if you export from Xcode,
please create an issue on GitHub at: https://github.com/bitrise-io/codesigndoc/issues
with as many details & logs as you can share!

Error: failed to run xcodebuild command, error: exit status 65

@S4b3
Copy link

S4b3 commented Mar 29, 2021

I'm having the same problem on my M1, this is so frustrating.

By reading the logs it appears (in mine) that the problem is :
"Provisioning profile "iOS Team Provisioning Profile: [.........]" doesn't include the currently selected device "MacBook Air [...]" (identifier [......]). (in target 'Runner' from project 'Runner')"

The fun part is that if I copy the xcodebuild line from the tool output
$ xcodebuild "-workspace" "/Users/[.....]/ios/Runner.xcworkspace" "-scheme" "Runner" "clean" "archive" "-archivePath" "/var/folders/c6/8dfdwbsj2nqfsdt9vn18_5gh0000gn/T/__codesigndoc__598000363/Runner.xcarchive"
and run it manually in any terminal tab everything works completely fine. Does that happen to you aswell?

@Omgitsu
Copy link

Omgitsu commented Apr 8, 2021

bump - same issue here.

@bitce
Copy link

bitce commented Apr 8, 2021

Hi everyone! Thanks for the reports, we're definitely taking a look on how to make sure codesigndoc runs on M1 properly. Just out of curiousity, do you get these errors when running a terminal in Rosetta mode too?

@wizawuza
Copy link

Just tried on a rosetta terminal, similar error:
error: Provisioning profile "iOS Team Provisioning Profile: *" doesn't include the currently selected device "<redacted>" (identifier <redacted>). (in target 'Runner' from project 'Runner')

@wizawuza
Copy link

Turning off "Automatically manage signing" seemed to work for me. Hopefully this will help someone else too.

@KaimanM
Copy link

KaimanM commented Apr 26, 2021

A temp workaround for those that have come to this issue is to manually upload your provisioning profile and code signing cert to bitrise in the meantime while this is fixed.

Provisioning profiles can be found at :
~/Library/MobileDevice/Provisioning Profiles

Details on how to obtain code signing cert can be found here:
https://ioscodesigning.com/exporting-code-signing-files/

@ssilverberry
Copy link

@bitce Yep, tried to run it in Rosetta terminal and got the same error as @Zalexei.

@rmncv
Copy link

rmncv commented Jul 9, 2021

bump. same error

@jackdewhurst
Copy link

Same issue, my project is not set up to build for MacOS so using the default destination won't work. I need to be able to select "Any iOS Device" for archive.

@SkylerSeamans
Copy link

Bump. Same error.

@davidcz95
Copy link

Same

1 similar comment
@icanswiftabit
Copy link

Same

@tomacco
Copy link

tomacco commented Sep 13, 2021

Same here. Is there any estimation for a bugfix?

@Roland-Bak
Copy link

Hey there everyone, cannot provide an ETA as of yet, but I can confirm that this is under refinement 🙂

@jnwagstaff
Copy link

Same problem ☹️

@Jairolaya12x
Copy link

Same here

@leandromuuvlabs
Copy link

Same problem!

@sohichiro
Copy link

I think we need some arg "-destination 'generic/platform=iOS'"
https://developer.apple.com/forums/thread/668952

@patlux
Copy link

patlux commented Nov 4, 2021

Just provide a sdk version of iOS to codesigndoc and it will work:

./codesigndoc scan xcode --xcodebuild-sdk "iphoneos15.0"

Complete:

curl -fL https://github.com/bitrise-io/codesigndoc/releases/download/2.4.3/codesigndoc-Darwin-x86_64 > codesigndoc
chmod +x codesigndoc
./codesigndoc scan xcode --xcodebuild-sdk "iphoneos15.0"

Worked on my Mac Mini M1

@mbuchetics
Copy link

Anyone from Bitrise still working on this?

@Kalzem
Copy link

Kalzem commented Dec 5, 2021

Still having the problem

@bilaldurnagolmomentup
Copy link

same problem

@Hustenbonbon
Copy link

Thx @patlux, your fix works! Pinging some high contributors, maybe that gets this attention and they can fix it easily:
@viktorbenei @BirmacherAkos @godrei : The one-liner from workflow/codesigning doesn't work because of this issue, many users may not ever see this workaround, could you fix it?

@sushant-here
Copy link

@patlux - that seems to work! Bitrise - This should be done automatically.

@Roland-Bak
Copy link

Hello there 👋

Thank you for the workaround, @patlux!
I forwarded it to our developers so they can work on implementing this in the step 🙂

@shams-ahmed
Copy link
Contributor

Release 2.4.4 resolves issues with M1 as well as adds additional options for -sdk and -destination :
-sdk: If a value is specified for this flag it'll be passed to xcodebuild as the value of the -sdk flag. For more info about the values please see xcodebuild's -sdk flag docs. Example value: iphoneos")

-destination: The xcodebuild -destination option takes as its argument a destination specifier describing the device (or devices) to use as a destination i.e generic/platform=iOS.

See release notes for instructions. Some M1 machines do not have certain folders so you may need to use a custom folder to run curl script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests