I can't find Signing & Capabilies editor in Xcode - ios

I created an xcode dylib project using cmake & c++ linux project.
Then, I changed the code to make the build successful on iOS.
However, at the end of build, the following message is displayed.
I know how to fix this. However, the Tap (Signing & Capabilies) does not exist in my Project.
I will share my Build Setting. Please share a solution to this problem.
General Tap
Build Error Message
Build Settings 1
Build Settings 2

I succeeded in compiling after adding 2 options below.
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER

Related

Classes not found when archiving SwiftUI app

I have been working on a 100% SwiftUI app and am fairly into the project.
The project compiles and builds without issues when running on both simulator and device.
However if I try to compile the project I get a bunch of errors stating certain classes cannot be found across the project.
2 of these are CoreData auto generated classes.
1 is a global struct called Globals.swift
Has anyone else encountered this issue with Xcode 12.4?
You have probably changed some architecture settings
Try
Click target next to stop button
Select Edit Scheme
Select Run on the left
Select Info (top center)
Change Build Configuration from Debug to Release
Then build your project as you have been on a Device
If you get the same error you know something is going on between DEBUG and RELEASE builds.
Make a new project and compare the "Build Settings" of your current target and the "Build Settings" of you new empty project.
Pay attention to the ones that have DEBUG and RELEASE options such as
Architectures > Build Active Architectures Only
And anything else you might have changed because of a pod or other dependency.

Xcode - Bundle format unrecognized, invalid, or unsuitable

Ok so I have just about managed to get to this point on my own but am now having some issues code signing the app specifically with the AdMob framework. I am getting this error:
Command /usr/bin/codesign failed with exit code 1 the details it are giving are as follows: Applications/MyApp.app/Frameworks/GoogleMobileAds.framework: bundle format unrecognized, invalid, or unsuitable
I have read the other posts on the site and tried many different ways of fixing this. If I untick 'Code Sign On Copy' the archive builds successfully but then fails on validation with a match error. This is how I have my frameworks set up currently:
Any help would be much appreciated!
I saw this same issue with a different framework.
The solution for me was removing the framework from the 'Embedded Binaries' section and only adding it to the 'Linked Frameworks and Libraries' section in the target 'General' tab.
I have just seen the same issue but with a different framework that was the social framework and then I did below:
go to build phase -> embed frameworks -> press copy only when installing check box
then it worked with me with no error
I had a similar problem but with a different framework. The solution for me was to make sure that the framework was present in these three places:
General tab:
Embedded Binaries
Linked Frameworks and Libraries
Build Phases tab:
Embed Frameworks
I ran into this issue when using a different framework.
Clear the DerivedData solve this issue.
https://docs.sentiance.com/sdk/troubleshooting/ios/bundle-format-unrecognized-invalid-or-unsuitable
Go to Xcode menu bar and select File > Project Settings (or Workspace Settings).
Under Per-User Workspace Settings, find the shortcut to DerivedData folder and open it via Finder.
Remove the entire content of the folder and empty the Trash.
Restart Xcode.
In Xcode 11.*
Target -> General -> Linked Frameworks and Libraries
change related framework with option "Do Not Embed"
Else Check on the :
Target -> Build Phase -> Link Binary With Libraries
Check status with Required/Optional - try it with required first.

Xcode project scheme is not currently configured for the test action

I am trying to run an Xcode unit test for my iOS application. I am willing to do it on an iPad connected via USB to a Mac. I am trying to run the test from the command line in order to trigger it from Jenkins later on.
Below is what I'm currently typing into the command line and the error I'm getting. Please help.
The code:
xcodebuild test -scheme MyApplication -destination "platform=iOS,name=iPad"
The error:
Scheme MyApplication is not currently configured for the test action
For me the problem was that no tests were added to my scheme:
By adding test bundles to my scheme via the '+' button then the scheme could be built by Xcode and xcodebuild.
For everyone struggling with this problem.
My solution was to:
Select Test Target
Manage Scheme
Select Run in the left menu
Select Info in the tab
Choose Executable Target from the dropdown menu
Hit Close.
Fixed this up by removing duplicate schemes from Xcode. The schemes can be added/removed/shared/edited in Xcode via Product -> Scheme -> Manage Schemes.
Please follow following steps to resolve this error.
Select your project scheme at the top.
Click on Manage Schemes.
Select your test target in the popup.
Make sure to click on Edit button at the bottom left of popup.
Select Build.
Click the checkbox below "Run"
Close the popup.
You should check your workspace data on Jenkins and see which *.xctest is already uploaded. Then you have to rename your UI/Unit test target to that *.xctest data in your xcode project like what you
have on Jenkins and then push again.
OR wipe out your workspace from Jenkins and push all data again with new UI/Unit test target again.
(Of course you have to ensure that you have already made a scheme for project.)
In my case I had no test file...
Here is a tutorial to perform UI Tests and create screenshots :
https://krausefx.com/blog/run-xcode-7-ui-tests-from-the-command-line
My problem was that the Tests.swift file was importing a module that no longer existed (I renamed the Targets for the project). Check to make sure all test files are importing currently existing modules.
I was getting this similar error, but none of the other solutions helped. Since the error was first noticed while running via Fastlane, I next ran xcodebuild manually using this command to mimic the same.
xcodebuild -workspace Noname.xcworkspace -scheme Noname -enableCodeCoverage YES build-for-testing
I then saw errors regarding: Signing for "Noname-Dependency" requires a development team.
I also so reference to a macosx signing error, which I cannot sadly reproduce having since fixed the issue.
To fix the issue, under Signing & Capabilities for the Target I selected None and then under General I unchecked Mac, as we are not needing/using that but it was selected by default when creating this new project (CocoaPod).
Oddly enough, I added back Mac and things still kept working. I think that there is a oddity with the Xcode project file and/or scheme file(s) such that when you tinker enough with it -- things get reset/fixed.
I had a test plan set up (xctestplan).
I needed a separate configuration for the tests (the test plan) in addition to "Shared Settings".
Please also make sure that the test plan (under Xcode scheme settings) includes a test target AND a configuration.
Screenshots attached:
In my case, it was failing intermittently with this error, turns out I had two schemes with the same name and Xcode sometimes picked the wrong one, so make sure you do xcodebuild -workspace "MyWorkspace.xcworkspace" -list to see all your schemes and find out if you have repeating names.
Your test plan should have at least one custom configuration.
Go to Manage Schemes.
Delete all schemes and click on Autocreate Schemes.

dyld: Library not loaded: #rpath/libswiftCore.dylib / Image not found

I am running my app from xcode to my iOS device and I get this and black screen on iOS device.
Console text:
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/10DB2FE8-EF09-4857-B4AC-0DB2E4419D6F/App-Name.app/App-Name
Reason: image not found
(lldb)
Try adding the following line to Runpath Search Paths of your target.
#executable_path/Frameworks
your_target -> Build Settings -> Linking -> Runpath Search Paths
I had this same issue. I ended up adding the framework in the following locations:
General > Embedded Binaries
General > Linked Frameworks and Libraries
Build Phases > Link Binaries with Libraries
The embedded binaries seemed to be the key for me.
For me helps adding #executable_path/Frameworks to the project Runpath Search Paths, not target.
your_project -> Build Settings -> Linking -> Runpath Search Paths
None of the other solutions helped me, but everything was fixed by deleting Xcode's Derived Data directory.
Oh yes. I've faced with that problem spending hours on solution.
You may try to set "Always Embed Swift Standard Libraries" to "Yes" under your Build Settings > Build Options
(don't forget to shift+cmd+K your project after)
I had to switch 'Embedded Content Contains Swift Code' to 'Yes' to get my Obj-C app to work after updating the Obj-C embedded framework with a Swift object.
In the Framework Target (not the app target), go to Build Settings > Build Options > Always Embed Standard Swift Libraries to YES.
This solved the issue for me!
I had this error in a command line project (Xcode 10.2 and macOS 10.14.3)
The solution was to update to macOS 10.14.4
Swift command line projects won’t run on macOS 10.14.3 and earlier unless you install the Swift 5 Runtime Support for Command Line Tools package. Without that package, Swift command line projects crash on launch with “dyld: Library not loaded” errors. (46824656)
From Swift 5 Release Notes for Xcode 10.2
In my case, This issue is coming in Objective-c project in which I am using a Swift framework (AirWatch SDK).
Solutions:
I have resolved this issue with Xcode 9.3 and 11.0.1 iOS as mentioned bellow steps :
Drag and drop your swift framework in your project and move in default Framework folder of your project.
Then add them as Embedded binaries as shown in screenshot.
Change your framework status from Required to Optional as shown in screenshot. (Build Phases > Link Binary with Library)
Set Always Embed Swift Standard Libraries to Yes in your build settings.
Set Subpath and select destination as Framework for your added framework in Build Phases> Embed frameworks
as shown in screenshot.
Hope it will help someone.
I have faced the same issue, setting the right code sign identity solved the problem(Build settings->Code Signing Identity).
As per Apple technical questions "All Enterprise and standard iOS developer certificates that are created after iOS 8 was released have the new Team ID field in the proper place to allow Swift language apps to run"
I fixed by deleting all from Xcode Derived Data directory:
~/Library/Developer/Xcode/DerivedData
Good luck all!
This error message can also occur when using a framework build in a different Swift version then the one currently being used, e.g. if you upgrade Xcode.
I had the same error message, that is how I solved it :
The issue came from the certificates generated automatically by Xcode. I had to revoke these certificates dans generate them back from developer.apple.com
The solution is then :
- Go to developer.apple.com / certificates --> Revoke certificates
OR go in Xcode > preferences > accounts > View details > select Sigining identities > clic setting whell > revoke
- Got to developper.apple.com and follow instructions to generate new certificates
- In Xcode in my project : go to Code Signing Identity and sign both Debug lines with the generated certificate
- Both release lines are set to "iOS Developer"
- Then project > clean
- Build and run on device
#Saikiran's answered worked.
My certificates were generated before iOS 8 was released. I revoked all my certificates and regenerated all provisioning profiles and it solved my problems immediately.
I don't have enough reputation to vote up #Saikiran's answer, but that definitely helped solving the problem.
For me has worked set the option
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
to YES in Project -> Build Settings -> Build Options
(Namirial framework through Cocoapods)
None of the above solutions worked for me. I changed the iPhone Developer Certificate trust settings in Keychain. It should be Always Trust. Change it to Use System Defaults. Double click the certificate in Keychain to open the option screen
Discovered that from this blog
I had the same error message, this is how I solved it :
This is happening because i changed bundle identifier, so i just put old bundle id and it started to work again
I already had the Runpath Search Paths set correctly, but it still didn't work. #Justin Domnitz's answer put me on the right track: Setting "Always Embed Swift Standard Libraries" to Yes in my target's build settings did the trick for me.
Seems this issue was caused by the inclusion of Swift file into objective-c custom framework. Also unsure if related but my app target was built in objective-c as well. Also building to simulator in debug. Haven't verified for release or archive build yet.
Additionally Runpath Search Settings for the project target were set to "#executable_path/Frameworks", within the target settings for the framework they were set to: "#executable_path/Frameworks" and "#loader_path/Frameworks".
After having tried rebuilding custom framework and reattaching to app target, clearing derived data folder and a couple other suggestions, what ultimately worked for me was changing the build setting within Project target for the custom framework project (not app target): "Always Embed Swift Standard Libraries" to "YES". It appeared not to matter what the setting for the app target was set to. I verified this by resetting the simulator and rebuilding. This is similar to Daniele Ceglia's answer but I wasn't able to add a comment and wanted to provide more clarity.
For me Cleaning the project solve the issue!
I got such issue, too
All other ways could not help me,
so I have done it on stupid way
created new project and pod install from scratch
and after confirmed it is working correctly, I copied all class files and storyboard files, at last done!
I think it is the last way for it, maybe could help you
I had a similar problem in an Objective-C project where I started to include Swift files.
In my case, I created two targets in the main project, and I added a Swift empty file, that creates a bridging header file and some configurations, but I only marked it as a member of one target. The first target works properly, but the second not, and I noticed that the differences in build settings were this setting:
Runpath Search Paths -> $(inherited) and #executable_path/Frameworks
And I also needed to reference Objective-C Bridging Header to the file that was created before:
Objective-C Bridging Header -> pathTo/Target-Bridging-Header.h
After adding this two settings, the second target started to work properly.
Try cleaning the build folder, I was having the same problem and I solved it this way:
Product -> Clean Build Folder
For Me restart simulator solved this problem.
I tried a bunch of the cases above and it didn't seem to solve my issue. I use git and cocoapods for a project, and the error went away as soon as I made a new commit.
I had this problem before in iPod touch iOS 9.3. And I used all the methods mentioned in this post, but none of them worked.
I checked my project setting. And in the other link flag, I found I added -Wl,-sectcreate,__RESTRICT,__restrict,/dev/null.
This flag prevents dyld insert in the jailbroken phone. When I delete this flag, the app can be launched again. I am not sure why it worked. Because in iPhone se iOS 10 I don't have to delete this line. But it did work in iPod touch iOS 9.3. So check it if you have the same situation like me.
Please check the *.framework If there is a _CodeSignature signature framework directory.
If there is no _CodeSignature folder,
Navigate to the Build Phases ,click + to add New Copy File Phase to create Copy Files.
after that, reference *.framework and choose Code Sign On Copy

OSStatus Error -67028

For 2 days now I'm trying to upload a App through xcode to apple. But on every validation it shows following error:
It just came from no where. Even my older Archives that are already in the App Store show the same error when I try to validate them.
Any help would be very nice. Atm I can't push updates..
have you already tried the answer in this post?
OSStatus error -67028 When Building Ad Hoc iOS App
ensure that the Main_iPhone.storyboard file is indeed in the compiled bundle. If not, check your "copy files" build phase to ensure it is there.
So I finally got it to work:
Click on your Project and switch between your Targets. There's a Project Target and a Target with the App Icon.
On Every Targets go to Build Settings and choose your Provisioning Profile and Code Signing Certificates.
Check under Build Phases -> Copy Bundle Resources if there is a Framework in there that belongs to the Library Phase.
Before all that I updated to the newest beta of Yosemite (not needed if you don't have it) and made a clean Project. Please check all these steps!
Hope it helps others!

Resources