touchlab / xcode-kotlin

Kotlin Native Xcode Plugin
https://touchlab.co/xcodekotlin
Apache License 2.0
1.11k stars 45 forks source link

Breakpoints became disable when we run the app #101

Closed JJesus-WIT closed 9 months ago

JJesus-WIT commented 9 months ago

Summary

I have created a sample KMM framework project and have installed the plugin. What's happen is when I run the app on Xcode the breakpoints on KMM files, became disabled.

Anyone know's what can be the issue?

Details

Xcode: 15 Sample: KMM framework Sample: MyApplication.zip

Reproduction

Run the Workspace app with the simulator

Expected result

The breakpoints on the Greetings files should not became disabled, and should stop on the breakpoint

Screenshots

info command info command

Issue Labels

TadeasKriz commented 9 months ago

I've seen this happen when LLDB can't match the source file locations. Can you verify the KMP framework is compiled in Debug configuration?

EDIT: Oh, I missed the reproducer you included, I'll take a look at it, thanks!

JJesus-WIT commented 9 months ago

Note: I have this working on a production project, but for some reason, this new sample doesn't detect the breakpoint.

kpgalligan commented 9 months ago

It looks like you had "Copy items into destination group's folder (if needed)" checked (see docs). There's an extra local copy of the source files in your iosApp folder. Xcode needs to point at the actual source file. I moved those in my local copy and it works.

Screenshot 2023-10-30 at 8 45 09 AM
JJesus-WIT commented 9 months ago

true! i forgot to uncheck the "Copy items into destination group's folder (if needed)"

Thank you for your help! 💪