Has anyone run into an issue where Xcode's intelli...
# kotlin-native
b
Has anyone run into an issue where Xcode's intellisense stops being able find/show methods from the Kotlin framework?
r
One thing that can go wrong is, the Kotlin framework needs to be built for Xcode to be able to detect what's in it. So if you just did a clean then Xcode won't be able to read the Kotlin API. No clue if that's actually your issue, but it's one possibility.
b
I found a thread in #C3PQML5NU from back in March where someone else had the exact same problem, and found a workaround to fix it. Basically, when doing direct integration (a build phase script to run the
embedAndSignAppleFrameworkForXcode
gradle task), something doesn't work right and some files that xcode uses for indexing don't wind up in the right place. The work around is to add some additional code to that build phase script to "manually" copy the appropriate files to the right place. It looks like this:
Copy code
cd "$SRCROOT/.."
./gradlew :shared:embedAndSignAppleFrameworkForXcode

# Add these lines to manually copy files for indexing
DERIVED_DATA_DIR=$(echo "${TARGET_BUILD_DIR}" | awk -F'/Build/' '{print $1}')

INDEXER_DATA_DIR=${DERIVED_DATA_DIR}/Index.noindex/Build/Products/Debug-$PLATFORM_NAME
mkdir -p $INDEXER_DATA_DIR
cp -R shared/build/xcode-frameworks/$CONFIGURATION/$SDK_NAME/* ${INDEXER_DATA_DIR}
Here's a link to the old thread: https://kotlinlang.slack.com/archives/C3PQML5NU/p1709811731499599
🙌 1