Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build application for iOS with nativescript-bottombar #4606

Closed
rosen-vladimirov opened this issue May 10, 2019 · 0 comments
Closed
Assignees
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

rosen-vladimirov commented May 10, 2019

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.3.2
  • Cross-platform modules: not applicable
  • Android Runtime: Not applicable
  • iOS Runtime: 5.3.0
  • Plugin(s): "nativescript-bottombar": "3.0.8"
  • Xcode 10.2

Describe the bug
Xcode 10.2 drops support for Swift versions below 4. nativescript-bottombar has a Podfile with postinstall hook that sets the Swift version to 3. With Xcode 10.1 there was a warning for deprecated Swift version, but in Xcode 10.2 this is an error.

The suggested workaround is to set Swift version to 4.0 in App_Resources/iOS/Podfile in the following way:

pod 'MiniTabBar', :git => 'https://github.com/rhanb/MiniTabBar.git'

pre_install do |installer|
    installer.analysis_result.specifications.each do |s|
        if s.name == 'MiniTabBar'
            s.swift_version = '4.0'
        end
    end
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == 'MiniTabBar'
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.0'
            end
        end
    end
end

However, this does not fix the issue due to #4512

To Reproduce

$ tns create myApp --js
$ cd myApp
$ tns plugin add nativescript-bottombar@3.0.8
$ tns build ios # this should fail that Swift 3 is not supported
# Now try to apply the workaround, i.e. create a Podfile in `App_Resources/iOS` and place the content mentioned above
$ tns build ios # this will fail again 

Expected behavior
You should be able to fix the build with post_install hook in App_Resources/iOS/Podfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants