Yes, I am using the latest CocoaPods release
Cocoapods version: 1.6.0.beta.1
XCode version: Version 10.0
I created a pod spec file with 'pod spec create' and filled in the appropriate content
```Pod::Spec.new do |s|
s.name = "iMessageFramework"
s.version = "1.0.0"
s.summary = "Small test to test code sharing via cocoapods."
s.description = "This is some superl oco framework that was made by kevin vugts."
s.homepage = "https://github.com/kevinvugts/"
s.license = "MIT"
s.author = { "Kevin Vugts" => "[email protected]" }
s.platform = :ios, "11.0"
s.source = { :git => "https://github.com/kevinvugts/iMessageFramework.git", :tag => "1.0.0" }
s.source_files = "iMessageFramework/*/"
s.swift_version = '4.2'
s.ios.deployment_target = '11.0'
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
end
```
After I run 'pod spec lint --verbose' I received an build error from Xcode which I am not able to reproduce. I expected it to succesfully validate the spec file but it didn't.
It threw the following error:
```Build system information
error: Multiple commands produce '/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180924-10333-tgiujl-iMessageFramework/DerivedData/App/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist':
1) Target 'iMessageFramework' (project 'Pods') has copy command from '/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180924-10333-tgiujl-iMessageFramework/Pods/iMessageFramework/iMessageFramework/iMessageFramework/Info.plist' to '/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180924-10333-tgiujl-iMessageFramework/DerivedData/App/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist'
2) Target 'iMessageFramework' (project 'Pods') has process command with output '/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180924-10333-tgiujl-iMessageFramework/DerivedData/App/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist'
** BUILD FAILED **
Testing with xcodebuild
.
-> iMessageFramework (1.0.0)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.```
The full output can be found in this pasty: https://pastebin.com/Adf3fu88
I was actually going to log the same issue this morning. This is due to the new build system that is now on by default in Xcode 10. The new build system is much stricter about what each step of the build is doing so that it can avoid doing duplicate work in order to speed up the build process. Unfortunately, I don't believe that Cocoapods full supports the new build system yetâ„¢.
What is happening here is that when Cocoapods creates the project for lint validation, the new build system is used even if the current project has the new build system turned off via the workspace setting (Project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
What I think would resolve this is a configuration option to pass to the lint
command in order to tell xcodebuild
not to use the new build system (i.e. -UseNewBuildSystem=NO
) or to duplicate the project's workspace settings in the generated linter project.
@madsolar8582 so the terminal command would be: pod spec lint --verbose --UseNewBuilddSystem=NO?
@kevinvugts No. The linter would need to take in a flag that would then pass -UseNewBuildSystem=NO
to xcodebuild
. Said flag does not yet exist. My suggestion would be something along the lines of --use-legacy-build
or something similar.
@madsolar8582 So by the time cocoapods does not support this. What should I do? I've got XCode 10 on my laptop and the newest cocoapods. And I need to be able to lint in order to continue. :D
@kevinvugts What I've done for now is to use xcode-select
to change the location of xcodebuild
to my Xcode 9 installation when I need to lint. Afterwards, I change the location back to Xcode 10. Now, depending on what is being compiled, this may not be a viable solution, but it is the only workaround that I could think of.
Sorry could you explain that step by step? I have never done that.
This looks like the same issue as https://github.com/CocoaPods/CocoaPods/issues/8116.
See this comment specifically: https://github.com/CocoaPods/CocoaPods/issues/8116#issuecomment-423340581
My best advise is to fix this to work with Xcode 10. Introducing a new option seems maybe OK but nothing guarantees that the consumer will use the old system either and therefore your pod will fail to build for them.
@kevinvugts Certainly. xcode-select
allows you to change the command line tool location that xcrun
uses. For this to work, you must have multiple versions of Xcode installed.
xcode-select --help
Usage: xcode-select [options]Print or change the path to the active developer directory. This directory
controls which tools are used for the Xcode command line tools (for example,
xcodebuild) as well as the BSD development commands (such as cc and make).Options:
-h, --help print this help message and exit
-p, --print-path print the path of the active developer directory
-s, --switch set the path for the active developer directory
--install open a dialog for installation of the command line developer tools
-v, --version print the xcode-select version
-r, --reset reset to the default command line tools path
You can also do this from Xcode itself by going to Preferences>Locations and then adjusting Command Line Tools.
@dnkoutso Would it make sense to also add a configuration to the podspec to enforce the legacy build system?
@madsolar8582 If the build system can be set per target then maybe yes. If its a global setting then no. It is probably best to move forward and fixing libraries to work properly with Xcode 10 as I can imagine in the near future Apple removing the legacy build system entirely or making it even harder to enable.
@dnkoutso The build system is global as the root project builds all of the subprojects. While I do agree that moving towards the new build system is the right approach, the new build system is not 1:1 with the (now) legacy build system, so some projects do have legitimate reasons to need to continue using the legacy build system until Apple has added those capabilities to the new build system. Those limitations (as well as breaking issues that are unresolved) can be found here.
Yes we are in a transition period for sure. If its global setting unfortunately I cannot see a reason to add this to the podspec
DSL as it would make the entire project because of a single pod to use the old build system. Who knows, we might get in places where the old one doesn't work but the new one does in the future.
I checked the git repo for this podspec. This seem the same problem as in #8116 so it should be fairly easy to fix.
Confirmed this is the same as #8116.
Pod::Spec.new do |s|
s.name = "iMessageFramework"
s.version = "1.0.0"
s.summary = "Small test to test code sharing via cocoapods."
s.description = "This is some superl oco framework that was made by kevin vugts."
s.homepage = "https://github.com/kevinvugts/"
s.license = "MIT"
s.author = { "Kevin Vugts" => "[email protected]" }
s.platform = :ios, "11.0"
s.source = { :git => "https://github.com/kevinvugts/iMessageFramework.git", :tag => "1.0.0" }
s.source_files = "iMessageFramework/**/*"
s.exclude_files = "iMessageFramework/**/*.plist"
s.swift_version = '4.2'
s.ios.deployment_target = '11.0'
end
This worked and I was able to lint
successfully. Please remove Info.plist
files from source glob or exclude them.
Also this line:
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
It is not currently used by CocoaPods so use s.swift_version
instead.
@dnkoutso Could you explain what a "source glob" is for those of us who've never heard of the term? I can't see anywhere in my project that is including the Info.plist but I'm still getting that error.
Confirmed this is the same as #8116.
Pod::Spec.new do |s| s.name = "iMessageFramework" s.version = "1.0.0" s.summary = "Small test to test code sharing via cocoapods." s.description = "This is some superl oco framework that was made by kevin vugts." s.homepage = "https://github.com/kevinvugts/" s.license = "MIT" s.author = { "Kevin Vugts" => "[email protected]" } s.platform = :ios, "11.0" s.source = { :git => "https://github.com/kevinvugts/iMessageFramework.git", :tag => "1.0.0" } s.source_files = "iMessageFramework/**/*" s.exclude_files = "iMessageFramework/**/*.plist" s.swift_version = '4.2' s.ios.deployment_target = '11.0' end
This worked and I was able to
lint
successfully. Please removeInfo.plist
files from source glob or exclude them.Also this line:
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
It is not currently used by CocoaPods so use
s.swift_version
instead.
Thanks! That worked
to change xcode select use command as sudo and change it back to what it was as before :
sudo xcode-select -s /Users/djrecker/Downloads/Xcode9.4.1.app/Contents/Developer
Confirmed this is the same as #8116.
Pod::Spec.new do |s| s.name = "iMessageFramework" s.version = "1.0.0" s.summary = "Small test to test code sharing via cocoapods." s.description = "This is some superl oco framework that was made by kevin vugts." s.homepage = "https://github.com/kevinvugts/" s.license = "MIT" s.author = { "Kevin Vugts" => "[email protected]" } s.platform = :ios, "11.0" s.source = { :git => "https://github.com/kevinvugts/iMessageFramework.git", :tag => "1.0.0" } s.source_files = "iMessageFramework/**/*" s.exclude_files = "iMessageFramework/**/*.plist" s.swift_version = '4.2' s.ios.deployment_target = '11.0' end
This worked and I was able to
lint
successfully. Please removeInfo.plist
files from source glob or exclude them.Also this line:
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
It is not currently used by CocoaPods so use
s.swift_version
instead.
Thank you !!
Most helpful comment
Confirmed this is the same as #8116.
This worked and I was able to
lint
successfully. Please removeInfo.plist
files from source glob or exclude them.Also this line:
It is not currently used by CocoaPods so use
s.swift_version
instead.