I have the following project structure. 1. An exis...
# fleet
c
I have the following project structure. 1. An existing Android app project that has been modified to make it multiplatform 2. An existing iOS app project, where the XCode project has been modified to point to the folder mentioned in step 1 above (taking inspiration from here) My question is: Is this a supported configuration for Fleet's cross-language code navigation feature? I've tried both the following and it seems like hit and miss 1. Simply open the iOS app project in Fleet. Cmd+Click on a symbol defined on the Kotlin side. This seems to work sometimes but I cannot figure out exactly the conditions under which it seems to work 2. Open the folder which contains both these projects in Fleet. In this case it doesn't seem to work at all. On the Android project side, everything works of course. The issue is on the iOS side for things like • Checking what are the implementations of a specific Kotlin interface (I want to see both the Kotlin and Swift side implementations) • Cmd+Click on a symbol from the Swift side and open the Kotlin-side definition of that symbol.
a
Hi, Florian @Florian Kistner [JB] Could you advise? Thanks.
c
I just realized I'm using XCode 14.3 and from here it looks like XCode 15 is the minimum supported version.
I returned to this after a few months and I'm still not sure if this is a supported configuration. I am trying by opening the folder that contains both the Android and iOS projects as a single "workspace" in Fleet What works: • On the Android side, everything works as expected • On the iOS side, I can navigate to symbols in shared code • On the shared code, I can navigate to callers/implementations on the Swift side What doesn't work: • Code completion on the Swift side. Neither code completion for symbols defined in the shared KMP code works; nor does code completion for Swift/iOS symbols. Here are my IDE versions: • Fleet version: build 1.36.104 • OS: Mac OS X (14.3.1, aarch64) • XCode 15.3 Can anyone confirm if my project setup is supported at all in Fleet?
m
Hey @curioustechizen! Could you help me identifying the source of your problem and try to: 1. Open Fleet on project list view 2. Call action
Configure Logging
goto panel 3. Add the following lines to end of your file
Copy code
[[logger]]
 name = "com.jetbrains.swift.sourcekitd.SourceKitService"
 all = "DEBUG"

[[logger]]
 name = "com.jetbrains.cidr.xcode.XCLog"
 all = "DEBUG"
4. Save & close this file, close Fleet 5. Copy your project to new directory (let's say it was
MyProject
, so just doing
cp -r MyProject1
in terminal is enough) 6. Open copied project in Fleet, wait until all loading statuses are finished (everything is indexed) 7. Call action
Collect Logs...
8. Share logs in thread or in private channel/ticket in our tracker with limited visibility to
jetbrains-team
c
@Maciej Procyk I'm collecting the logs. In the meanwhile, is there a difference between the following in Fleet? • Option 1: Open a "folder" containing Project1 and Project2 • Option 2: Instead of opening the entire folder, multi-select Project1 and Project2 (In the project list view in Fleet, this shows up as "Project1, Project2"
BTW in this case, my iOS project build failed because one of the dependencies is to an SSH Git URL and I did not find a way to configure that for Fleet.
m
I think that if we're speaking about cross-language references support (like Kotlin-Swift), you're supposed to open parent folder. But Xcode project has to be configured to depend on the gradle/amper project in its build phase. Does the Xcode part build correctly directly in Xcode for you? Could you share how you've configured the Xcode part, to link one project to another? Could you try configuring your project to have an access to the mentioned dependency, to make it build successfully? At first glance, that seems to be the source of not working completion in Swift files.
c
I think I should have added some backstory: • The iOS and Android codebases started off as separate codebases (separate Git repos). • About 10 months back, we started introducing KMP into the codebase. All KMP code lives in the Android repo • The XCode project has been modified as described in the KMP documentation. Specifically, in the Build Phases -> Run script, we point to the Android source which is a sibling of the iOS source • We have been publishing apps in production this way on both App store and Play store for the past 10 months (of course, using separate IDEs - XCode and AS). Here's what the Run Script looks like in XCode.
Copy code
cd "$SRCROOT/../MyAndroidProject"
./gradlew :kmm-shared:embedAndSignAppleFrameworkForXcode
I'm assuming that importing such a project into Fleet should work; but I also think I'm making a mistake in the way I open/import the project.
🆗 1
Could you try configuring your project to have an access to the mentioned dependency, to make it build successfully?
I think XCode has some UI to configure git ssh. Should Fleet be able to pick this from the XCode settings? If not, I think in your step 6 above, I should first open the project in XCode to make sure the git ssh dependency works; then I should open it in Fleet.
m
Yes, opening project in Xcode before 6. shouldn't be harmful to the process, you can try that way. But I'm not aware of the settings that you can change with Xcode UI in terms of git, could you elaborate on that?
c
I think I mis-spoke. I don't see any such UI in XCode. I guess this is not something that IDEs should bother about anyway.
Now I'm not sure why the git ssh repo could not be cloned. If fleet just uses the command line git then it ought to work seamlessly.
m
So when you open your project in Xcode, it's able to clone the dependency repo, while in Fleet you get some errors in this context? Could you share what are they?
The thing is that we might need to have the project in compilable state to get some information from SourceKit, being language server for Swift files
c
Okay. The thing is, in my original project (not the one that I created a copy), I can run the iOS app from Fleet. But I assume that somehow the git ssh dependency was resolved by XCode in the past, that's why it just worked from Fleet. Trying to see if I can get to the same state when I open the copy project from Fleet.
m
ohh, ok, so try the other way. This can get messed up indeed when you copy the project having git configured. So instead of copying the project, please try cloning it to the other parent directory (to have another absolute path location). Then open, wait, collect the logs and share, please. Sorry for the confusion 🙏🏻
c
Got it (I should have thought of that). I'm not sure if I can get it today though. I'll update this thread whenever I have the time to do this.
m
sure, feel free to come back to that when you've got time, we should get notification about that
👍🏽 1
c
So while I was trying to repro the problem on a clean checkout, I see that the git ssh dependency is still not resolved. However, all my other code navigation issues seem to have been fixed. • I get Swift/SwiftUI/iOS APIs autocomplete suggestions as expected • Navigating between Swift and Kotlin files works as expected • In general everything works as I would expect
The only difference I see is that this time I opened the entire folder in fleet instead of multi-selecting my Android and iOS projects separately,
m
That's good news, anyway it'd worth finding the source of your issues. For sure, the cases that we test most often consider opening parent folder with xcode and gradle subprojects, I doubt opening separate ones should work in terms of cross-language resolve. Have you updated the Fleet since last time btw?
c
Yes I have updated Fleet to Fleet version: build 1.37.84 OS: Mac OS X (14.3.1, aarch64)
Regarding the git ssh issue, I found a couple of other issues (including one on YouTrack) related to this: https://youtrack.jetbrains.com/issue/OC-23027/AppCode-cant-reload-app-based-SPM-because-of-scmProvider-xcode-when-using-Xcode-14-in-EAP https://stackoverflow.com/questions/69761667/server-ssh-fingerprint-failed-to-verify I'm going to try the work-around described in the YouTrack link above; just to verify if it works.
Well turns out the registry work-around is specific to AppCode
m
The Fleet-specific solution is under development and should be available in the next release, so stay tuned for it 🤞🏻
👍🏽 1