-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Flutter build IPA with --export-options-plist not working #113977
Comments
@gkustas
Please see this StackOverflow answer for more details: https://stackoverflow.com/questions/64698820/ignoring-ffi-1-13-1-because-its-extensions-are-not-built-try-gem-pristine-ffi Also, the valid build command is:
Please see this as reference. |
As I mentioned in my post, the "flutter build ipa" command worked after manually setting the capabilities in the code workspace. I have a build script that runs "flutter create", copies source files from another project, and edits other files. Then it tries to run "flutter build ipa". So, the Ruby warnings are not the problem. They exist even when the "flutter build ipa" works after manually editing the workspace. Also - I entered the wrong command in my post. I tries "flutter build ios" later, but that didn't work either. Here is the command entered that produced the log I provided.
|
Also note: If you examine the verbose log output, and search for all occurrences of "xcodebuild" (the command that fails), you can see that it isn't using the export options:
The last one is the one that fails with this error:
|
@gkustas Thanks for providing more info. Labeling the issue for further insights from the team. |
After looking into this further, I know what is going on. I also have a proposal for the Flutter team that will allow me and others to create and build a Flutter application all from the command line. First, the explanation: "flutter build ipa" uses xcodebuild twice. The first time it creates the archive bundle like this:
Then it exports the ipa from the archive like this:
The problem is that the first time flutter calls xcodebuild, it expects that the workspace has already been configured for code signing. If you want to create and build entirely from the command line with no human intervention, you are out of luck. xcodebuild will fail with the error I posted above (No profiles for 'xxx' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'xxx'). MY PROPOSAL: flutter build ipa should accept additional code signing parameters and pass them on to xcodebuild. They match the build properties found in the code project file located in ios/Runner/Runner.xcodeproj/project.pbxprod
NOTE: These parameters are NOT documented in the xcodebuild -h help info, but they were added in XCode version 8. Read more about code signing changes in XCode here. My solution to the problem was to install a node plugin called cordova-node-xcode and use it to edit the workspace project config file located in ios/Runner/Runner.xcodeproj/project.pbxprod. I added the build properties specified above. I called "flutter build ipa", and everything was built and exported properly. I've included my nodejs code below in case anyone wants to use it. NOTE: the code also demonstrates how to obtain the code signing properties by extracting them from the actual mobile provision files.
|
Most of the iOS Flutter commands assume that you have either set up code signing in the Xcode project, or it will drop back to This is similar to #106612 but not quite the same, it should all build with
This is probably the right solution to both issues. |
Thank you @jmagman! I wish I knew this before I jumped through all of those hoops, but I guess I didn't scour the existing issues very well. :-) This is a much better solution than my proposal. |
We're working on making the iOS release process less painful, and require less Xcode spelunking. Thanks for your investigation! |
We have just spent days with @petrnymsa trying to get ipa signing to work propertly in our CI/CD pipeline. Our pipeline works similarly to the As @gkustas correctly says, everytime xcodebuild is called, it tries to do codesigning:
So either the codesigning on the specified project/target, or explicit code-signing parameters (CODE_SIGN_STYLE, PROVISIONING_PROFILE_SPECIFIER, etc.) must be properly configured, otherwise it fails. As it does for the OP. The specified The workaround we have found is to explicitly disable signing of the .xcarchive file when
The only signing that happens in the build process is then in the final step when .ipa file is created using |
Oh interesting that building the xcarchive with no codesigning and then re-codesigning during |
I agree that this is an absolute fool-proof way to do that, but it is more of a workaround than a solution of the root cause.
A friend pointed out to me that .ipa files can be resigned - e.g. you can have a pipeline that builds .ipa signed with App Distribution certificate and resign it as Ad-Hoc to avoid building the app twice. So the idea was that all previous signing during build must be irrelevant for the final .ipa and it really is. |
Thanks for the tip, that simplifies things. |
This comment was marked as duplicate.
This comment was marked as duplicate.
I have used similar approach where I make unsigned archive first via command line and then use fastlane "build_app" method to sign the archive. |
I was able to successfully export ipa file using manuual sign.
Anyway I could not find a way to export using flutter build ipa. |
Try this
ExportOptions.plist should look like this
|
For anyone still getting this in their GitHub actions |
I recently was able to fix this by
This way, i created the ipa in one shot! However, i am still figuring out how to include xcode live widget extension also. |
According to @jmagman #113977 (comment) I successfully built the ipa
Add these to environment variables (https://help.apple.com/xcode/mac/current/#/itcaec37c2a6) FLUTTER_XCODE_DEVELOPMENT_TEAM: your_dev_tem_id
FLUTTER_XCODE_PROVISIONING_PROFILE_SPECIFIER: prfile name or uuid
FLUTTER_XCODE_CODE_SIGN_IDENTITY: Certificate name or type(Apple Distribution) Build commands: |
I have a white-label app that needs to be built from the command line. I am using "flutter build IPA" with an export options list to specify code signing specifics. It appears that the values are not getting passed to xcodebuild and the build fails because it doesn't find the provisioning profile.
NOTE: if I open the XCode workspace and manually set the signing capabilities, flutter build IP works fine.
Steps to Reproduce
Logs
see attached for verbose output
flutterbuildipa.log
The text was updated successfully, but these errors were encountered: