• Rohen Giralt

    Rohen Giralt

    2 years ago
    Hey, does anyone have any idea how to use resources (JSON files, images) in common code and have them exported to iOS and Android (or other platforms, too)? It’s possible for me to just store data in custom classes instead of JSON and copy new image assets to each application individually, but I’d rather not do that. If I’m not mistaken, it’s possible to create a dynamic framework on iOS for this, as well as an Android library on Android, so I’d imagine it’d be possible with some custom build.gradle. Do any of you have any experience with this? Thanks!
    Rohen Giralt
    Kris Wong
    +1
    5 replies
    Copy to Clipboard
  • Arkadii Ivanov

    Arkadii Ivanov

    2 years ago
    I'm trying to create the
    packForXcode
    Gradle task described here. But I'm getting the following error:
    Unresolved reference: targets
    . Basically
    kotlin.targets
    is unresolved here 😞 Do you have any ideas how to solve it?
    Arkadii Ivanov
    a
    +2
    20 replies
    Copy to Clipboard
  • Kurt Renzo Acosta

    Kurt Renzo Acosta

    2 years ago
    Does anyone know how to solve this? I'm trying to use Firestore's IgnoreExtraProperties on KMP.
    // Common
    expect annotation class IgnoreExtraProperties()
    
    // Android
    actual typealias IgnoreExtraProperties = com.google.firebase.firestore.IgnoreExtraProperties
    However, when I try to run it, I get a
    This class does not have a constructor
    . I also did this but no luck. Maybe it's because the actual annotation is just an interface?
    @Retention(RetentionPolicy.RUNTIME)
    @Target({ElementType.TYPE})
    public @interface IgnoreExtraProperties {
    }
    Anyway, any help would be greatly appreciated!
    Kurt Renzo Acosta
    1 replies
    Copy to Clipboard
  • andylamax

    andylamax

    2 years ago
    What is the cause of this error? It happens when I am have a multiplatform lib dependency
    > Task :generatePomFileForAndroidReleasePublication FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':generatePomFileForAndroidReleasePublication'.
    > Could not apply withXml() to generated POM
       > More than one variant of project :klock matches the consumer attributes:
           - Configuration ':klock:releaseApiElements' variant android-aidl:
               - Unmatched attributes:
                   - Found artifactType 'android-aidl' but wasn't required.
                   - Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
               - Compatible attributes:
                   - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found compatible value 'release'.
                   - Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
                   - Required org.jetbrains.kotlin.platform.type 'androidJvm' and found compatible value 'androidJvm'.
           - Configuration ':klock:releaseApiElements' variant android-manifest:
               - Unmatched attributes:
                   - Found artifactType 'android-manifest' but wasn't required.
                   - Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
               - Compatible attributes:
                   - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found compatible value 'release'.
                   - Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
                   - Required org.jetbrains.kotlin.platform.type 'androidJvm' and found compatible value 'androidJvm'.
           - Configuration ':klock:releaseApiElements' variant android-renderscript:
               - Unmatched attributes:
                   - Found artifactType 'android-renderscript' but wasn't required.
                   - Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
               - Compatible attributes:
                   - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found compatible value 'release'.
                   - Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
                   - Required org.jetbrains.kotlin.platform.type 'androidJvm' and found compatible value 'androidJvm'.
           - Configuration ':klock:releaseApiElements' variant android-symbol-with-package-name:
               - Unmatched attributes:
                   - Found artifactType 'android-symbol-with-package-name' but wasn't required.
                   - Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
               - Compatible attributes:
                   - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found compatible value 'release'.
                   - Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
                   - Required org.jetbrains.kotlin.platform.type 'androidJvm' and found compatible value 'androidJvm'.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at <https://help.gradle.org>
    
    BUILD FAILED in 1s
    14 actionable tasks: 1 executed, 13 up-to-date
    andylamax
    1 replies
    Copy to Clipboard
  • p

    Patrick Jackson

    2 years ago
    I've asked in here before, and will again. For those of you publishing libraries that support multiple architectures, is there an easier method other than acquiring access to machines of the support hardware and creating a build? To publish a library for all platforms I will need a mac, windows, and linux on a couple types of hardware. I see there is support for cross-platform compilation in the kotlin/native compiler, however does not seem possible from the multiplatform gradle plugin. Anyone have insight into this and when/if this situation will get better?
    p
    russhwolf
    +3
    20 replies
    Copy to Clipboard
  • m

    Mgj

    2 years ago
    Why cant you use RxJava with KMP? Im guessing its because of the Schedulers which have no implementation backing for the different target platforms? Seems odd though that i can add it as a dependency, but the namespaces and classes are just not there - an error would be nice
    m
    gildor
    +3
    66 replies
    Copy to Clipboard
  • n

    Nicolas Bourdin

    2 years ago
    Hello, Is it possible to integrate a kotlin native project (otherKnLib) as project dependencies (source folder) in another kotlin native project (common) ?
    - rootProject
    	- app
    	- iOS
    	- common
    		- src
    			- androidMain
    			- commonMain
    			- ...
    		- build.gradle
    	- otherKnLib
    		- src
    			- androidMain
    			- commonMain
    			- ...
    		- build.gradle
    	settings.gradle
    	build.gradle
    I tried to import my lib in the differents sourceSets dependencies in the common module, but I suppose I also have to specify the "target" (common, android, ios) for each sourceSet
    sourceSets {
    	val commonMain by getting {
    		implementation(project(":otherKnLib")
    	}
    
    	val androidMain by getting {
    		implementation(project(":otherKnLib")
    	}
    
    	val iosMain by getting {
    		implementation(project(":otherKnLib")
    	}
    }
    In this case, when i try to build, i got an
    Unresolved reference
    Any idea ? Thanks in advance 😃
    n
    andylamax
    3 replies
    Copy to Clipboard
  • Carl Hickman

    Carl Hickman

    2 years ago
    I'm about to embark on creating a multiplatform library for ios and Android. I don't want to spin my wheels getting started. I'm worried about running into outdated documentation. Where is the most up-to-date information about getting started?
    Carl Hickman
    kpgalligan
    +1
    18 replies
    Copy to Clipboard
  • s

    serebit

    2 years ago
    Are there any other desktop applications built with Kotlin/Native besides my own Wraith Master project? I assume there are, but I can't name any.
    s
    1 replies
    Copy to Clipboard
  • saket

    saket

    2 years ago
    if yes, I’m building a macOS app: github.com/saket/press
    saket
    e
    4 replies
    Copy to Clipboard