{"action":"created","issue":{"url":"https://api.github.com/repos/JetBrains/kotlin-native/issues/1841","repository_url":"https://api.github.com/repos/JetBrains/kotlin-native","labels_url":"https://api.github.com/repos/JetBrains/kotlin-native/issues/1841/labels{/name}","comments_url":"https://api.github.com/repos/JetBrains/kotlin-native/issues/1841/comments","events_url":"https://api.github.com/repos/JetBrains/kotlin-native/issues/1841/events","html_url":"https://github.com/JetBrains/kotlin-native/issues/1841","id":347880109,"node_id":"MDU6SXNzdWUzNDc4ODAxMDk=","number":1841,"title":"Imported Swift framework can’t be used in Kotlin Multiplatform even with @objc attribute.","user":{"login":"VitMichal","id":16579296,"node_id":"MDQ6VXNlcjE2NTc5Mjk2","avatar_url":"https://avatars3.githubusercontent.com/u/16579296?v=4","gravatar_id":"","url":"https://api.github.com/users/VitMichal","html_url":"https://github.com/VitMichal","followers_url":"https://api.github.com/users/VitMichal/followers","following_url":"https://api.github.com/users/VitMichal/following{/other_user}","gists_url":"https://api.github.com/users/VitMichal/gists{/gist_id}","starred_url":"https://api.github.com/users/VitMichal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VitMichal/subscriptions","organizations_url":"https://api.github.com/users/VitMichal/orgs","repos_url":"https://api.github.com/users/VitMichal/repos","events_url":"https://api.github.com/users/VitMichal/events{/privacy}","received_events_url":"https://api.github.com/users/VitMichal/received_events","type":"User","site_admin":false},"labels":[{"id":1016306910,"node_id":"MDU6TGFiZWwxMDE2MzA2OTEw","url":"https://api.github.com/repos/JetBrains/kotlin-native/labels/interop","name":"interop","color":"578ee0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-06T11:11:24Z","updated_at":"2018-08-07T13:36:27Z","closed_at":null,"author_association":"NONE","body":"I'm trying Kotlin Multiplatform: https://kotlinlang.org/docs/reference/multiplatform.html\r\nIn platform module I would like to use custom made swift framework. \r\n\r\nI've created swift framework with class `WrapperCompletable`. \r\nSwift framework source code:\r\n```swift\r\nimport Foundation\r\n\r\n@objc public class WrapperCompletable: NSObject { }\r\n```\r\nRegarding to [https://github.com/JetBrains/kotlin-native/blob/master/OBJC_INTEROP.md#kotlinnative-interoperability-with-swiftobjective-c](url) documentation: “Swift library can be used in Kotlin code if its API is exported to Objective-C with @objc”. \r\n\r\nThis framework is included in gradle script.\r\n\r\nGradle script:\r\n```gradle\r\nkonanArtifacts {\r\n    def frameworksDir = \"${projectDir}/Frameworks\"\r\n    def productsDir = frameworksDir\r\n    def helperLibDir = frameworksDir\r\n\r\n    interop(\"RxSwiftWrapperFramework\") {\r\n        defFile \"src/main/c_interop/RxSwiftWrapperFramework.def\"\r\n\r\n        compilerOpts \"-F${productsDir}\", \"-F${helperLibDir}\"\r\n        linkerOpts \"-F${productsDir}\", \"-F${helperLibDir}\"\r\n\r\n        includeDirs \"${frameworksDir}/RxSwiftWrapperFramework.framework/Headers\"\r\n    }\r\n\r\n    // Declare building into a framework.\r\n    framework('Multiweather') {\r\n        // The multiplatform support is disabled by default.\r\n        enableMultiplatform true\r\n        extraOpts '-module_name', ''\r\n\r\n        libraries {\r\n            artifact \"RxSwiftWrapperFramework\"\r\n        }\r\n\r\n        linkerOpts '-rpath', \"${frameworksDir}\"\r\n    }\r\n}\r\n```\r\n\r\nRxSwiftWrapperFramework.def  file:\r\n```\r\ndepends = Foundation\r\npackage = platform.RxSwiftWrapperFramework\r\nlanguage = Objective-C\r\nlinkerOpts = -framework RxSwiftWrapperFramework\r\ncompilerOpts = -fmodules -framework RxSwiftWrapperFramework\r\nheaders = RxSwiftWrapperFramework.h\r\n\r\n```\r\n\r\nThere is no error at importing of platform.RxSwiftWrapperFramework. But When I try to make an instance of class from this framework I'll get error: Unresolved reference: WrapperCompletable\r\n\r\n source code:\r\n```kotlin\r\npackage jh.shared.rx.infrastructure\r\n\r\nimport platform.RxSwiftWrapperFramework.*\r\n\r\nvar xxx = WrapperCompletable()\r\n```\r\n\r\nWhat should I do to make content of this framework visble in Kotlin platform module ?\r\n"},"comment":{"url":"https://api.github.com/repos/JetBrains/kotlin-native/issues/comments/411058431","html_url":"https://github.com/JetBrains/kotlin-native/issues/1841#issuecomment-411058431","issue_url":"https://api.github.com/repos/JetBrains/kotlin-native/issues/1841","id":411058431,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTA1ODQzMQ==","user":{"login":"SvyatoslavScherbina","id":22007028,"node_id":"MDQ6VXNlcjIyMDA3MDI4","avatar_url":"https://avatars1.githubusercontent.com/u/22007028?v=4","gravatar_id":"","url":"https://api.github.com/users/SvyatoslavScherbina","html_url":"https://github.com/SvyatoslavScherbina","followers_url":"https://api.github.com/users/SvyatoslavScherbina/followers","following_url":"https://api.github.com/users/SvyatoslavScherbina/following{/other_user}","gists_url":"https://api.github.com/users/SvyatoslavScherbina/gists{/gist_id}","starred_url":"https://api.github.com/users/SvyatoslavScherbina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SvyatoslavScherbina/subscriptions","organizations_url":"https://api.github.com/users/SvyatoslavScherbina/orgs","repos_url":"https://api.github.com/users/SvyatoslavScherbina/repos","events_url":"https://api.github.com/users/SvyatoslavScherbina/events{/privacy}","received_events_url":"https://api.github.com/users/SvyatoslavScherbina/received_events","type":"User","site_admin":false},"created_at":"2018-08-07T13:36:27Z","updated_at":"2018-08-07T13:36:27Z","author_association":"CONTRIBUTOR","body":"Gradle plugin should manage this automatically. But it is always better to ensure: please try to run `./gradlew clean` first, and then compile your project as usual."}}
{"actor":{"display_login":"SvyatoslavScherbina"}}