• Robert Munro

    Robert Munro

    1 month ago
    i'm trying to implement the background worker in
    iosMain
    https://medium.com/mobil-dev/background-task-with-bgtaskscheduler-1d49e22b1519 I seem to be able to get the
    BGTaskScheduler
    fine but i cant import the
    Operation
    class needed to schedule the actual work. would it be named differently? or access the
    operationQueue
    .
    override fun createBatchAndAppendBoxesToIt(
        localBatchId: String,
        batchTimestamp: Long,
        batchName: String,
        boxes: List<LocalBox>
    ) {
        val identifier = createUniqueWorkName(localBatchId)
        BGTaskScheduler.sharedScheduler.registerForTaskWithIdentifier(identifier, null) { task ->
            val request = BGAppRefreshTaskRequest(identifier)
            request.earliestBeginDate = null
            try {
                // what's this do? pointer for submitError? CPointer<ObjCObjectVar<NSError?>>?
                BGTaskScheduler.sharedScheduler.submitTaskRequest(request, null)
            } catch (e: Exception) {
                Logger.error(TAG, "Could not schedule app refresh", e)
            }
            val operation = CreateBatchWorker() // should inherit from Operation
            //task!!.expirationHandler = { operation.cancel() }
            //operation.completionBlock = { task.setTaskCompleted(!operation.isCancelled) }
            //operationQueue.addOperation(operation)
    
        }
    }
    Would it be better to make an interface and implement it in swift? not sure
    Robert Munro
    1 replies
    Copy to Clipboard
  • e

    elect

    1 month ago
    as info for the MP Gradle plugin team:
    The TestReport.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the destinationDirectory property instead. See https://docs.gradle.org/7.5/dsl/org.gradle.api.tasks.testing.TestReport.html#org.gradle.api.tasks.testing.TestReport:destinationDir for more details.
    The TestReport.reportOn(Object...) method has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the testResults method instead. See https://docs.gradle.org/7.5/dsl/org.gradle.api.tasks.testing.TestReport.html#org.gradle.api.tasks.testing.TestReport:testResults for more details.
    The Report.enabled property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the required property instead. See https://docs.gradle.org/7.5/dsl/org.gradle.api.reporting.Report.html#org.gradle.api.reporting.Report:enabled for more details.
  • xxfast

    xxfast

    1 month ago
    buildSrc/build.gradle.kts
    repositories {
      mavenCentral()
      maven("<https://kotlin.bintray.com/kotlinx>")
      maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
    }
    
    plugins {
      `kotlin-dsl`
    }
    build.gradle.kts
    buildscript {
      repositories { .. }
    
      dependencies {
        classpath(Android.buildTools) // "com.android.tools.build:gradle:7.2.1
        ..
        classpath(Jetbrains.Kotlin.gradlePlugin) // org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10
        ..
      }
    }
    xxfast
    Joakim Forslund
    +2
    10 replies
    Copy to Clipboard
  • coolcat

    coolcat

    1 month ago
    It used to be the case that KMM classes and my shared framework would autocomplete nicely in Xcode. But recently this has stopped for me, which is most inconvenient. Does anyone have any insight as to what might cause this?
    coolcat
    1 replies
    Copy to Clipboard
  • Landry Norris

    Landry Norris

    1 month ago
    I would like to use a C library in some of my shared code. I have the binaries and headers, and currently use cinterop on iOS, Android NDK, macOS, and Linux. I would like to use the cocoapod of this library on iOS to make dependency management easier. Is there a way to make sure the cocoapod’s cinterop gets commonized with my manual def files?
  • e

    Eugene Park

    1 month ago
    Hi there, I am trying to adopt KMP to define a common schema. I want to use reflection to get a
    Map<String, String>
    representation of a class's property names/values on Android/iOS. In my commonMain, I define something like expect fun getPropertyMap(object: BaseObject): Map<String, String>Where I may pass in some subclass like
    class Child : BaseObject()
    I was able to get this to work on Android, by using reflection, but am struggling with the iOS implementation. I have tried using the Kotlin
    platform.objc
    package, but it does not seem to be able to get the property names I also tried writing objective-c code in Xcode against the generated xcframework, but it also returns empty property list. I was wondering if anyone had some suggestions?
    e
    1 replies
    Copy to Clipboard
  • brabo-hi

    brabo-hi

    1 month ago
    hello guys, when using KMM, i am getting this error when running on IOS, what could be the issue
    > Task :shared:linkPodDebugFrameworkIosX64 FAILED
    e: Compilation failed: Could not initialize class kotlinx.cinterop.JvmCallbacksKt
    
     * Source files: 
     * Compiler version info: Konan: 1.7.0 / Kotlin: 1.7.20
     * Output kind: FRAMEWORK
    e: java.lang.NoClassDefFoundError: Could not initialize class kotlinx.cinterop.JvmCallbacksKt
  • e

    eygraber

    1 month ago
    Is there support for having an intermediate source set for android and jvm? I remember there is some issue when it comes to android + jvm but I don't remember exactly what it is
    e
    e
    +3
    15 replies
    Copy to Clipboard
  • d

    darkmoon_uk

    1 month ago
    It doesn't - at least not when iOS targets are involved, because the Qodana container runs Linux and wouldn't be able to run the necessary tooling to analyse the iOS part. Personally I would be very happy if I could use it to Analyse the Android target alone, since most of that is common with iOS anyway. This might be possible with some hack in the configuration code to 'hide' iOS when building in Qodana.