question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

generated sources are recognized as iOS source in Multiplatform Project

See original GitHub issue

when I build the project, SQLDelight sources are generated but recognized as iOS source set, thus can not be referenced from common source set.

below is the excerpt of my configuration.

Android Studio: 3.4-beta05 Kotlin: 1.3.21 SQLDelight: 1.1.1 Gradle: 5.1.1

sqldelight {
    Database {
        packageName = 'com.codingfeline.github.data.local'
    }
}

kotlin {
	android()
	targetFromPreset(presets.getByName("iosX64"), "ios") {
		binaries {
			framework()
		}
	}
}

.sq files are placed at src/commonMain/sqldelight/

and here’s the complete project: https://github.com/yshrsmz/GitHubKotlinMPPSample/tree/sqldelight1.1.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
designatednerdcommented, Mar 25, 2019

Quick fix is to just only add the generated dir as a source root for common. Could you elaborate on how you’d accomplish this? I’m at a point where I can’t get anything to even import in my common code, even though I see the generated classes with an [iosMain] tag next to them.

0reactions
manu0396commented, Feb 20, 2022

Could you get you some solution to this? Same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

generated sources are recognized as iOS source in ... - GitHub
when I build the project, SQLDelight sources are generated but recognized as iOS source set, thus can not be referenced from common source...
Read more >
Current issues with Kotlin Multiplatform and how to fix them
Renaming the Android source set. The project is created with a few source sets commonMain , commonTest , iosMain etc. However, the Android ......
Read more >
Kotlin multiplatform: Accessing build variables in code
Gradle doesn't recognise ./build/generated-src/kotlin/ as a source directory. We can fix both in one go! Linking the task to the source set. You ......
Read more >
Enable iosMain sourceSet in Kotlin Multiplatform Mobile projects
When using Kotlin Multiplatform Mobile, you come across an unusual feature — the iOS code is considered by the compiler in several versions: ......
Read more >
Missing module on multiplatform project - Kotlin Discussions
Why the module is not properly recognized by IJ IDEA, but the sources are correctly solved by the IDE, it's a question that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found