Error building IOS App after installing pod file - ios

I was installing the pod
pod 'Carte'
The library also wanted me to paste this line at the bottom of my pod file:
post_install do |installer|
pods_dir = File.dirname(installer.pods_project.path)
at_exit { `ruby #{pods_dir}/Carte/Sources/Carte/carte.rb configure` }
end
After running pod install the library was installed, however, I was getting warning messages in the terminal about
always embed swift standard libraries
I searched up and found a few Solutions. and found that settings them to $(inherited) worked for most people. I did this, cleaned and pod install again and nothing changed. I also saw someone changing
always search users paths
to $(inherited) too, so did this. The error is still there.
On building my project. I also get the error
Cycle inside APPNAME; building could produce unreliable results
To which I found changing to the legacy build system would do the trick, however, I do not want to change to the legacy build system. I do not understand why the messages have appeared. I have removed pod 'Carte' from the pod file and the line they wanted me to paste and I still get the error after installing again. I also tried deleting both the pod file and pod lock file, deleting the xcworkspace file and reinstalling the pod file and still, the error remains. Does anyone have a solution to this? Thank you.
from inspecting that error I found this:
error: Cycle inside TARGET; building could produce unreliable results.
Cycle details:
→ Target 'TARGET' has compile command with input '/Users/andrewharris/Desktop/TARGET/TARGET/TARGET/Notifications/AcceptedRemovedRequest/AcceptedRemovedCell.xib'
○ Target 'TARGET' has target dependency on Target 'OneSignalNotificationServiceExtension'
○ That command depends on command in Target 'TARGET': script phase “[Carte] Pre Script”
I think that somehow Carte has not uninstalled in some way?

I managed to solve this error by inspecting it a little closer. Inside the error:
Cycle inside TARGET; building could produce unreliable results
It told me it had something to do with the target OneSignalNotificationServiceExtension I looked in the target and found in build phases there was still [Carte] Pre Script and [Carte] Post Script and so I deleted both. I also deleted the target and recreated it just in case. I also did the same in my AppName Target and deleted both the Pre and Post script. Afterwards, I cleaned and ran the project to which it succeeded.

Related

Google NearbyMessages cocoapod generates “duplicate output file” error

I’m having a problem with NearbyMessages in Xcode 11.2. When I add pod 'NearbyMessages' and then do pod install, when I open the xcworkspace, I get a “duplicate output file” error resulting from the Assets.car that is generated by “[CP] Copy Pods Resources” build phase:
warning: duplicate output file '/Users/.../DerivedData/NearbyDemo-elvzmjtrsxnstlemqnzociqoajhv/Build/Products/Debug-iphonesimulator/NearbyDemo.app/Assets.car' on task: PhaseScriptExecution [CP] Copy Pods Resources /Users/.../DerivedData/NearbyDemo-elvzmjtrsxnstlemqnzociqoajhv/Build/Intermediates.noindex/NearbyDemo.build/Debug-iphonesimulator/NearbyDemo.build/Script-EB8FCF95DAAD8AF429AAA51F.sh (in target 'NearbyDemo' from project 'NearbyDemo’)
I’ve searched and found old issues, e.g., Google Nearby Messages API Broke App Icon, that seem like they might be related. That post looks like it might be an earlier manifestation of the same problem with assets and NearbyMessages, but it looks like the old compiler may not have caught this error.
In Xcode 10.3, this is merely a warning:
ignoring duplicated output file: '/Users/.../DerivedData/NearbyDemo-elvzmjtrsxnstlemqnzociqoajhv/Build/Products/Debug-iphonesimulator/NearbyDemo.app/Assets.car' in shell script build phase '[CP] Copy Pods Resources'. This warning represents an extremely serious project misconfiguration and will likely cause some shell scripts in your project to be skipped entirely, leading to other build failures or missing files in the build directory. This will be a hard error in the future. (in target 'NearbyDemo’)
Does anyone know of anyway to resolve this? I can downgrade Xcode, probably letting this problem pass without a hard error, but that’s not a terribly appealing solution.
It probably isn’t relevant, but here’s my Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'NearbyDemo' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for NearbyDemo
pod 'NearbyMessages'
end
I’m using Cocoapods 1.8.4 and Xcode 11.2 (11B52) on macOS 10.15.1.
I’ve posted a “Nearby Messages API for iOS - Product feedback” report, but was wondering if anyone has found a workaround in the interim.
After some searching, I found a workaround that should help with this behavior. You can achieve this by changing Xcode settings to use the old build system.
Xcode / File / Workspace Settings / Build system / select "Legacy
Build System"
If you need further information, check out this link
- https://github.com/CocoaPods/CocoaPods/issues/8122

Xcode Error: 'FirebaseCore/FirebaseCore.h' file not found

After running pod update on my project, I am now getting the errors:
'FirebaseCore/FirebaseCore.h' file not found
and (I imagine associated):
Could not build Objective-C module 'Firebase'
I have tried deintegrating and installing pods multiple times, creating new workspaces (and making sure I am in workspace rather than project). I am not all that experienced in programming (yet!), but my podfile contains use_frameworks! in case that's of any help?
I have also noticed that when I build my app I get a warning about not being able to find the pod.[AppName].xcconfig file, although the file isn't highlighted in red and appears to still be where it says?
i have the same issue, i simply reinstall the pod file through command prompt like
pod install
so then my project start working.
Hi, i was facing this issue . But i have this fixed error now. Go to Pod file and add "pod 'Firebase/Core', :modular_header => true and "pod 'Firebase/Messaging', :modular_header => true

Pod Update is removing "Target Support Files" but not updating my project settings

Admittedly, it's been awhile since I've run a pod update on my project. Today I was trying to do just that, and am running into issues.
After running a 'pod update', the project will not compile. Here is what I've noticed. The update itself appears to run fine, just like normal. I did notice that all the files in 'Pods/Target Support Files` have been removed.
When I attempt to build, I get an error like this one for most of my pods:
lang: error: no such file or directory: '/Users/logan/development/ProjectNameRemoved/src/Pods/Target Support Files/Pods-AJNotificationView/Pods-AJNotificationView-dummy.m'
clang: error: no input files
When I go to the Build Phases for the pods with this error, I can see that the dummy .m file is still in there, even though it doesn't exist:
Removing all of those doesn't seem to help, as then I start getting the following errors:
Digging down into the target's settings I can see the GCC prefix header is still set to use a nonexistent pch file:
I'm not really sure where to go from here. It seems like pod update is removing certain files, but my pbxproj is not being updated to correlate these changes. Do I need to figure out how to do this manually?
I'm currently running XCode7 and CocoaPods 0.38.2
I encountered this problem when I was refactoring a project. After removing a CocoaPod, I had remnants of it that were referenced. Cleaning caches and rebuilding did not resolve the issue.
I was able to resolve it using cocoapods-deintegrate referenced in the user's comment above.
Steps to resolve:
Close the project in Xcode so you don't have Xcode throwing warnings at you about differences between versions (assuming you're using version control, which is a good idea if you're messing with CocoaPods).
Install cocoapods-deintegrate by typing in Terminal:
gem install cocoapods-deintegrate
Type pod deintegrate from the directory of your project.
Open the project in Xcode, clean caches and rebuild. Your Podfile should still be there...leave it alone. We'll get to that in a moment.
Close the project.
Type pod install
Open the project, clean caches and rebuild.
These are the steps I followed to resolve this issue.
Update:
I also used this methodology to resolve a linker error which cropped up when I deleted a reference to a class file instead of the file itself. Upon doing that, I got this error:
error: linker command failed with exit code 1 (use -v to see
invocation)
You can try
pod deintegrate
pod install
*You should be located at Podfile directory
Can you see if the answer in this post can help?
Xcode install on OSX 10.9 - clang: error: no input files
I would try reconstructing my project.
I just got the same thing after re configuring my podfile to accommodate multiple targets. I was just going to use the suggested answer above, but before doing anything I committed my changes in git. That solved the problem. The git commit included lots of file deletions and additions done by cocoapods, so I guess some things were still hanging around.

Using link_with makes my project failed, CocoaPods 0.37

All my targets use the same libraries, so I use link_with to make my podfile neat. But to my surprise the project compiled failed. Xcode complains it can't find some files in pod, e.g.
diff: /../Podfile.lock: No such file or directory diff:
/Manifest.lock: No such file or directory error: The sandbox is not in
sync with the Podfile.lock. Run 'pod install' or update your CocoaPods
installation.
And
'DDLog.h' file not found
I run pod install again and clean xcode again and again. But no luck. I was not able to figure out why. From what I can see cocopods only changed shellScript for each target to one single Pods-resources.sh, which is what link_with is supposed to do, right?
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CloudPhone/Pods-"my target"-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
Is this a cocopods's bug? I am using latest one 0.37 and now I went back to specify each target individually.
Update:
CocoaPods 1.0 has removed link_with in favour of abstract_target
I think this is a pods bug. The pods doesnot update the script location, when a project specify target specific configuration initially and later tries to combine it.
To fix, go to Build phases->Embedd pod framework-> update the script file location to reflect the universal pod folder (like /Pods/Pods-frameworks.sh"). [You can navigate in finder to find exactly where the sh is present]. Remove any other script which doesn't reflect in physical folder. Now the project should compile.
Quick solution: remove Embed Pod Frameworks and run pod install again
Came across the same error. Just want to add to Sukitha's Answer.
Go to build phase -> Embed pod framework -> $SRCROOT
Be sure to check that this SRSCROOT file block correctly leads up to the frameworks.h file.
You will need to edit in order to correct issue.
Cheers

dyld: Library not loaded with cocoapods 0.37 and Xcode 6.3

I've been reading all the issues about the error:
dyld: Library not loaded: #rpath/Bolts.framework/Bolts
Referenced from: /private/var/mobile/Containers/Bundle/Application/1542F906-CCE1-4181-AC7C-B5E3EE50E7D7/eBikeMotion.app/eBikeMotion
Reason: no suitable image found. Did find:
Which makes my application unable to run in a real device (but it runs without any problem in the simulator.
Until certain point I thought that it was an issue with the frameworks I was installing, but after installing manually the original one that was throwing the error, Alamofire, and the next Framework throwing the error was the next one in alphabetical order (Bolts, as you can see in the code snippet)
So I've reached the conclusion that is indeed CocoaPods which is producing these errors. I've got the last version (0.37) with a clean install, Iv'e tried to create a new project, I've tried all the proposed solutions to this issue without any luck, so I have to open an issue, with the hope that someone can help me.
Regards.
After reinstalling the whole system and don't finding a solution, I've found that some of the Build Phases mandatory for CocoaPods to run properly were missing.
The solution for this problem goes for the next steps:
Deintegrate the cocoapods project (you can install the tool with sudo gem install cocoapods-deintegrate).
cocoapods-deintegrate on Github
Modify your Podfile:
You should define your target linking with link_with 'ProjectName'.
You should define the target for your pods: target 'ProjectName' do [pods here] end.
Make an install with pod install
After doing this, go to XCode and check the following settings:
Into project settings, under "Configurations" check that in Debug and Release you've got a Configuration set named Pods-ProjectName.[debug|release]
Into your target, under "Build Phases" you should have three new phases that should be named: Check Pods Manifest, Embed Pods Frameworks and Copy Pods Resources.
Make a clean, then build, then run into your device.
That's it.
In my case, I followed the above answer by #Jorge, but it didn't resolve the problem. The exact error was a bit different because the missing file was #rpath Pods.framework/Pods. I finally resolved it with help from CocoaPods issue #3586:
Go to target > General > Linked Frameworks and Libraries section
set both Pods.framework and Pods_target.framework to Optional.
Still trying to figure out exactly why.... this answer has some info: what-does-it-mean-to-weak-link-a-framework
I had to fix two issues:
Go to each target then Build Phases then Link Binary With Libraries and select Pods.framework. Set it to Optional.
Cocoapods did not create the needed run scripts for my second target. My first target had all scripts. The second not. So I copied all missing run scripts from the first to the second target. You need to tap on the small "+" sign on the top left, add a run script and paste the script from the other target. I've done that for Check Pods Manifest.lock, Copy Pods Resources and Embed Pods Frameworks.
Then it did run on the device. Finally.
Had same issue adding pods to WatchKit Extension. Linking main target with Watch app is not the best option at all. Found out that cocoapod 0.37.2 hasn't added 'Embed Pods Frameworks' script into build phase.
Script:
"${SRCROOT}/Pods/Target Support Files/Pods-ExtensionName/Pods-ExtensionName-frameworks.sh"
In order to have cocoapods generate the build phases Check Pods Manifest, Embed Pods Frameworks and Copy Pods Resources:
1 - Go to build phases and remove any custom modifications. I had to remove everything under the Link Binary With Libraries phase.
2 - Do a pod deintegrate (Or just remove the files yourself)
3 - Run a new pod install
This worked for me. Without the first step, it never did.
To Resolve this you need to change status in Link Binary with Libraries in build phase for pod_projectName.framework and Bolt.framework
I got the same error in my project.
get error in CommonCrypto.framework
Resolved error by changing Required to Optional
The easiest thing to do would be to ensure that your Protobuf.framework is a dependency in your target's scheme inside the Build step.
This tells Xcode to compile the Protobuf.framework created by your pod install/update whenever it builds your target.

Resources