-
Notifications
You must be signed in to change notification settings - Fork 153
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
Example iOS app doesn't build - due to missing file? (Cannot find type 'Communications_PbPFtpOperation' in scope) #481
Comments
I am having the same issue with PolarBleSdk 5.7.0. |
I copied in the file to:
Then in XCode right-click on the (For two nights it worked perfectly, on another two nights it stopped recording at some point in the night and only offered small recordings, battery fine on all nights, charging on all but one of the problem nights. I doubt these issues are related.) I haven't created a PR because someone more experienced than I should confirm that this is all that needs doing or all that is missing. I don't know how packaging/linking works in XCode yet. |
Okay, thank you. I'll try to fix it. |
If you have problems let me know and I'll push my project, but I'm new to iOS development so no guarantees!
|
I also have the same issue, is there any solution yet? |
Platform on which you observed the bug:
Device on which you observed the bug:
Describe the bug
pod install
in the root of the example iOS projectpolar-ble-sdk/examples/example-ios/iosBleSdkTestApp/
The build fails with: "
Cannot find type 'Communications_PbPFtpOperation' in scope
"How to Reproduce
I have done this from a fresh clone.
Prior to the above, I had set up XCode and run:
I am not aware of anything else out of the ordinary. I am running XCode 15.4 on an M1.
protoc
andprotoc-gen-swift
seem to be installed OK and on myPATH
. I tried adding SwiftProtoBuf to the project dependencies. I also tried the steps on the SwiftProtobuf github readme at https://github.com/apple/swift-protobuf . Tried restarting etc. Build still broken.My
Podfile.lock
contains:If I unlock the files (which are locked as they are part of the SDK, not part of the example app), and replace both occurrences of
Communications_PbPFtpOperation
withProtocol_PbPFtpOperation
, the project builds and runs. I haven't got far enough to see whether it works, but this seems unlikely to be the solution, as surely someone would have noticed a critical build error in the SDK before me?I also had to disable user script sandboxing in my project settings to enable rsync writing to
.../Build/Products/Debug-iphonesimulator/iosBleSdkTestApp.app/Frameworks/PolarBleSdk.framework/_CodeSignature
, as suggested here: https://stackoverflow.com/a/76626156/1308967 These are the lines I had to edit:https://github.com/polarofficial/polar-ble-sdk/blob/master/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/impl/protobuf/pftp_request.pb.swift#L190
https://github.com/polarofficial/polar-ble-sdk/blob/master/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/gatt/client/psftp/BlePsFtpClient.swift#L339
I have found the definition of
Communications_PbPFtpOperation
here:iOS/ios-communications/Sources/iOSCommunications/ble/api/model/protobuf/communications_pftp_request.pb.swift
This suggests that some of the proto definitions have not been built as Swift, and I need to run
protoc --swift_out=. my.proto
myself. (This is done for you in the Gradle spec on the Android example app.) Copying this into the example app treeiosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/protobuf
doesn't help, so even if I runprotoc --swift_out=. *.proto
I don't know what to do with the output.Proto definitions seem to be homed in the Android app?
Update: I copied in the file to:
polar-ble-sdk/examples/example-ios/iosBleSdkTestApp/Pods/PolarBleSdk/sources/iOS/ios-communications/Sources/iOSCommunications/ble/api/model/protobuf/communications_pftp_request.pb.swift
Then in XCode right-click on the
PolarBleSdk
Pod then add the file to the project, then it seems to build, although I am not sure if it works, or what else of the above was necessary.Expected behavior
I expect the example project build.
Screenshots and logs
Full build log:
The text was updated successfully, but these errors were encountered: