Not able to deploy flutter application to iOS Appstore - ios

While Building the app for iOS Distribution in flutter I faced the below issue with the build, I tried many things available on google related to this issue but no resolution yet.
How am I supposed to deploy flutter application to iOS Appstore?
Warning: unable to build chain to self-signed root for signer "iPhone Distribution: Mark Davids (*********)"
/Users/mark/Downloads/chat_app-master 2/build/ios/Release-iphoneos/Runner.app/Frameworks/App.framework/App: errSecInternalComponent
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Encountered error while building for device.

This is a vague error, however my guess is its 1 of two things.
There is Flutter detritus that is blocking your build, which you can fix by running the flutter clean command
Your certificate is invalid. When dealing with this in the past I have found the easiest way to fix it is to open XCode, set the signing to none, purge your certificates and keys from your system, and then re-add them to the keychain.

Related

Flutter unable to build IOS archive

i am trying to build a IOS IPA for generic device, followed all the instructions, added signing certificates, team etc. but i am unable to build the product. any one please help me to resolve this issue.
here is my signing config. checked to automatically managed. added device in developer site.
sent 435785657 bytes received 92 bytes 58104766.53 bytes/sec
total size is 435732165 speedup is 1.00
Warning: unable to build chain to self-signed root for signer "Apple Development: ********"
/Users/Saif/Library/Developer/Xcode/DerivedData/Runner-bemaxobcrmqabgcgltuauohrwrje/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/myapp.app/Frameworks/App.framework/App: errSecInternalComponent
Command PhaseScriptExecution failed with a nonzero exit code
i am just stuck on this error for about 3 days. tried each and every solution available on stackoverflow and apple developer stack.
Flutter : 2.0.1
Xcode : 11.2.1
There's nothing any issue i think, the reason behind this i have an old version of xcode, i just update the xcode for newest version and than its all fine.
Run flutter build ipa
Once build is done. Open Runner.xcarchive
Open Runner.xcarchive with Xcode
It'll take you to the Distribute App page so you can upload the app
As per the docs:
https://docs.flutter.dev/deployment/ios#create-a-build-archive-with-xcode

I think I have done necessary code signing work but build still failing in Ionic

Building an Ionic app to try and test on my iPhone. I downloaded XCode last night and went in and created a profile with my Apple ID, as well as changing the bundle identified in the "General" and "Signing & Capabilities" tab. However when I run "ionic cordova build ios --prod" I get the error:
error: No profiles for 'io.ionic.starter' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'io.ionic.starter'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'MyApp' from project 'MyApp')
** ARCHIVE FAILED **
xcodebuild: Command failed with exit code 65
[ERROR] An error occurred while running subprocess cordova.
cordova build ios exited with exit code 65.
Re-running this command with the --verbose flag may provide more information.
It seems to me as though I have done the necessary code signing procedures that I read from Ionic's website, so I am unsure why it still isn't working.
To run the app in your iPhone there are several steps, check these:
You have created your app ID in the website.
You have created your provisioning profile in the website, and downloaded to your computer and added to your Mac (web -> download profile -> double-click)
You have created a development certificate (search how to create a certificate using a Certificate Signing Request generated in your Mac ) and then downloaded that certificate and added to your Mac.
There are two certificates. Distribution certificate is used to publish the app, but development certificate is used simply to run the project in your iPhone, you need that.
But honestly, it's all much easier if you use XCode instead of the console. In the console run the command without --prod, to apply ionic changes to the iOS project. Then if you want to run the app, it's easier if you open XCode and just click play.
With XCode there's the option "Automatically manage signing" that will handle most of this for you automatically. You just have to login to your account using XCode (it will prompt you) and let it do it for you.

How to resolve error of "errSecInternalComponent" while building archive for appstore?

I am trying to submit flutter app to Appstore. Here are the steps I followed:
Deleted all certificates and provisioning profiles
Create/Add IOS Distribution Certificate
Create IOS Provisioning Profile
Add IOS Provisioning Profile
Clean App
Build Then Run App
Set Codesigning and Provisioning Profile In Build Settings
Lots of Googling > to no successes
Basically, facing the error of "errSecInternalComponent"
Here is the error I get:
Warning: unable to build chain to self-signed root for signer "iPhone Distribution: Johnny (**********)"
/Users/johnny/Downloads/chat_app-master 2/build/ios/Release-iphoneos/Runner.app/Frameworks/App.framework/App: errSecInternalComponent
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
You are having an issue with a certificate, that's why you get this warning. You need to generate a new one.
Try this:
xcode -> preferences -> accounts -> select the account -> manage certificate -> click on the (+) icon in the bottom left side of the popup window -> ios development
Build the first time with Xcode, Xcode will ask you to update the keychain, click on always allow.
After that, your command line build will work.
For me the following worked - even from a ssh session:
security unlock-keychain -p "<my password>"
Since the issue is already resolved, this might not be the answer to you.
However, I would like to share this with the community as I stumbled upon the same error message with another setup.
I have been building an iOS App with Xcode on a MacMini used as gitlab runner.
Building the app manually worked, but whenever I pushed to the repository and the automated build started, this error appeared.
Updating the ruby version to a higher version than BigSur's shipped one and reinstalling the gitlab-runner resolved my issue.

swift-stdlib-tool failed with exit code 1

I have a problem with XCode since 2 days.
I upgraded my iOS Developer Account, and now I can't build on my iphone.
I have this when I try to build.
/Users/RpX/Library/Developer/Xcode/DerivedData/Moukat-amxiyucfcmxblndkiauwhwnscwhx/Build/Products/Debug-iphoneos/Moukat.app/Frameworks/libswiftCore.dylib: the codesign_allocate helper tool cannot be found or used
*** error: Couldn't codesign /Users/RpX/Library/Developer/Xcode/DerivedData/Moukat-amxiyucfcmxblndkiauwhwnscwhx/Build/Products/Debug-iphoneos/Moukat.app/Frameworks/libswiftCore.dylib: codesign failed with exit code 1
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-stdlib-tool failed with exit code 1
I tried all solutions on Stackoverflow about certificats, build settings, etc ..., it doesn't work.
If someone know something about it =).
Thank you.
My advice would be to delete everything related to development and distribution certification - all relevant certificates in the keychain, all mobile provisions on disk, and everything at the Member Center - and start the entire process of generating new identities and profiles from scratch.
I upgraded also my iOS Developer Account, and I got the same error in all my Apps when I tried to run them on my Ipad (IOS 11)
This works for me ( I did the samme in all the programs)
choose TARGET
General/Signing : Automatically manage signing
General/Deployment info/Deployment target: change to a lower IOS (I chose 10.0)
General/Deployment info/Deployment info/Devices : Universal
Build cmd B and Run cmd R with destination (your device)
After the error is disappeared: change the Deployment target to IOS 11 and the Device to iPhone/iPad

Do I need iPhone Developer license to run cordova/phonegap in ios simulator?

I don't have an iPhone developer license.
It was working fine when I execute "cordova run ios"
Then I created a new project using "cordova create test_app"
When I run "cordova run ios", it throws this error.
Then the project that used to work is also failing with the same error?
Check dependencies
Code Sign error: No matching codesigning identity found: No codesigning identities (i.e. certificate and private key pairs) matching “iPhone Developer” were found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.1'
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Error: /Users/Anthony/dev/test_app/platforms/ios/cordova/run: Command failed with exit code 65
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/src/superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
Be sure to have no device connected to the Mac else phonegap will try to build and deploy your app on it. I had the issue with my iPhone plugged in.
Also in Xcode be sure that you build the debug release with command line tools (in the info tab of project properties)
I would suggest you to go over the solution in this thread - which tells you how to disabling Code Signing. Anyway, no harm in checking this -
Verify that the Code Signing section's Code Signing Identity within the project settings is set to None -
Search for Code Signing in Target of your app, and check if Don't Code Sign is chosen.
Ey
One thing is to play with XCode and Cordova to make a new project and learn how phonegap or another wrapper works and a different thing is to publish an application. Following the apple specifications, you can always create a new application and test it in the simulator. The benefits of becoming an apple developer are you can try your applications in a physical device but it doesnt mean you cant create an application and try it in the simulator.
If you have tried to run the application in a real device, XCode will complain about the required credentials because you are not an apple developer and you dont have your certificate installed in the keychain so the application cant be signed for deployment on a real device.
If you want to test the application in a device "Yes" you need to become an apple developer and pay the fee, if not, dont worry you can run as many applications as you want in the simulator.
Check the settings of your project as well to see if there is something wrong.

Resources