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

Cannot build v5.0.0 example app on Xcode13 macOS 11.6 #422

Closed
truonghoangduy opened this issue Oct 21, 2021 · 10 comments
Closed

Cannot build v5.0.0 example app on Xcode13 macOS 11.6 #422

truonghoangduy opened this issue Oct 21, 2021 · 10 comments

Comments

@truonghoangduy
Copy link

truonghoangduy commented Oct 21, 2021

Enviorment
macOS : 11.6 (Big Sur lasted)
Intel Base macOS ↙️
Flutter SDK : v2.5.1
Xcode 13.0
IOS_Device : 14.6 (Real device)
flutter_reactive_ble : v5.0.0

Describe the bug
I could not build the example version in the GitHub repo, Pod library error, spec macOS 11.6 Intel base Xcode 13.0 with flutter_reactive_ble : v5.0.0 example app

To Reproduce

  1. git clone https://github.com/PhilipsHue/flutter_reactive_ble.git
  2. cd example
  3. flutter pub get
  4. Re-signing the project with my Xcode Account
  5. flutter run -d (on my real device)

Smartphone / tablet

  • Device: [Iphone6s Plus]
  • OS: [e.g. iOS 14.6]
  • Package version: [v5.0.0]

Additional context
v5.0.0 is a major bump for the library fixing BLE on IOS devices include PR #137, #251, #307, #385, #387.
Opening Xcode project, I noted the are multiple Swift compiler error, "Can't find 'peripheral' in scope."

Recently I was using the lib in v4.0.0 Xcode12 the error from null-safety form the library v4.0.0 is resolved and it work by using override in dev_dependences (Follow README instruction for Xcode 12) bump up to BigSur install fresh v5.0.0 lib with Xcode 13.0 is not working.

FAQ
Does there are problem config for building with Intel base Mac (disable build for M1 compatible).
Dose I have to change Runner.IOS Development target in my project to '13.0' or > 13.0.
Does the package required Swift compatible version like '4.2.0' or '5.0'.
Dose I have to change Pod.reactive_ble_mobile.IOS Development target in my project to '13.0' or > 13.0.
Could you describe what problem that I encounter.

"Xcode error with libarry"
image

"Build error log v5.0.0 reactive_ble_mobile-5.0.0"

Xcode's output:
↳
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type: .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    /Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Intermediates.noindex/Pods.b
    uild/Debug-iphoneos/reactive_ble_mobile.build/Objects-normal/arm64/base.dia:1:1: warning: Could not read serialized
    diagnostics file: error("Invalid diagnostics signature") (in target 'reactive_ble_mobile' from project 'Pods')
    Command CompileSwift failed with a nonzero exit code
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type: .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    /Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Intermediates.noindex/Pods.b
    uild/Debug-iphoneos/reactive_ble_mobile.build/Objects-normal/arm64/bledata.pb.dia:1:1: warning: Could not read serialized
    diagnostics file: error("Invalid diagnostics signature") (in target 'reactive_ble_mobile' from project 'Pods')
    Command CompileSwift failed with a nonzero exit code
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type: .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    /Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Intermediates.noindex/Pods.b
    uild/Debug-iphoneos/reactive_ble_mobile.build/Objects-normal/arm64/BLEStatus.dia:1:1: warning: Could not read serialized
    diagnostics file: error("Invalid diagnostics signature") (in target 'reactive_ble_mobile' from project 'Pods')
    Command CompileSwift failed with a nonzero exit code
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type: .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    note: Removed stale file
    '/Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Products/Debug-iphoneos/Pod
    s_Runner.framework'

    note: Removed stale file
    '/Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Products/Debug-iphoneos/Run
    ner.app'

    note: Removed stale file
    '/Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Products/Debug-iphoneos/rea
    ctive_ble_mobile/reactive_ble_mobile.framework'

    note: Removed stale file
    '/Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Products/Debug-iphoneos/Swi
    ftProtobuf/SwiftProtobuf.framework'

    note: Removed stale file
    '/Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Products/Debug-iphoneos/Pro
    tobuf/Protobuf.framework'
@truonghoangduy truonghoangduy changed the title Cannot build example app on Xcode13 macOS 11.6 Cannot build v5.0.0 example app on Xcode13 macOS 11.6 Oct 21, 2021
@Taym95
Copy link
Collaborator

Taym95 commented Oct 21, 2021

Build normally on:
macOS : 11.4
Flutter SDK : v2.5.2
Xcode 13.0
IOS_Device : 14.6 (Real device)
flutter_reactive_ble : v5.0.0

IMG_965D7B3673DE-1

@truonghoangduy did you run pod install inside ios/ folder before building?

@remonh87
Copy link
Contributor

I am able to build it without problems. Can you run flutter clean and after that flutter pub get + pod install ?

@truonghoangduy
Copy link
Author

truonghoangduy commented Oct 21, 2021

@remonh87 @Taym95 Thank-you your guys proving me step to make sure to follow correctly. But it seem like not working! 🚫 . The error still occur any suggestion I could resolve this issue or dev environment I need to change?

Flutter SDK : v2.5.3
macOS : 11.6
Xcode: 13
flutter_reactive_ble : v5.0.0

➡️ I'm using git clone https://github.com/PhilipsHue/flutter_reactive_ble.git and then going to example folder to run the project.

Not working full CLI Log

Hoangs-MacBook-Pro:example hoangduy$ flutter clean
Cleaning Xcode workspace...                                         3.6s
Deleting build...                                                   12ms
Deleting .dart_tool...                                               0ms
Deleting .packages...                                                0ms
Deleting Generated.xcconfig...                                       0ms
Deleting flutter_export_environment.sh...                            0ms
Deleting Flutter.podspec...                                          0ms
Deleting .flutter-plugins-dependencies...                            0ms
Deleting .flutter-plugins...                                         0ms
Hoangs-MacBook-Pro:example hoangduy$ flutter pub get
Running "flutter pub get" in example...                          1,050ms
Hoangs-MacBook-Pro:example hoangduy$ cd ios/
Hoangs-MacBook-Pro:ios hoangduy$ pod install
Analyzing dependencies
Downloading dependencies
Installing Flutter (1.0.0)
Installing Protobuf (3.18.0)
Installing SwiftProtobuf (1.17.0)
Installing reactive_ble_mobile (0.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 2 dependencies from the Podfile and 4 total pods installed.

[!] Automatically assigning platform `iOS` with version `11.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] Your project does not explicitly specify the CocoaPods master specs repo. Since CDN is now used as the default, you may safely remove it from your repos directory via `pod repo remove master`. To suppress this warning please add `warn_for_unused_master_specs_repo => false` to your Podfile.
Hoangs-MacBook-Pro:ios hoangduy$ flutter run -d a3bdec9d0af351ab9ae1390a6ed6e61e782bacf3
Changing current working directory to: /Users/hoangduy/Desktop/University/GoogleDSC/Project/flutter_reactive_ble/example
Launching lib/main.dart on NTS in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: QY4ZB6YX2T
Running pod install...                                           1,565ms
Running Xcode build...                                                  
Xcode build done.                                           12.2s
Failed to build iOS app
Error output from Xcode build:
↳
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
    { platform:iOS, id:a3bdec9d0af351ab9ae1390a6ed6e61e782bacf3, name:NTS, error:Device is busy (Making NTS ready for
    development, Processing cache files from device) }
    { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS
    Simulator Device }
    { platform:iOS Simulator, id:7389B995-D241-4187-AB62-92E1EE7979EB, OS:15.0, name:iPad (9th generation) }
    { platform:iOS Simulator, id:C1E65DC3-ACC7-4295-9487-82B45AA74429, OS:15.0, name:iPad Air (4th generation) }
    { platform:iOS Simulator, id:F23E1E4F-666A-4236-9ACE-911803B371F3, OS:15.0, name:iPad Pro (9.7-inch) }
    { platform:iOS Simulator, id:BD4F4876-76E1-4558-AC2D-6ECCB4207141, OS:15.0, name:iPad Pro (11-inch) (3rd generation) }
    { platform:iOS Simulator, id:BACACF13-DAD1-431D-8B32-09C5A2CADA1F, OS:15.0, name:iPad Pro (12.9-inch) (5th generation) }
    { platform:iOS Simulator, id:E375B664-77BA-4028-AE92-D499A4BE37FD, OS:15.0, name:iPad mini (6th generation) }
    { platform:iOS Simulator, id:952AB5BD-E5A8-4D50-AC24-6906A9F2E791, OS:15.0, name:iPhone 8 }
    { platform:iOS Simulator, id:805C61F7-A72A-4231-8384-8C3B08088A78, OS:15.0, name:iPhone 8 Plus }
    { platform:iOS Simulator, id:3956535F-A093-4995-963B-4270CAB09B82, OS:15.0, name:iPhone 11 }
    { platform:iOS Simulator, id:85A582A5-C2E4-4444-A0C2-0A280AE54A49, OS:15.0, name:iPhone 11 Pro }
    { platform:iOS Simulator, id:E767D9BE-0B4E-4AE6-8C04-EB9AE15EB428, OS:15.0, name:iPhone 11 Pro Max }
    { platform:iOS Simulator, id:AF2C65C1-ECD1-4804-902A-E55F9CB80377, OS:15.0, name:iPhone 12 }
    { platform:iOS Simulator, id:972A88FE-22F3-43B2-8128-3DC4337E1CD5, OS:15.0, name:iPhone 12 Pro }
    { platform:iOS Simulator, id:80C42E7D-6477-4C22-9FFF-2E2177DD3D40, OS:15.0, name:iPhone 12 Pro Max }
    { platform:iOS Simulator, id:C0959E4A-82C9-4DBE-9370-7E16B98174B3, OS:15.0, name:iPhone 12 mini }
    { platform:iOS Simulator, id:1F794C62-F51A-4C2E-B02D-B3083B3C81D3, OS:15.0, name:iPhone 13 }
    { platform:iOS Simulator, id:109DC640-700F-40D9-BD8D-439F9168A0ED, OS:15.0, name:iPhone 13 Pro }
    { platform:iOS Simulator, id:F62BD08B-690C-4BAA-A573-5EF6F127CD9E, OS:15.0, name:iPhone 13 Pro Max }
    { platform:iOS Simulator, id:6F0B11C5-3E81-4DA0-8EB6-438B2BB09003, OS:15.0, name:iPhone 13 mini }
    { platform:iOS Simulator, id:BD17661F-8055-4F7F-9B5F-61E401617C35, OS:15.0, name:iPhone SE (2nd generation) }
    { platform:iOS Simulator, id:2CBEA06D-D20A-494E-912C-E0ED713C05C4, OS:15.0, name:iPod touch (7th generation) }
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type:
            .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    /Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-abkatgsyeqravvfpqnasusohrkvu/Build/Intermediates.noindex/Pods
    .build/Debug-iphoneos/reactive_ble_mobile.build/Objects-normal/arm64/base.dia:1:1: warning: Could not read serialized
    diagnostics file: error("Invalid diagnostics signature") (in target 'reactive_ble_mobile' from project 'Pods')
    Command CompileSwift failed with a nonzero exit code
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type:
            .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    /Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-abkatgsyeqravvfpqnasusohrkvu/Build/Intermediates.noindex/Pods
    .build/Debug-iphoneos/reactive_ble_mobile.build/Objects-normal/arm64/bledata.pb.dia:1:1: warning: Could not read
    serialized diagnostics file: error("Invalid diagnostics signature") (in target 'reactive_ble_mobile' from project
    'Pods')
    Command CompileSwift failed with a nonzero exit code
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type:
            .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    /Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-abkatgsyeqravvfpqnasusohrkvu/Build/Intermediates.noindex/Pods
    .build/Debug-iphoneos/reactive_ble_mobile.build/Objects-normal/arm64/BLEStatus.dia:1:1: warning: Could not read
    serialized diagnostics file: error("Invalid diagnostics signature") (in target 'reactive_ble_mobile' from project
    'Pods')
    Command CompileSwift failed with a nonzero exit code
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type:
            .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/C
    entral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel

Could not build the precompiled application for the device.

Error launching application on NTS.

@Taym95
Copy link
Collaborator

Taym95 commented Oct 21, 2021

Sorry, but something wrong with your setup, me, @remonh87, and our CI always building the project for ios.

@truonghoangduy
Copy link
Author

Sorry, but something wrong with your setup, me, @remonh87, and our CI always building the project for ios.

Thanks for the info I assume it as well.

@truonghoangduy
Copy link
Author

I found down it could because of a cache problem when I upgrade from 4.0.0 (Xcode12) -> 5.0.0 (Xcode13) [macOS upgrade also] seem like repair pub cache in global work

flutter pub cache repair

@iameerhamza
Copy link

Enviorment macOS : 11.6 (Big Sur lasted) Intel Base macOS ↙️ Flutter SDK : v2.5.1 Xcode 13.0 IOS_Device : 14.6 (Real device) flutter_reactive_ble : v5.0.0

Describe the bug I could not build the example version in the GitHub repo, Pod library error, spec macOS 11.6 Intel base Xcode 13.0 with flutter_reactive_ble : v5.0.0 example app

To Reproduce

  1. git clone https://github.com/PhilipsHue/flutter_reactive_ble.git
  2. cd example
  3. flutter pub get
  4. Re-signing the project with my Xcode Account
  5. flutter run -d (on my real device)

Smartphone / tablet

  • Device: [Iphone6s Plus]
  • OS: [e.g. iOS 14.6]
  • Package version: [v5.0.0]

Additional context v5.0.0 is a major bump for the library fixing BLE on IOS devices include PR #137, #251, #307, #385, #387. Opening Xcode project, I noted the are multiple Swift compiler error, "Can't find 'peripheral' in scope."

Recently I was using the lib in v4.0.0 Xcode12 the error from null-safety form the library v4.0.0 is resolved and it work by using override in dev_dependences (Follow README instruction for Xcode 12) bump up to BigSur install fresh v5.0.0 lib with Xcode 13.0 is not working.

FAQ Does there are problem config for building with Intel base Mac (disable build for M1 compatible). Dose I have to change Runner.IOS Development target in my project to '13.0' or > 13.0. Does the package required Swift compatible version like '4.2.0' or '5.0'. Dose I have to change Pod.reactive_ble_mobile.IOS Development target in my project to '13.0' or > 13.0. Could you describe what problem that I encounter.

"Xcode error with libarry" image

"Build error log v5.0.0 reactive_ble_mobile-5.0.0"

Xcode's output:
↳
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type: .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    /Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Intermediates.noindex/Pods.b
    uild/Debug-iphoneos/reactive_ble_mobile.build/Objects-normal/arm64/base.dia:1:1: warning: Could not read serialized
    diagnostics file: error("Invalid diagnostics signature") (in target 'reactive_ble_mobile' from project 'Pods')
    Command CompileSwift failed with a nonzero exit code
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type: .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    /Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Intermediates.noindex/Pods.b
    uild/Debug-iphoneos/reactive_ble_mobile.build/Objects-normal/arm64/bledata.pb.dia:1:1: warning: Could not read serialized
    diagnostics file: error("Invalid diagnostics signature") (in target 'reactive_ble_mobile' from project 'Pods')
    Command CompileSwift failed with a nonzero exit code
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type: .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    /Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Intermediates.noindex/Pods.b
    uild/Debug-iphoneos/reactive_ble_mobile.build/Objects-normal/arm64/BLEStatus.dia:1:1: warning: Could not read serialized
    diagnostics file: error("Invalid diagnostics signature") (in target 'reactive_ble_mobile' from project 'Pods')
    Command CompileSwift failed with a nonzero exit code
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:230:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:233:9: error: cannot find 'peripheral' in scope
            peripheral.readValue(for: characteristic)
            ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:255:15: error: cannot find 'peripheral' in scope
            guard peripheral = characteristic.service.peripheral
                  ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:260:44: error: cannot find 'peripheral' in scope
                action: { $0.start(peripheral: peripheral) }
                                               ^~~~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:273:15: error: cannot find 'response' in scope
            guard response = characteristic.service?.peripheral.writeValue(value, for: characteristic, type: .withoutResponse)
                  ^~~~~~~~
    /Users/hoangduy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/reactive_ble_mobile-5.0.0/ios/Classes/ReactiveBle/Cen
    tral.swift:276:16: error: cannot find 'response' in scope
            return response
                   ^~~~~~~~
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    note: Removed stale file
    '/Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Products/Debug-iphoneos/Pod
    s_Runner.framework'

    note: Removed stale file
    '/Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Products/Debug-iphoneos/Run
    ner.app'

    note: Removed stale file
    '/Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Products/Debug-iphoneos/rea
    ctive_ble_mobile/reactive_ble_mobile.framework'

    note: Removed stale file
    '/Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Products/Debug-iphoneos/Swi
    ftProtobuf/SwiftProtobuf.framework'

    note: Removed stale file
    '/Users/hoangduy/Library/Developer/Xcode/DerivedData/Runner-ehhzbeviubywkvedvxfzyrywvcxk/Build/Products/Debug-iphoneos/Pro
    tobuf/Protobuf.framework'

Hi,
i am getting the same issue can you help me that how you resolved this issue,
Thanks in advance.

@Taym95
Copy link
Collaborator

Taym95 commented Nov 22, 2021

Please try to clean your flutter project, flutter pub cache repair, git clean -dfx, flutter clean...

@iameerhamza
Copy link

done that many times but still no help.

@iameerhamza
Copy link

it is working absolutely fine for android.

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

4 participants