Skip to content

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

@rosen-vladimirov

Description

@rosen-vladimirov

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 [email protected]
$ 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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions