Xcode 10.2 convert multiple targets to Swift 5: Tries to compile some classes that are not part of targetCan I safely delete contents of Xcode Derived data folder?Swift Beta performance: sorting arrays“Use of undeclared type” in Swift, even though type is internal, and exists in same moduleWhy is Swift compile time so slow?Existing target has no 'swift compiler code generation' sectionXcode hangs on “Compiling Swift source files”Xcode 8 Beta 3 Use Legacy Swift issueHow to share Swift classes across multiple targets of one Xcode workspace?In a mixed objc/swift module, Xcode always tries to include the module itselfUsing Swift 3 in Xcode 10.2 - Command /Library/Developer/Toolchains/swift-3.0-RELEASE.xctoolchain/usr/bin/swiftc failed with exit code 1
How was Luke's prosthetic hand in Episode V filmed?
Get Chord Name From a Given Set of Notes
Company looks for long-term employees, but I know I won't be interested in staying long
Why should fork() have been designed to return a file descriptor?
How important are the Author's mood and feelings for writing a story?
Found old paper shares of Motorola Inc that has since been broken up
Inscriptio Labyrinthica
Do higher dimensions have axes?
Dative single noun Bankautomaten?
Inside Out and Back to Front
"Je suis petite, moi?", purpose of the "moi"?
Should I work for free if client's requirement changed
Why are there few or no black super GMs?
How does the Gameboy's memory bank switching work?
Brute-force the switchboard
Is encryption still applied if you ignore the SSL certificate warning for self-signed certs?
Project Euler # 25 The 1000 digit Fibonacci index
Doesn't the Schrödinger's cat inside the box cause the probability wave function to collapse long before a human opens the box?
Are there foods that astronauts are explicitly never allowed to eat?
When we are talking about black hole evaporation - what exactly happens?
Does unblocking power bar outlets through short extension cords increase fire risk?
Is this guy trying to scam me?
What's the largest an Earth-like planet can be and support Earth's biosphere?
Should I have shared a document with a former employee?
Xcode 10.2 convert multiple targets to Swift 5: Tries to compile some classes that are not part of target
Can I safely delete contents of Xcode Derived data folder?Swift Beta performance: sorting arrays“Use of undeclared type” in Swift, even though type is internal, and exists in same moduleWhy is Swift compile time so slow?Existing target has no 'swift compiler code generation' sectionXcode hangs on “Compiling Swift source files”Xcode 8 Beta 3 Use Legacy Swift issueHow to share Swift classes across multiple targets of one Xcode workspace?In a mixed objc/swift module, Xcode always tries to include the module itselfUsing Swift 3 in Xcode 10.2 - Command /Library/Developer/Toolchains/swift-3.0-RELEASE.xctoolchain/usr/bin/swiftc failed with exit code 1
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have an iOS Swift project with multiple targets.
Converting the first target to Swift 5 was easy.
Converting the second target to Swift 5, Xcode 10.2 tries to compile files that clearly exist only in the first target and fails (Because it doesn't compile all files of the first target and complains about unresolved identifiers).
What can I do that Xcode compiles only those files, that are part of the target while converting to Swift 5?
How can I convert my project to Swift 5?
Cleaning the Build folder and restarting Xcode 10.2 doesn't help.
swift xcode swift5
add a comment |
I have an iOS Swift project with multiple targets.
Converting the first target to Swift 5 was easy.
Converting the second target to Swift 5, Xcode 10.2 tries to compile files that clearly exist only in the first target and fails (Because it doesn't compile all files of the first target and complains about unresolved identifiers).
What can I do that Xcode compiles only those files, that are part of the target while converting to Swift 5?
How can I convert my project to Swift 5?
Cleaning the Build folder and restarting Xcode 10.2 doesn't help.
swift xcode swift5
2
Swift 5 being source compatible with Swift 4.2, if you have some issues with the migration assistant, you could try to simply change the SWIFT_VERSION to 5.0 and solve the rare errors manually.
– Cœur
Mar 26 at 11:44
Note that the Swift migration assistant will try to build all architectures (not just the active one), so that may explain some issues. But to be able to really help, we would need a sample project and/or more details about the errors.
– Cœur
Mar 26 at 11:47
add a comment |
I have an iOS Swift project with multiple targets.
Converting the first target to Swift 5 was easy.
Converting the second target to Swift 5, Xcode 10.2 tries to compile files that clearly exist only in the first target and fails (Because it doesn't compile all files of the first target and complains about unresolved identifiers).
What can I do that Xcode compiles only those files, that are part of the target while converting to Swift 5?
How can I convert my project to Swift 5?
Cleaning the Build folder and restarting Xcode 10.2 doesn't help.
swift xcode swift5
I have an iOS Swift project with multiple targets.
Converting the first target to Swift 5 was easy.
Converting the second target to Swift 5, Xcode 10.2 tries to compile files that clearly exist only in the first target and fails (Because it doesn't compile all files of the first target and complains about unresolved identifiers).
What can I do that Xcode compiles only those files, that are part of the target while converting to Swift 5?
How can I convert my project to Swift 5?
Cleaning the Build folder and restarting Xcode 10.2 doesn't help.
swift xcode swift5
swift xcode swift5
edited Mar 26 at 12:27
Gerd Castan
asked Mar 26 at 11:11
Gerd CastanGerd Castan
3,4122 gold badges23 silver badges61 bronze badges
3,4122 gold badges23 silver badges61 bronze badges
2
Swift 5 being source compatible with Swift 4.2, if you have some issues with the migration assistant, you could try to simply change the SWIFT_VERSION to 5.0 and solve the rare errors manually.
– Cœur
Mar 26 at 11:44
Note that the Swift migration assistant will try to build all architectures (not just the active one), so that may explain some issues. But to be able to really help, we would need a sample project and/or more details about the errors.
– Cœur
Mar 26 at 11:47
add a comment |
2
Swift 5 being source compatible with Swift 4.2, if you have some issues with the migration assistant, you could try to simply change the SWIFT_VERSION to 5.0 and solve the rare errors manually.
– Cœur
Mar 26 at 11:44
Note that the Swift migration assistant will try to build all architectures (not just the active one), so that may explain some issues. But to be able to really help, we would need a sample project and/or more details about the errors.
– Cœur
Mar 26 at 11:47
2
2
Swift 5 being source compatible with Swift 4.2, if you have some issues with the migration assistant, you could try to simply change the SWIFT_VERSION to 5.0 and solve the rare errors manually.
– Cœur
Mar 26 at 11:44
Swift 5 being source compatible with Swift 4.2, if you have some issues with the migration assistant, you could try to simply change the SWIFT_VERSION to 5.0 and solve the rare errors manually.
– Cœur
Mar 26 at 11:44
Note that the Swift migration assistant will try to build all architectures (not just the active one), so that may explain some issues. But to be able to really help, we would need a sample project and/or more details about the errors.
– Cœur
Mar 26 at 11:47
Note that the Swift migration assistant will try to build all architectures (not just the active one), so that may explain some issues. But to be able to really help, we would need a sample project and/or more details about the errors.
– Cœur
Mar 26 at 11:47
add a comment |
3 Answers
3
active
oldest
votes
I found a workaround:
- reset project to state before conversion.
- convert the target with the fewest classes (not containing the files in the error message of the first attempt)
- convert target for target, including more and more files
- convert test targets
With this approach I was able to convert my project.
(See also the comment of Cœur, I think their manual conversion would work, too)
add a comment |
It's not clear to me what the issue is, if you could file a bug report at http://bugreport.apple.com, the team at Apple will follow-up with you.
Note that there is a migration guide that you may find helpful here: https://swift.org/migration-guide-swift5
add a comment |
I just went through this process and was able to figure out a fairly simple solution from a hint in the last sentence of the Migration Guide https://swift.org/migration-guide-swift5/
When I tried to convert each target individually in my project, the second target would fail because of shared code with the first target that had already been converted. The solution is to create a new scheme that includes all of the targets that need to be migrated in a single pass.
Click on the scheme button to get the drop down and select "New Scheme..."
Create the scheme and then select it in the drop down and choose "Edit Scheme..."
Under the "Build" section use the "+" button to add all of the targets you need to convert to the scheme.
Build the new scheme with the current Swift version to confirm that all targets build correctly.
Use Edit -> Convert -> "To Current Swift Syntax..." to start the conversion
This worked for me in a project with 15 targets with lots of shared Swift code that was in version 4.0.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55355726%2fxcode-10-2-convert-multiple-targets-to-swift-5-tries-to-compile-some-classes-th%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I found a workaround:
- reset project to state before conversion.
- convert the target with the fewest classes (not containing the files in the error message of the first attempt)
- convert target for target, including more and more files
- convert test targets
With this approach I was able to convert my project.
(See also the comment of Cœur, I think their manual conversion would work, too)
add a comment |
I found a workaround:
- reset project to state before conversion.
- convert the target with the fewest classes (not containing the files in the error message of the first attempt)
- convert target for target, including more and more files
- convert test targets
With this approach I was able to convert my project.
(See also the comment of Cœur, I think their manual conversion would work, too)
add a comment |
I found a workaround:
- reset project to state before conversion.
- convert the target with the fewest classes (not containing the files in the error message of the first attempt)
- convert target for target, including more and more files
- convert test targets
With this approach I was able to convert my project.
(See also the comment of Cœur, I think their manual conversion would work, too)
I found a workaround:
- reset project to state before conversion.
- convert the target with the fewest classes (not containing the files in the error message of the first attempt)
- convert target for target, including more and more files
- convert test targets
With this approach I was able to convert my project.
(See also the comment of Cœur, I think their manual conversion would work, too)
edited Mar 26 at 12:36
answered Mar 26 at 12:23
Gerd CastanGerd Castan
3,4122 gold badges23 silver badges61 bronze badges
3,4122 gold badges23 silver badges61 bronze badges
add a comment |
add a comment |
It's not clear to me what the issue is, if you could file a bug report at http://bugreport.apple.com, the team at Apple will follow-up with you.
Note that there is a migration guide that you may find helpful here: https://swift.org/migration-guide-swift5
add a comment |
It's not clear to me what the issue is, if you could file a bug report at http://bugreport.apple.com, the team at Apple will follow-up with you.
Note that there is a migration guide that you may find helpful here: https://swift.org/migration-guide-swift5
add a comment |
It's not clear to me what the issue is, if you could file a bug report at http://bugreport.apple.com, the team at Apple will follow-up with you.
Note that there is a migration guide that you may find helpful here: https://swift.org/migration-guide-swift5
It's not clear to me what the issue is, if you could file a bug report at http://bugreport.apple.com, the team at Apple will follow-up with you.
Note that there is a migration guide that you may find helpful here: https://swift.org/migration-guide-swift5
answered Mar 27 at 0:55
user2529180user2529180
312 bronze badges
312 bronze badges
add a comment |
add a comment |
I just went through this process and was able to figure out a fairly simple solution from a hint in the last sentence of the Migration Guide https://swift.org/migration-guide-swift5/
When I tried to convert each target individually in my project, the second target would fail because of shared code with the first target that had already been converted. The solution is to create a new scheme that includes all of the targets that need to be migrated in a single pass.
Click on the scheme button to get the drop down and select "New Scheme..."
Create the scheme and then select it in the drop down and choose "Edit Scheme..."
Under the "Build" section use the "+" button to add all of the targets you need to convert to the scheme.
Build the new scheme with the current Swift version to confirm that all targets build correctly.
Use Edit -> Convert -> "To Current Swift Syntax..." to start the conversion
This worked for me in a project with 15 targets with lots of shared Swift code that was in version 4.0.
add a comment |
I just went through this process and was able to figure out a fairly simple solution from a hint in the last sentence of the Migration Guide https://swift.org/migration-guide-swift5/
When I tried to convert each target individually in my project, the second target would fail because of shared code with the first target that had already been converted. The solution is to create a new scheme that includes all of the targets that need to be migrated in a single pass.
Click on the scheme button to get the drop down and select "New Scheme..."
Create the scheme and then select it in the drop down and choose "Edit Scheme..."
Under the "Build" section use the "+" button to add all of the targets you need to convert to the scheme.
Build the new scheme with the current Swift version to confirm that all targets build correctly.
Use Edit -> Convert -> "To Current Swift Syntax..." to start the conversion
This worked for me in a project with 15 targets with lots of shared Swift code that was in version 4.0.
add a comment |
I just went through this process and was able to figure out a fairly simple solution from a hint in the last sentence of the Migration Guide https://swift.org/migration-guide-swift5/
When I tried to convert each target individually in my project, the second target would fail because of shared code with the first target that had already been converted. The solution is to create a new scheme that includes all of the targets that need to be migrated in a single pass.
Click on the scheme button to get the drop down and select "New Scheme..."
Create the scheme and then select it in the drop down and choose "Edit Scheme..."
Under the "Build" section use the "+" button to add all of the targets you need to convert to the scheme.
Build the new scheme with the current Swift version to confirm that all targets build correctly.
Use Edit -> Convert -> "To Current Swift Syntax..." to start the conversion
This worked for me in a project with 15 targets with lots of shared Swift code that was in version 4.0.
I just went through this process and was able to figure out a fairly simple solution from a hint in the last sentence of the Migration Guide https://swift.org/migration-guide-swift5/
When I tried to convert each target individually in my project, the second target would fail because of shared code with the first target that had already been converted. The solution is to create a new scheme that includes all of the targets that need to be migrated in a single pass.
Click on the scheme button to get the drop down and select "New Scheme..."
Create the scheme and then select it in the drop down and choose "Edit Scheme..."
Under the "Build" section use the "+" button to add all of the targets you need to convert to the scheme.
Build the new scheme with the current Swift version to confirm that all targets build correctly.
Use Edit -> Convert -> "To Current Swift Syntax..." to start the conversion
This worked for me in a project with 15 targets with lots of shared Swift code that was in version 4.0.
answered May 21 at 18:43
RobARobA
11 bronze badge
11 bronze badge
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55355726%2fxcode-10-2-convert-multiple-targets-to-swift-5-tries-to-compile-some-classes-th%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Swift 5 being source compatible with Swift 4.2, if you have some issues with the migration assistant, you could try to simply change the SWIFT_VERSION to 5.0 and solve the rare errors manually.
– Cœur
Mar 26 at 11:44
Note that the Swift migration assistant will try to build all architectures (not just the active one), so that may explain some issues. But to be able to really help, we would need a sample project and/or more details about the errors.
– Cœur
Mar 26 at 11:47