Cocoapod issue not able to run on simulator - ios

I have created my cocoapod and cross check in sample project but it is showing everytime this error.
I googled and found solution
Reset content and setting
Clear derived data
Clean and build
Restart xcode
But non of them works
i tried on device

Make sure you are opening the newly created .workspace file rather than your original project.

Refer to this answer for debugging.
https://stackoverflow.com/a/26129829
Basically you need to look at ~/Library/logs/CoreSimulator/CoreSimulator.log for the source of the errors.
You need to consider the fact that the simulator is not linking files properly than any specific cocoapod issue.
Alternately, the problem could be related to code signing.
Refer : https://stackoverflow.com/a/17402788/2569560
If details like the Podspec and the simulator log were shared, perhaps we could be of more help.

Related

Xcode - Archive product goes to Other Items instead of iOS Apps

I am using XCode 11.2.1 and out of nowhere the archives for deployment appear in the Other Items category, instead of iOS Apps (in Organizer). I am using my custom static framework and what I found that this may be the issue, but for a while, like a month or so after I created and used my framework, I had no problems with deploy (I am also using CocoaPods, but that was ok).
I have tried a lot of things like here:
Xcode 10 Archives to 'Other Items' instead of 'MacOS Apps'
and it worked for a few times, but now, with multiple cleanings, deleting derived data, etc, nothing works.
Here there is a reference to header files (but I have never changed anything about them when it worked): https://developer.apple.com/library/archive/technotes/tn2215/_index.html#//apple_ref/doc/uid/DTS40011221-CH1-PROJ
The problem is that the help link about Copy files is not working and also (I cannot find "Copy files" section in Build phases - maybe it was renamed), the Xcode version is different (I found other posts on StackOverflow) so I cannot manage to make them work (I am pretty new to Xcode and C++ / Obj C / Swift and it is difficult to manage those options if I cannot really understand the references (or with missing help/explanations, which I don't know where to look for)
I used this to create and use my framework: https://www.raywenderlich.com/5109-creating-a-framework-for-ios (and different other links but very similar to this one)
Can someone please provide some help regarding the steps needed to make your app deployable to AppStore while using my custom framework? I can provide other information and screenshots if needed. Thank you.
EDIT:
Is there a way to check what is different between the creation of the last archive that worked and the new one that I cannot deploy?
After archiving my app I also exported it and explored it in Finder (as instructed here: stackoverflow.com/a/15120289/1215791) So there is no libraries folder. It seems that the problem is not related to forgetting set Skip Install to YES for something.
Check the contents of the .xcarchive, this happens when there's more than one item in Products/Applications. It should contain only your application.
After finding the extra items there, you can then know for which target you should set "Skip Install" to Yes.
This just started happening with Xcode 13.3.
Turns out that I was adding the DocC to the Products/Applications directory. I turned off the flag for compiling documentation ("Build Documentation during 'Build'"), and it started working again.

Build error Xcode 10 - Multiple commands produce

I just upgraded to Xcode 10, and I suddenly face this error when I try to build, any ideas how to fix it? I tried cleaning derived data, but without any luck.
If you use CocoaPods, click Xcode menu file -> Workspace Settings , And click Build system choice Legacy Build System
If you not use CocoaPods, same of top , select Project Settings
If your app is generating the error related to the multiple .app files just like mentioned above in question then removing the .plist files from "Copy bundle Resources" WILL NOT WORK.
If the error is related to .app file then follow the following steps.
Select the Target.
Go to Build Phases tab.
Remove the items listed in Output Files
Compile the code if it compiles successfully then not follow the next steps.
If code does not compile successfully and Xcode may give you an error related to "Library not found". Then add the missing library in General Tab in Linked Frameworks and Libraries that Xcode mentioned in the error.
Keep adding these libraries (that Xcode ask through compile errors) in Linked Frameworks and Libraries until the code compiles successfully.
Hope this helps.
You can try to change the build system to Legacy,
File > Workspace Settings > Build System > Legacy Build System.
I also faced this issue in xcode 10 but it was because of adding the same framework in main project + other extensions (watchkit or siri extension etc).
I added ObjectMapper in podfile for my main project + for my extensions. When I compiled it gave me an error that multiple command produce and also shows me which framework is causing this issue. Now its working fine for me as I've removed it from my extensions I wasn't using it in my extensions.
Don't know about your issue may be you can check your podfile.
If this is CoreData related. The issue is that you are trying to generate the NSManagedObject subclass but you need to set the 'CodeGen' option to Manual/None. This option is defaulted to Class definition and this would regenerate the code thus creating this issue.
i encountered this issue as well while working with CoreData.
in my .xcdatamodeld file, it came down to the fact that, during the creation of my various Entities, i had copy and pasted one multiple times (thinking i was saving time because various properties were similar enough that i thought this was a good idea).
the resulting Build error Xcode 10 - 'Multiple commands produce' occurred because i forgot to check and make sure the new Entities were set to their own unique corresponding class to match the new Entity in the Data Model Inspector pane.
unfortunately, it took me two days to figure out the original Entity's Class Name was still in place.
so lesson: careful when you copy/paste/duplicate Entities in CoreData.
(... i guess :0} )
some time saver. oops! hope this helps someone.
I had this same issue with Core Data entity class. I had forgotten to select Codegen Manual / None because I do not allow mine to be autogenerated. So I had a class in place and also it was trying to generate one.

‘Cloud/CLAPIEngine.h’ file not found

My application has been running fine with the Cloud-iOS.a library for the past few days. However, today, when I used the “Product > Clear Build Folder” command and tried to run the app again, it would give me this error:
‘Cloud/CLAPIEngine.h’ file not found
The Cloud library builds successfully, but the main project gives me that error along with 4 others in both the main project and the XCTest files (that are linked with this one).
I’ve tried removing and re-inserting the file from Build Phases > Headers and Build Phases > Compile Sources and that didn’t do anything (I also have tried to remove the -fno-objc-arc flag from the file to see if it would recognize it, and sure enough, it gave me an ARC error). I’ve tried looking through other SO questions like these:
Restkit/Restkit.h file not found Xcode 6.1
Adding frameworks to project in Xcode 5 and having *relative* paths added
... and nothing worked. I even tried restarting the app itself and nothing happened. I made a test project and included the same library to see if it’s my project, but this project also says the same errors. Both projects also have the file in the "include/" directory. I don’t know why this is happening and I’m starting to get really tired with Xcode’s random problems.
I’ve included the test project in a Dropbox link for others to check out and see why it’s doing this.
https://www.dropbox.com/sh/lu8hntaaww8y6r4/AAA1KJ085YvKjwMR-AZff6Nga?dl=0
What can I do to get this to run again? Thanks in advance.
(After this, I’m not running the “Clear Build Folder" command again.)
Ok. Looks like someone over at Apple Developer Forums was able to give me an answer. I chose the last one that they gave me, which was to change the static library into a framework. Thank goodness Apple made this available on iOS, because (after a bit of tweaking), everything works!

“The application does not have a valid signature” shows EVERY second time in XCode 5

I created new target for my app and every second time I compile it and try to run on the device, I get:
“The application does not have a valid signature”
...and app does not run.
I checked all similar posts in stackoverflow but none of the solutions helped me (cleaning project, etc...)
Under General -> Linked Frameworks and Libraries
Removing all the frameworks and relinking them was what worked for me.
I found people saying two different things that are supposed to solve this problem:
Delete all broken provisioning profiles.
Ensure there are no spaces in the name of the folder that you are building from (your Xcode project folder) -- this was what fixed it for me!
Just to add another possible cause:
In my case I had integrated SpeechKit (2.1.5) as a an embedded framework in an iOS Swift project and this somehow caused the error.
When I used Cocoa Pods the error didn't occur anymore.
Clean, deleted derived data, rebuild worked for me.

Build Failed No Reason Stated

When I build my application in the simulator mode, it works fine. But when I try and build it for the active target to be my iOS device I get a build failed with no explanation as to why?
Does anyone know what I need to do, it was working yesterday I have all my certificates and everything I don't understand.
Definitely check your bundle identifier. I accidentally put a * in there and got the Build Failed with no reason.
In my case, I had not linked a framework which I was using in the project.
With this information, I can just guess.
I was running in a similar problem and my problem was the bundle identifier in the Info.plist. I had a whitespace in the name and that's why it failed with "No Issues".
My current Bundle identifier is: com.mycompany.${PRODUCT_NAME:rfc1034identifier}.
I think the "rfc1034identifier" makes everything working fine.
Check the Resurces added into the project such as images,textfiles which was copied into Xcode project ,if the copied file's original source is deleted this can also have similar issue, i faced the same.
Note:Only the files copied as, Copy items into destination group folders's Unchecked while adding the file to Xcode.
In my case, I had a syntax error which did now show up in the panel. I was compiling within a workspace that contained two projects. When I opened both of them individually, the syntax error showed up and I could fix it!

Resources