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;








2















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.










share|improve this question



















  • 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















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.










share|improve this question



















  • 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








2








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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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












  • 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












3 Answers
3






active

oldest

votes


















0














I found a workaround:



  1. reset project to state before conversion.

  2. convert the target with the fewest classes (not containing the files in the error message of the first attempt)

  3. convert target for target, including more and more files

  4. 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)






share|improve this answer
































    0














    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






    share|improve this answer






























      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.



      1. Click on the scheme button to get the drop down and select "New Scheme..."


      2. Create the scheme and then select it in the drop down and choose "Edit Scheme..."


      3. Under the "Build" section use the "+" button to add all of the targets you need to convert to the scheme.


      4. Build the new scheme with the current Swift version to confirm that all targets build correctly.


      5. 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.






      share|improve this answer

























        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
        );



        );













        draft saved

        draft discarded


















        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









        0














        I found a workaround:



        1. reset project to state before conversion.

        2. convert the target with the fewest classes (not containing the files in the error message of the first attempt)

        3. convert target for target, including more and more files

        4. 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)






        share|improve this answer





























          0














          I found a workaround:



          1. reset project to state before conversion.

          2. convert the target with the fewest classes (not containing the files in the error message of the first attempt)

          3. convert target for target, including more and more files

          4. 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)






          share|improve this answer



























            0












            0








            0







            I found a workaround:



            1. reset project to state before conversion.

            2. convert the target with the fewest classes (not containing the files in the error message of the first attempt)

            3. convert target for target, including more and more files

            4. 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)






            share|improve this answer















            I found a workaround:



            1. reset project to state before conversion.

            2. convert the target with the fewest classes (not containing the files in the error message of the first attempt)

            3. convert target for target, including more and more files

            4. 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)







            share|improve this answer














            share|improve this answer



            share|improve this answer








            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























                0














                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






                share|improve this answer



























                  0














                  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






                  share|improve this answer

























                    0












                    0








                    0







                    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






                    share|improve this answer













                    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







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 27 at 0:55









                    user2529180user2529180

                    312 bronze badges




                    312 bronze badges





















                        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.



                        1. Click on the scheme button to get the drop down and select "New Scheme..."


                        2. Create the scheme and then select it in the drop down and choose "Edit Scheme..."


                        3. Under the "Build" section use the "+" button to add all of the targets you need to convert to the scheme.


                        4. Build the new scheme with the current Swift version to confirm that all targets build correctly.


                        5. 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.






                        share|improve this answer



























                          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.



                          1. Click on the scheme button to get the drop down and select "New Scheme..."


                          2. Create the scheme and then select it in the drop down and choose "Edit Scheme..."


                          3. Under the "Build" section use the "+" button to add all of the targets you need to convert to the scheme.


                          4. Build the new scheme with the current Swift version to confirm that all targets build correctly.


                          5. 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.






                          share|improve this answer

























                            0












                            0








                            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.



                            1. Click on the scheme button to get the drop down and select "New Scheme..."


                            2. Create the scheme and then select it in the drop down and choose "Edit Scheme..."


                            3. Under the "Build" section use the "+" button to add all of the targets you need to convert to the scheme.


                            4. Build the new scheme with the current Swift version to confirm that all targets build correctly.


                            5. 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.






                            share|improve this answer













                            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.



                            1. Click on the scheme button to get the drop down and select "New Scheme..."


                            2. Create the scheme and then select it in the drop down and choose "Edit Scheme..."


                            3. Under the "Build" section use the "+" button to add all of the targets you need to convert to the scheme.


                            4. Build the new scheme with the current Swift version to confirm that all targets build correctly.


                            5. 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.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered May 21 at 18:43









                            RobARobA

                            11 bronze badge




                            11 bronze badge



























                                draft saved

                                draft discarded
















































                                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.




                                draft saved


                                draft discarded














                                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





















































                                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







                                Popular posts from this blog

                                Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                                Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                                Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript