Codesign error with Flutter on iOS - ios

So I have been trying to get into Flutter recently and I am having issues. When I create a new project and do flutter run it works just fine. If I completely close the application and re-run the app I get this error every time.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/zachstarnes/Documents/code/test_proj/build/ios/Debug-iphonesimulator/Runner.app: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1
Could not build the application for the simulator.
Error launching application on iPhone X.
I have no idea how to fix this. I tried opening the xcode project file and signing the project to my organization and rerun but that still does not change the outcome. Any ideas of what I need to do to fix this?

So after a long time if finally figured out how to fix it.
The way I was able to fix is to delete the build directory in the root of your flutter project. The folder just gets rebuilt without the files causing the problem.
I assume it has something to do with forking the fonts/images I was adding to the project.
Edit (6/4/2019) You can also use flutter clean and it will also solve the issue. Stated by #Luke Stanyer below!

Run
flutter clean
in your command line.

For sure flutter clean helps, however, in my case, it was all about setting the Deployment Target to 9.0
Remember to also enable (uncomment or add) this line platform :ios, '9.0' at the top of your ios/Podfile file as long as you don't care about iOS versions below 9.0

There can be multiple reasons for this codesign failure.
Go to
Keychain Access -> Apple Worldwide Developer Relations Certificate Authority certificate -> Get Info -> (expand) Trust settings
Then for the combo box for "When using this certificate:" make it System Defaults

I had this problem and this is what worked for me.
First off, let's just state the obvious, XCode was written to be the IDE version of the Tardis or maybe the Luggage from Terry Pratchett's Discworld series. It's bigger on the inside than it is on the outside and every time you open it you'll be shown something different.
Now, the root problem for me was that my Apple Developer sign in for my project needed to be refreshed. This is how I did that:
Open your Flutter project in XCode.
On top of the left panel there are some icons. One of them looks like a folder. If you hover over it, it will say "Show the Project navigator". Click that.
On left panel below those icons select Runner (should be at the top of a list). This will populate the center panel.
In the center panel, along the left-hand side, you should see a column with Project/Runner and Target/Runner. Select the Runner under Target. This will change the contents in the center panel right-hand side.
Across the top you should now see the following options: General, Signing & Capabilities, Resource Tags, Info, Build Settings, Build Phases, and Build Rules. Select Signing & Capabilities.
If you had the same problem as I had, you will now see prompt in the middle panel section asking you to sign in again and there will be a sign in button right there in the middle of the panel. Click it, sign in with your Apple Developer password.
Now build your project again. You may be prompted by macos to login to grant keychain permissions during the build.
Hopefully this will help some other people.

I have the exact same issue. I've tried multiple IDEs, messing with certificates in Xcode, even reinstalling my operating system (since other people that I work with in the same repository have no issues of this kind).
flutter clean
works for me, but only as a temporary fix.

For those who failed and scrolled till this answer, try to download and install the latest certificate from this link: https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer
Before installing this updated certificate delete below certificate from keychain
Apple Worldwide Developer Relations Certification Authority

Related

An empty identity is not valid when signing a binary for the product type 'Application' in xcode version 10.2

I have compile webrtc ios source code ,then I used the command:
gn gen out/ios --args='target_os="ios" target_cpu="arm64"' --ide=xcode
then I open the workspace with Xcode.
but when I compile the code, Xcode gives me this error below.
An empty identity is not valid when signing a binary for the product type 'Application'. (in target 'AppRTCMobile')
my Xcode version is 10.2, the latest version.
I really don't know how did this happen,can anyone can help me?
my code sign setting is:
everything looks ok.
I added CODE_SIGNING_ALLOWED=NO as an additional parameter and that fixed this issue for me.
I needed to to turn OFF Automatic manage signing and turn it ON afterwards. It seems like Xcode did fix some inconsistency by that action.
I saw this error in Xcode 12.2b when building to run on a device, but I had not set signing to Automatic, or selected profiles, etc.
Basically I was running and testing on the simulator, then plugged in a device for testing and forgot to change any signing settings.
Perhaps this error is new to Xcode 12.x for that scenario.
If you're using CocoaPods check your project.pbxproj for (null) references, there's an issue that make BuildFile references to become (null)
Even if you have the identity correctly defined it may be "empty" because of this issue
Try, as suggested:
pod deintegrate
pod install
This error can occur when an Xcode project is generated (rather than built from within xcode), and the generated output project is unexpectedly in release mode.
I was working on a Godot project and got the above error which led me to this post. The error is not WebRTC or Godot specific.
If you only want to debug the project for now on a device, and don't need release builds yet, switch to a debug scheme using the scheme switcher (1)
If the generator didn't create a debug scheme, (which is the case for me for my issue) you can add one via New Scheme (2)
At first I could not work out why it was complaining about "empty identity" (this refers to the Team drop down) when as per the screen shot I had this value set. I had the project view filter settings on Debug (as per the screenshot (3) so the Release settings (where Team was set to "None") were not showing up. Change this to All to see if that is where the None in the error is coming from for you.
Debug builds only require a basic signing setup. If you still have issues with Release builds when it comes time for that, you may need to clear out certificates & provisioning profiles from your Derived Data, Apple Developer portal and Keychain.
Release build certificates are hard to manage & replace so be careful with randomly generating & deleting them.
The problem has been fixed, it's my mistake.
Select the target, then choose info.plist and select the one for your project.

Increase timeout when launching iOS app on device from Xcode [duplicate]

I am trying to launch my app on device. It is launching successfully on the simulator.
List item
I use 7.1 SDK
Xcode 5
And the device is a 7.1 iPhone 4S
I have tried:
Clean
Clean Build Folder
Deleting app
Disconnecting/Reconnecting device
Booting device
restarting Xcode
What can I do to make it work?
Could it be something with Code Signing?
Currently i have it set to 'Dont Code Sign'
I had this problem when I used a Distribution certificate instead of Developer one when running the app from Xcode. You may check it out your target --> Build Settings --> Code signing.
As #AndyDynn pointed out in his comment:
Make sure you do this on the "Target" build settings and not just the "Project" build settings.
I literally restarted my iPad, that was connected for testing the app, and that resolved the issue.
To run your app on a device, you will perform these tasks that follow:
Request a development certificate.
Add your device to the portal.
Code sign your app.
Launch your app on the device.
For more detail check this
If your provisioning profile and code sign everything is alright then try once Quit and Restart your XCode. It will work for me.
I just had this issue.
I had to open the app on device and tap Trust Computer.
No need for me to reboot everything 20 times, yay.
Below are 2 awesome hacks that have not been mentioned yet:
HACK #1:
Lock your phone, press XCode start, wait till XCode says "unlock your device to launch", then unlock your phone, it will be launched successfully, works every time.
HACK #2:
If your goal is just to debug the app, here is another simple and straight-forward approach:
After the app is deployed, launch it manually.
Goto XCode -> Debug -> Attach to Process ... to choose your app from the list, then debug properly.
This works well for me, and it saves lots of time.
I hope this helps, thanks!
I got the same problem and after looking at the answers here I found mine. The issue at hand was: my dev distribution certificate was gone from iOS Dev Center, so I just assume it had timed out. I didn't get a nice warning though, just the above error - installing worked but debugging didn't. So I had Xcode regenerate a new one for me.
One more thing to try if you've tried the above:
i found this link about quitting itunes to avoid the timeout. This works for me with xcode 5.1
In my case there was no value at Targets -> Build Settins ->Provisioning Profile. Though Code Signing looked ok)
I cleaned out my provisional profiles, rebooted the iPhone, rebooted the computer, and it worked for me.
Just to throw out an additional suggestion to anyone coming across this problem (it's been burning me frequently lately) -- try going to the Targets -> (Your Target) -> General -> Team and re-selecting the same Team, which forces Xcode to update profiles for you.
That has been the culprit for me a couple of times. Seems to happen specifically if you've recently re-downloaded a distribution certificate for new devices or w/e. Or if you've just dumped your Provisioning Profiles directory in general.
I had the same problem and I tried all the suggested steps but I managed to get it deployed and run only after I powered off my iphone.
Checked my Targets and code signing details, didn't help. I did three things:
Clean Build Folder
Close Xcode and delete everything in Derived Data
Rebooted my device
Everything worked fine after that. I had changed some App Transport Security setting in my info.plist right before this occurred. Not sure if it is related or if only one of my 3 steps were necessary, but it worked.
Make sure the Provisioning Profile setting in your environment is set to your development profile: Project > Build Settings > Code Signing
Consider setting it in your Target settings and the Pod project (in case using Cocoa Pods).
In case the development profile is not present create or download it:
Certificates, Identifiers & Profiles > Provisioning Profiles
After following the above, it still didn't work (from xCode 6). But after rebooting the phone and deleting the app, it worked.
Check Product Name for dots "."
"." are not allowed in Product name.
Selection in provisioning profiles may cause this problem. So while launching an app on to the device, make sure you are using the development profile & not the distribution profile. I have been facing the same issue. But got away with it using the same process.
Check for Project > Build Settings > Provisioning profile & select your development profile.
And also take care of Code Signing Identity in the same tab. Make sure you choose both the identities of Developer & NOT of Distribution.
Below two steps solved for me:
For xcode version: 7.2
1.Select any of your simulator to run ( just start your run, no need to load the app completely).
2.Stop it.
3.Then select your device and run.
This solved in my case.
option + command + shift + k and then run the project did the trick for me.
If your goal is to just launch the app and debug it, you can also edit the schema to "Wait for executable to be launched" and run the app manually.
The setting is under Edit schema > Run > Info > Launch. Choose "Wait for executable to be launched" instead of "Automatically". It will wait for you to run the app (by manually tapping it) instead of timing out.
As all of the above answers didn't helped for me I'll publish my solution:
Deleting all the occurrences of xcuserdata folders in .xcodeproj and .xcworkspace and restarting Xcode fixed the problem. To delete it right click your_app_name.xcodeproj and/or your_app_name.xcworkspace in your app folder and select "Show Package Contents". I hope that help someone to save some time.
Just restart my Device and works everything fine
I tried:
Restart the device (iPhone)
Clean build the XCode project
Then it works.
Check whether the device memory is full.

CodeSign Error: Code signing is required for product type "Application"

Hey I'm trying to install a unsigned IPA on my jailbroken iPhone running iOS 8.1 but when I go to build it for my device (as done in this guide: http://www.sysrage.net/guides/ios-programming/building-and-running-ios-applications-without-a-paid-developer-license) I get the above error. I've set all the code signing things to not code sign but when I go to build I always get this error. I've done this in the past before (with the same guide) and I'm using the same project settings as I have in the past but nothing seems to work. Anyone have any ideas?
One way of installing your app on your jailbroken device is to use appcake from cydia.iphonecake.com repo. First have your app.ipa file handy. Second install appcake from cydia.iphonecake.com repo. Then Simply add Yourapp.ipa to var/mobile/Media/AppCake/Imported via ssh. Then navigate to the appcake application and go to the "Downloads" tab and then "Imported" tab on the top. You should see your application there. Press on it then press install. If you need more detailed instructions on how to ssh or extract the .ipa file from xcode let me know.

Could not launch process launch failed: timed out waiting for app to launch

I am trying to launch my app on device. It is launching successfully on the simulator.
List item
I use 7.1 SDK
Xcode 5
And the device is a 7.1 iPhone 4S
I have tried:
Clean
Clean Build Folder
Deleting app
Disconnecting/Reconnecting device
Booting device
restarting Xcode
What can I do to make it work?
Could it be something with Code Signing?
Currently i have it set to 'Dont Code Sign'
I had this problem when I used a Distribution certificate instead of Developer one when running the app from Xcode. You may check it out your target --> Build Settings --> Code signing.
As #AndyDynn pointed out in his comment:
Make sure you do this on the "Target" build settings and not just the "Project" build settings.
I literally restarted my iPad, that was connected for testing the app, and that resolved the issue.
To run your app on a device, you will perform these tasks that follow:
Request a development certificate.
Add your device to the portal.
Code sign your app.
Launch your app on the device.
For more detail check this
If your provisioning profile and code sign everything is alright then try once Quit and Restart your XCode. It will work for me.
I just had this issue.
I had to open the app on device and tap Trust Computer.
No need for me to reboot everything 20 times, yay.
Below are 2 awesome hacks that have not been mentioned yet:
HACK #1:
Lock your phone, press XCode start, wait till XCode says "unlock your device to launch", then unlock your phone, it will be launched successfully, works every time.
HACK #2:
If your goal is just to debug the app, here is another simple and straight-forward approach:
After the app is deployed, launch it manually.
Goto XCode -> Debug -> Attach to Process ... to choose your app from the list, then debug properly.
This works well for me, and it saves lots of time.
I hope this helps, thanks!
I got the same problem and after looking at the answers here I found mine. The issue at hand was: my dev distribution certificate was gone from iOS Dev Center, so I just assume it had timed out. I didn't get a nice warning though, just the above error - installing worked but debugging didn't. So I had Xcode regenerate a new one for me.
One more thing to try if you've tried the above:
i found this link about quitting itunes to avoid the timeout. This works for me with xcode 5.1
In my case there was no value at Targets -> Build Settins ->Provisioning Profile. Though Code Signing looked ok)
I cleaned out my provisional profiles, rebooted the iPhone, rebooted the computer, and it worked for me.
Just to throw out an additional suggestion to anyone coming across this problem (it's been burning me frequently lately) -- try going to the Targets -> (Your Target) -> General -> Team and re-selecting the same Team, which forces Xcode to update profiles for you.
That has been the culprit for me a couple of times. Seems to happen specifically if you've recently re-downloaded a distribution certificate for new devices or w/e. Or if you've just dumped your Provisioning Profiles directory in general.
I had the same problem and I tried all the suggested steps but I managed to get it deployed and run only after I powered off my iphone.
Checked my Targets and code signing details, didn't help. I did three things:
Clean Build Folder
Close Xcode and delete everything in Derived Data
Rebooted my device
Everything worked fine after that. I had changed some App Transport Security setting in my info.plist right before this occurred. Not sure if it is related or if only one of my 3 steps were necessary, but it worked.
Make sure the Provisioning Profile setting in your environment is set to your development profile: Project > Build Settings > Code Signing
Consider setting it in your Target settings and the Pod project (in case using Cocoa Pods).
In case the development profile is not present create or download it:
Certificates, Identifiers & Profiles > Provisioning Profiles
After following the above, it still didn't work (from xCode 6). But after rebooting the phone and deleting the app, it worked.
Check Product Name for dots "."
"." are not allowed in Product name.
Selection in provisioning profiles may cause this problem. So while launching an app on to the device, make sure you are using the development profile & not the distribution profile. I have been facing the same issue. But got away with it using the same process.
Check for Project > Build Settings > Provisioning profile & select your development profile.
And also take care of Code Signing Identity in the same tab. Make sure you choose both the identities of Developer & NOT of Distribution.
Below two steps solved for me:
For xcode version: 7.2
1.Select any of your simulator to run ( just start your run, no need to load the app completely).
2.Stop it.
3.Then select your device and run.
This solved in my case.
option + command + shift + k and then run the project did the trick for me.
If your goal is to just launch the app and debug it, you can also edit the schema to "Wait for executable to be launched" and run the app manually.
The setting is under Edit schema > Run > Info > Launch. Choose "Wait for executable to be launched" instead of "Automatically". It will wait for you to run the app (by manually tapping it) instead of timing out.
As all of the above answers didn't helped for me I'll publish my solution:
Deleting all the occurrences of xcuserdata folders in .xcodeproj and .xcworkspace and restarting Xcode fixed the problem. To delete it right click your_app_name.xcodeproj and/or your_app_name.xcworkspace in your app folder and select "Show Package Contents". I hope that help someone to save some time.
Just restart my Device and works everything fine
I tried:
Restart the device (iPhone)
Clean build the XCode project
Then it works.
Check whether the device memory is full.

No valid iPhone code signing keys found in keychain

So I downloaded to my Mac Pro the XCode 5 and Xamarin and created Single View Hello World application and excited to launch it through the simulator I run it and?
I got this error No valid iPhone code signing keys found in keychain.
Nice, I read all threads here and there, past and future but non of them helped as I just wanted to run it on the iOS simulator and not on the device.
I have realised that I cannot even switch to a different version of Simulator which are already on the laptop, the Simulator version 6 and 7 when I go to Run - Run With -> There is only Mono Soft Debugger for iPhone.
When I downloaded Tasky example project, this one is working fine and I can switch different types of Simulator.
Any advise which is not listed already on Interent or future networks?
It´s really simple, in the drop down (Solution Platforms) from the toolbar chose the right one, if you´re debugging in an iPhone/iPad chose that, if not change to simulator, the problem will go away, there´s no need for removing anything.
If you can't find the corresponding drop-down menu, check out this tutorial on how to make it visible. Once you can see the Solution Platforms combobox in the toolbar, you can select iPhoneSimulation and the problem will go away.
After two days of no sleep I found a solution for this particular problem, not sure if it is the best one but here you are, one of this should work:
1) Go to Project -> Solution Options -> Configurations
I have removed: Release|iPhone, Debug|iPhone and this is where it started working also for any other project.
2) Maybe before the step 1) just try to change in -> Configurations -> Configurations Mappings the platform from iPhone to iPhoneSimulator.
If this is not going to work, try 1)
I hope this is going to help some of you and save tons of time!!
Cheers
Today I had the same issue after Xamarin upgrade. I tried to run my application in the simulator. The solution was however different.
Please note that all the solutions mentioned here on this page from others might have been right in certain time or are right and works in certain circumstances.
Today's solution:
Go to Project -> "Name of your project" Options -> Build -> iOS Bundle Signing -> Custom Entitlements - remove Entitlements.plist from the textbox -> Click OK
Thanks
I have resetted my Mac Book pro keychain and I encounter this issue.
When that happens, go in XCode and ensure that you are properly logged on into your Apple ID. If so, you should see your development group, you may have to click Join once again.
Read the following post, it explains everything.
One more solution.
In Release configuration I successfully built my app, but in Debug - had the same issue, as in topic.
Go to your startup Project-> Options -> Build -> iOS Bundle Signing.
Then check your Signing Identity and Provisioning Profile for each Configuration Debug and Release.
In my case Release configuration was setup-ed correctly (several days ago by me) with values:
- Signing Identity: Developer(Automatic)
- Provisioning Profile: Automatic
But Debug configuration was silently corrupted somehow:
- Signing Identity: Unknown (Iphone Distribution: name of my company)
- Provisioning Profile: No matching profiles found
Thus, fix your Debug configuration to be equal with Release.
I am on MacOSX and I have encountered this issue on Xamarin Studio when debugging using Debug|iPhoneSimulation.
The error will just keep on repeating. What has worked for me was this link Answered by KMullins
This is due to an expired profile that was renewed.

Resources