`SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod
See original GitHub issuePrerequisites
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
- [Y] I am running the latest version
- [Y] I checked the documentation and found no answer
- [Y] I checked to make sure that this issue has not already been filed
Expected Behavior
Please describe the behavior you are expecting
Current Behavior
What is the current behavior? I follow this https://blog.expo.io/so-you-want-to-build-a-bluetooth-app-with-react-native-and-expo-6ea6a31a151d article to make a project
Steps to Reproduce
- step 1
At step pod install came out this error [!] Unable to determine Swift version for the following pods:
react-native-ble-plx-swift
does not specify a Swift version and none of the targets (myapp2
) integrating it have theSWIFT_VERSION
attribute set. Please contact the author or set theSWIFT_VERSION
attribute in at least one of the targets that integrate this pod.
Solve
According to this issue https://github.com/CocoaPods/CocoaPods/issues/7327 I modified react-native-ble-plx-swift.podspec one line code s.pod_target_xcconfig = { ‘SWIFT_VERSION’ => ‘4.1’ } --> s.swift_version = “4.1” And it works for me
Here’s the code
` require ‘json’
package = JSON.parse(File.read(File.join(dir, ‘package.json’)))
Pod::Spec.new do |s| s.name = “react-native-ble-plx-swift” s.version = package[‘version’] s.summary = “React Native Bluetooth Low Energy library - Swift static library”
s.authors = { “Przemysław Lenart” => “przemek.lenart@gmail.com” } s.homepage = “https://github.com/Polidea/react-native-ble-plx#readme” s.license = “Apache License 2.0” s.platform = :ios, “8.0”
s.source = { :git => “https://github.com/Polidea/react-native-ble-plx.git” } s.source_files = “ios/**/*.{swift}” s.swift_version = “4.1” end `
Context
- Library version: 1.0.3
- Platform: Android/iOS
- Platform logs (logcat/XCode):10.2,1
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top GitHub Comments
I discovered this thread https://github.com/kiwi-bop/flutter_crashlytics/issues/22 and the solution of adding a new Swift file in the project fixed the issue for me
Just to bump this up. I am also having the exact issue.