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

Issues with iOS 15 SDK #79

Closed
below opened this issue Jun 9, 2021 · 21 comments
Closed

Issues with iOS 15 SDK #79

below opened this issue Jun 9, 2021 · 21 comments

Comments

@below
Copy link
Contributor

below commented Jun 9, 2021

Due to changes in the CoreBluetooth API, parts of the code break:

…/RestoredState.swift:68:105: error: value of optional type 'CBPeripheral?' must be unwrapped to a value of type 'CBPeripheral'
                                                      peripheral: RxCBPeripheral(peripheral: $0.service.peripheral)),
                                                                                                        ^
…/MultiplatformBleAdapter/iOS/RxBluetoothKit/RxCBCharacteristic.swift:59:52: error: value of optional type 'CBService?' must be unwrapped to a value of type 'CBService'
        return RxCBService(service: characteristic.service)
                                                   ^                                                      peripheral: RxCBPeripheral(peripheral: $0.service.peripheral)),
…/RxCBDescriptor.swift:43:62: error: value of optional type 'CBCharacteristic?' must be unwrapped to a value of type 'CBCharacteristic'
        return RxCBCharacteristic(characteristic: descriptor.characteristic)
                                                             ^
@below
Copy link
Contributor Author

below commented Jun 10, 2021

I have created a pull request for the issue: #80

@srgtuszy
Copy link

Thanks for contributing! PR has been merged

@georgeburduhos
Copy link

When maybe a release will be made here and on react-native-ble-plx?

@korykehl
Copy link

Hey @srgtuszy do you know of an eta of when this might make it into react-native-ble-plx?

@korykehl
Copy link

@georgeburduhos have you found a work around for this in the mean time?

@georgeburduhos
Copy link

georgeburduhos commented Sep 22, 2021

@korykehl
Yes. If you run locally just follow the xcode instructions to fix the library. If you run on CI just make a sh script to replace the code needed to make the fix on each file

@below
Copy link
Contributor Author

below commented Sep 22, 2021

Here is what we did:
Change line 9 to:
pod 'MultiplatformBleAdapter', :git => 'https://github.com/below/MultiPlatformBleAdapter', :tag => '0.1. 9'

In your main directory, execute:
npx patch-package react-native-ble-plx --exclude 'android/build/|package.json$|.DS_Store$'

This will create a patch file in patches/react-native-ble-plx+2.0.2.patch

We had to go ahead and change ios/Podfile.lockto use MultiplatformBleAdapter (0.1.9) for the changes to be used in the Xcode project (if anyone has a better idea …)

I have created a push request for the 0.1.9 release here, and once that is accepted will gladly do it for react-native-ble-plx

@menssen
Copy link

menssen commented Sep 22, 2021

@below Thanks for publishing the fork with the new tag.

For some reason (I'm somewhat new to Cocoapods so I don't really understand the discrepancy), I had to patch this differently than what you described:

  1. I added pod 'MultiplatformBleAdapter', :git => 'https://github.com/below/MultiPlatformBleAdapter', :tag => '0.1.9' to our project's main Podfile.
  2. I had to patch node_modules/react-native-ble-plx/react-native-ble-plx.podspec (just change 0.1.7 to 0.1.9)
  3. node_modules/react-native-ble-plx/ios/Podfile seems to be irrelevant.

@wildseansy
Copy link

wildseansy commented Sep 22, 2021

My patch file:

diff --git a/node_modules/react-native-ble-plx/react-native-ble-plx.podspec b/node_modules/react-native-ble-plx/react-native-ble-plx.podspec
index def210f..0a92dcc 100644
--- a/node_modules/react-native-ble-plx/react-native-ble-plx.podspec
+++ b/node_modules/react-native-ble-plx/react-native-ble-plx.podspec
@@ -17,5 +17,5 @@ Pod::Spec.new do |s|
   s.compiler_flags = '-DMULTIPLATFORM_BLE_ADAPTER'

   s.dependency 'React'
-  s.dependency 'MultiplatformBleAdapter', '0.1.7'
+  s.dependency 'MultiplatformBleAdapter', '0.1.9'
 end

For help installing in react-native-ble-plx, explained here: dotintent/react-native-ble-plx#899 (comment)

@below Thanks for publishing the fork with the new tag.

For some reason (I'm somewhat new to Cocoapods so I don't really understand the discrepancy), I had to patch this differently than what you described:
...
2. I had to patch node_modules/react-native-ble-plx/react-native-ble-plx.podspec (just change 0.1.7 to 0.1.9)
...

@below
Copy link
Contributor Author

below commented Sep 22, 2021

Whatever works for you ;) All I can hope the fix is accepted soon so we can stop patching …

@yeonwooz
Copy link

yeonwooz commented Sep 26, 2021

@below Thanks for publishing the fork with the new tag.

For some reason (I'm somewhat new to Cocoapods so I don't really understand the discrepancy), I had to patch this differently than what you described:

  1. I added pod 'MultiplatformBleAdapter', :git => 'https://github.com/below/MultiPlatformBleAdapter', :tag => '0.1.9' to our project's main Podfile.
  2. I had to patch node_modules/react-native-ble-plx/react-native-ble-plx.podspec (just change 0.1.7 to 0.1.9)
  3. node_modules/react-native-ble-plx/ios/Podfile seems to be irrelevant.

Thank you!

If someone meets compatibility error while following @menseen 's way

image

you can try this

pod update
pod repo update
pod install

@diogoviannaaraujo
Copy link

diogoviannaaraujo commented Sep 29, 2021

@yeonwooz I've been trying to update to 0.1.9 but I keep getting that None of your spec sources contain a spec satisfying the dependency: MultiplatformBleAdapter (= 0.1.9).

pod update, repo update and stuff did not work either.

@yeonwooz
Copy link

yeonwooz commented Sep 30, 2021

@yeonwooz I've been trying to update to 0.1.9 but I keep getting that None of your spec sources contain a spec satisfying the dependency: MultiplatformBleAdapter (= 0.1.9).

pod update, repo update and stuff did not work either.

How about removing Pods directory and Podfile.lock and then try it again? @diogoviannaaraujo

// at the ios directory

rm -rf Pods
rm -rf Podfile.lock

@tmorone-rezi
Copy link

I tried:
rm -rf Pods
pod cache clean MultiplatformBleAdapter
pod update
pod repo update
pod install

Still get:

[!] CocoaPods could not find compatible versions for pod "MultiplatformBleAdapter":
  In Podfile:
    flutter_ble_lib (from `.symlinks/plugins/flutter_ble_lib/ios`) was resolved to 2.4.0, which depends on
      MultiplatformBleAdapter (~> 0.1.9)

None of your spec sources contain a spec satisfying the dependency: `MultiplatformBleAdapter (~> 0.1.9)`.

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.
 * ```

@dokinkon
Copy link

Please release 0.1.9 to cocoapods~

In FlutterBleLib, we can not specify git & tag in pod.spec. This really break down product release with Xcode 13 + iOS15

Thank you

@rnapier
Copy link

rnapier commented Oct 17, 2021

With @below's fixes, this is now fairly straightforward to install without any patching. In package.json, use below's branch:

"react-native-ble-plx": "https://github.com/below/react-native-ble-plx",

And in ios/Podfile, use the latest MultiPlatformBleAdatper:

pod 'MultiplatformBleAdapter', :git => 'https://github.com/dotintent/MultiPlatformBleAdapter'

@t3db0t
Copy link

t3db0t commented Oct 27, 2021

I tried @rnapier 's solution but I am getting this error no matter what I do:

[!] CocoaPods could not find compatible versions for pod "MultiplatformBleAdapter":
  In Podfile:
    MultiplatformBleAdapter (from `https://github.com/dotintent/MultiPlatformBleAdapter`)

    react-native-ble-plx (from `../node_modules/react-native-ble-plx`) was resolved to 2.0.2, which depends on
      MultiplatformBleAdapter (= 0.1.7)

I tried various combinations of removing /Pods and Podfile.lock etc., but nothing seems to help...

@t3db0t
Copy link

t3db0t commented Oct 27, 2021

OK, I solved it by:

  1. using pod 'MultiplatformBleAdapter', :git => 'https://github.com/below/MultiPlatformBleAdapter', :tag => '0.1.9' in ios/Podfile
  2. In node_modules/react-native-ble-plx/react-native-ble-plx.podspec change 0.1.7 to 0.1.9

@kofkgoing
Copy link

I don't understand why 0.1.9 pod is still not released.
Whose is MultiPlatformBleAdapter pod??
I tried to visit https://github.com/Polidea/MultiPlatformBleAdapter,
but it was redirected to this repository.

pod search MultiPlatformBleAdapter --simple
-> MultiplatformBleAdapter (1.0.0-beta)
An adapter for RxBluetoothKit that exposes consist API to crossplatform libraries
pod 'MultiplatformBleAdapter', '~> 1.0.0-beta'

@xiehui999
Copy link

OK, I solved it by:

  1. using pod 'MultiplatformBleAdapter', :git => 'https://github.com/below/MultiPlatformBleAdapter', :tag => '0.1.9' in ios/Podfile
  2. In node_modules/react-native-ble-plx/react-native-ble-plx.podspec change 0.1.7 to 0.1.9

works for me

@below
Copy link
Contributor Author

below commented Dec 2, 2022

It is still not released? 🤯

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

No branches or pull requests