Rahul
12/07/2022, 9:02 AMGiorgi
12/07/2022, 8:04 PMdorche
12/07/2022, 9:28 PMKevin S
12/08/2022, 12:19 AMNinoosvanidze
12/08/2022, 7:19 AMval ktorVersion = "2.1.2"
Exception doesn't match @Throws-specified class list and thus isn't propagated from Kotlin to Objective-C/Swift as NSError.
It is considered unexpected and unhandled instead. Program will be terminated.
Uncaught Kotlin exception: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen io.ktor.client.request.HttpRequestPipeline@1cfa708
Pablo
12/08/2022, 10:03 AMfun longJobFunction(): MutableList<BigData>{
var bigDataList = mutableStateListOf<BigData>()
CoroutineScope(Dispatchers.Main).launch {
withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
//fill bigDataList with big data
Thread.sleep(5000)
}
}
return bigDataList
}
But it gives this exception java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'
Rahul
12/08/2022, 12:42 PMkotlin {
android()
iosArm64("native") {
binaries {
framework {
baseName = "Demo"
}
}
}
sourceSets {
val commonMain by getting {
implementation("de.voize:pytorch-lite-multiplatform:0.5.0")
}
}
}
while generating framework I am getting following error
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_TorchModule", referenced from:
objc-class-ref in result.o
"_OBJC_CLASS_$_Tensor", referenced from:
objc-class-ref in result.o
"_OBJC_CLASS_$_IValueWrapper", referenced from:
objc-class-ref in result.o
ld: symbol(s) not found for architecture arm64
Given library is multiplatform library
Can anybody help?
Hee Fan
12/09/2022, 7:17 AMJohn O'Reilly
12/09/2022, 12:02 PMmain
function in code in jvmMain
in KMP shared code from within Android Studio....but not from IntelliJ?Ninoosvanidze
12/09/2022, 4:03 PMeygraber
12/09/2022, 6:39 PMkotlin.mpp.androidSourceSetLayoutVersion=2
that doesn't require reading the source 😅Seth Madison
12/10/2022, 12:42 AModay
12/10/2022, 5:37 PMLoe
12/11/2022, 2:30 AMval commonMain by getting {
dependencies {
// Firebase: Import the BoM for the Firebase platform
implementation(project.dependencies.platform("com.google.firebase:firebase-bom:31.0.2"))
// Firebase: Cloud Firestore library BoM doesn't specify versions in Firebase library dependencies
implementation("com.google.firebase:firebase-firestore-ktx")
// Firebase: crashlytics
implementation("com.google.firebase:firebase-crashlytics")
// Firebase: Authentication
implementation("com.google.firebase:firebase-auth-ktx")
// Coroutines support libraries for Kotlin - required by firebase-analytics
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4")
// TODO this is platform specific?
//implementation("com.google.firebase:firebase-analytics-ktx")
}
}
Error:
:shared:iosArm64Main: Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4.
Required by:
project :shared > com.google.firebase:firebase-firestore-ktx:24.4.0 > com.google.firebase:firebase-common-ktx:20.2.0
Possible solution:
- Declare repository providing the artifact, see the documentation at <https://docs.gradle.org/current/userguide/declaring_repositories.html>
Racci
12/11/2022, 3:50 AMChristian Würthenr
12/11/2022, 6:51 AMby lazy
part:
val preferences by lazy { SharedBaseInjector.get().preferences } // Crash in this line
fun something() {
SharedBaseInjector.get().preferences // This is fine
val x = preferences.someValue
....
}
In debug mode everything is fine. If I wrap the preferences variable in an object it’s also fine in release mode:
private object Cache {
val preferences by lazy { SharedBaseInjector.get().preferences }
}
fun something() {
val x = Cache.preferences.someValue
....
}
Anyone having a clue what’s going on? The object fixes it for me…but I’d still like to understand what’s going onSlackbot
12/12/2022, 11:38 AMMark Frelih
12/12/2022, 3:33 PM'pod install' command failed with an exception:
Cannot run program "pod" (in directory "/Users/markfrelih/AndroidStudioProjects/app-sdk/iosApp"): error=2, No such file or directory
Full command: pod install
Possible reason: CocoaPods is not installed
Please check that CocoaPods v1.10 or above is installed.
To check CocoaPods version type 'pod --version' in the terminal
To install CocoaPods execute 'sudo gem install cocoapods'
I have searched this channel for similar issues, tried googling it but nothing helps. 🤷 I’ve tried:
• Different versions of ruby
• Installing cocoapods via brew instead of gem
• https://stackoverflow.com/questions/70869813/android-studio-bumblebee-pod-install-command-failed-with-an-exception-error-2/70968187#70968187
The thing is that navigating to iosApp
folder and running pod install
manually works as expected. This is the output:
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
What is also interesting that I was able to solve it sometimes by running ./gradlew podInstall
manually and then I was able to sync the project. The things is that I can’t figure out why this sometimes works and sometimes doesn’t (at this moment I can’t get it to work at all). 😅
kdoctor only complains about cocoapods-generate, which is not compatible with ruby 3.0.0+ and afaik is not even needed now. I had it working without cocoapods-generate before. I tried for example using ruby 2.7.6 + cocoapods-generate installed, so kdoctor was all green, but I still could not sync the project.
My environment:
• cocoapods - 1.11.3
• Ruby - 3.0.3
• Android Studio - Dolphin | 2021.3.1 Patch 1
• Xcode - 13.3
• M1 mac
• macOS Monterey - 12.2
Any help is greatly appreciated! 🙏Виталий Перятин
12/12/2022, 3:41 PM./gradlew publishToMavenLocal
I get this error. What do I need to do to fix it?eygraber
12/12/2022, 4:24 PMGiorgi
12/12/2022, 6:44 PMKirill Zhukov
12/12/2022, 8:16 PMVinod Rai
12/13/2022, 7:23 AMModule "io.ktor:ktor-io (io.ktor:ktor-io-iosarm64)" has a reference to symbol kotlin.ranges/contains|-4666807430820256279[0]. Neither the module itself nor its dependencies contain such declaration.
build.gradle.kts
plugins {
kotlin("multiplatform")
id("com.android.library")
}
kotlin {
android()
val frameworkName = "EmtCore"
val ktorVersion = "2.2.1"
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "shared"
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("io.ktor:ktor-client-json:2.2.1")
implementation("com.russhwolf:multiplatform-settings:1.0.0-RC")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.ktor:ktor-network-tls:2.2.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
implementation("com.soywiz.korlibs.klock:klock:3.4.0")
implementation("io.ktor:ktor-client-logging:2.2.1")
implementation("com.squareup.sqldelight:runtime:1.5.4")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val androidMain by getting {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
//implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
api("io.ktor:ktor-client-logging-jvm:2.2.1")
implementation("io.ktor:ktor-client-json-jvm:2.2.1")
implementation("io.ktor:ktor-client-serialization-jvm:2.2.1")
implementation("com.squareup.okhttp3:logging-interceptor:4.9.0")
implementation("com.squareup.sqldelight:android-driver:1.4.3")
}
}
val androidTest by getting
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
dependencies {
implementation("io.ktor:ktor-client-darwin:$ktorVersion")
//implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
//implementation("io.ktor:ktor-client-serialization-iosarm64:1.4.0")
}
}
val iosX64Test by getting
val iosArm64Test by getting
val iosSimulatorArm64Test by getting
val iosTest by creating {
dependsOn(commonTest)
iosX64Test.dependsOn(this)
iosArm64Test.dependsOn(this)
iosSimulatorArm64Test.dependsOn(this)
}
}
val debugFatFramework by tasks.creating(org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask::class) {
baseName = frameworkName
from(
iosX64().binaries.getFramework("debug")
)
destinationDir = buildDir.resolve("fat-framework/debug")
group = "Universal framework"
description = "Builds a debug universal (fat) framework"
}
val releaseFatFramework by tasks.creating(org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask::class) {
baseName = frameworkName
from(
iosArm64().binaries.getFramework("release")
)
destinationDir = buildDir.resolve("fat-framework/release")
group = "Universal framework"
description = "Builds a release universal (fat) framework"
}
}
android {
namespace = "com.emtcore"
compileSdk = 33
defaultConfig {
minSdk = 21
targetSdk = 33
}
}
diego-gomez-olvera
05/05/2022, 3:51 PMOkHttp
and NSUrlSession
with code like:
// Android
public fun newHttpClient(nativeClient: OkHttpClient): HttpClient {
return HttpClient(OkHttp){
engine {
preconfigured = nativeClient
}
}
}
// iOS
public fun newHttpClient(nativeSession: NSURLSession): HttpClient {
return HttpClient(Darwin) {
engine {
configureSession { // how to do the same as Android?
}
}
}
}
I was wondering if someone uses this approach, and how does he/she configures the iOS HttpClient
Elio Maroun
12/13/2022, 11:55 AMimport kotlinx.datetime.toJavaLocalDate
import kotlinx.datetime.toJavaLocalTime
I am getting unresolved error when I remove these libraries from gradle although they are not related, I tried to invalidate cache and restart but still the same issue.
implementation("com.github.thellmund.Android-Week-View:core:5.2.4")
implementation("com.github.thellmund.Android-Week-View:jsr310:5.2.4")
implementation("com.github.thellmund.Android-Week-View:emoji:5.2.4")
implementation("com.himanshoe:kalendar-endlos:1.0.0")
Loe
12/13/2022, 4:53 PMld: framework not found FirebaseAuth
The solution [Described here] was to set isStatic = true
:
kotlin {
android()
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "shared"
isStatic = true <--------- This fixed it
}
. . .
}
Everything was working fine. Then it randomly started throwing a new linking error. I was also getting blank screen on iOS, but I resolved it by Erasing the simulator settings
Then now i’m getting the following linking issue:
Could not find or use auto-linked framework 'FirebaseAuth'
Could not find or use auto-linked framework 'GoogleUtilities'
Could not find or use auto-linked framework 'FirebaseCore'
Could not find or use auto-linked framework 'GTMSessionFetcher'
Could not find or use auto-linked framework 'FirebaseInstallations'
Could not find or use auto-linked framework 'GoogleAppMeasurement'
Could not find or use auto-linked framework 'GoogleAppMeasurementIdentitySupport'
Could not find or use auto-linked framework 'FirebaseCoreDiagnostics'
Could not find or use auto-linked framework 'GoogleDataTransport'
Could not find or use auto-linked framework 'nanopb'
Could not find or use auto-linked framework 'FirebaseAnalytics'
Could not find or use auto-linked framework 'PromisesObjC'
Undefined symbol: _FIRAuthErrorDomain
Undefined symbol: _OBJC_CLASS_$_FIRUser
Undefined symbol: _OBJC_CLASS_$_FIRMultiFactorSession
Undefined symbol: _OBJC_CLASS_$_FIRPhoneAuthProvider
Undefined symbol: _OBJC_CLASS_$_FIRAuthDataResult
Undefined symbol: _OBJC_CLASS_$_FIRGoogleAuthProvider
Undefined symbol: _OBJC_CLASS_$_FIRMultiFactorInfo
Undefined symbol: _OBJC_CLASS_$_FIREmailAuthProvider
Undefined symbol: _OBJC_CLASS_$_FIRGitHubAuthProvider
Undefined symbol: _OBJC_CLASS_$_FIRFacebookAuthProvider
Undefined symbol: _OBJC_CLASS_$_FIRActionCodeSettings
Undefined symbol: _OBJC_CLASS_$_FIRTwitterAuthProvider
Undefined symbol: _OBJC_CLASS_$_FIRAuth
Undefined symbol: _OBJC_CLASS_$_FIROAuthProvider
Undefined symbol: _OBJC_CLASS_$_FIROptions
Undefined symbol: _OBJC_CLASS_$_FIRActionCodeInfo
Undefined symbol: _OBJC_CLASS_$_FIRAuthTokenResult
Undefined symbol: _OBJC_CLASS_$_FIRApp
My Android app runs fine, but iOS is not working. btw I am following Make your Android application work on iOS – tutorialDaniel
12/13/2022, 9:55 PMsuspend fun doLogout(token: String) {
val userId = appService.currentUser!!.id
realm.write {
var user = query<UserInfo>("_id = $0", userId).first().find()
if (user != null) {
user = findLatest(user)!!.also {
it.FCMToken.remove(token)
}
copyToRealm(user)
}
}
withContext(Dispatchers.Default) {
appService.currentUser?.logOut()
}
}
the way that I call on the swiftUI:
func doLogout(){
repo.doLogout(token: myFCMToken){error in
}
}
Daniel
12/13/2022, 9:56 PMLukáš Kúšik
12/14/2022, 10:18 AMSebastien Leclerc Lavallee
12/14/2022, 2:43 PMsrc
folder as there is code only in androidMain
, commonMain
, and iOSMain
. Thanks!Sebastien Leclerc Lavallee
12/14/2022, 2:43 PMsrc
folder as there is code only in androidMain
, commonMain
, and iOSMain
. Thanks!Chrimaeon
12/14/2022, 2:45 PMSebastien Leclerc Lavallee
12/14/2022, 2:48 PMChrimaeon
12/14/2022, 2:49 PMSebastien Leclerc Lavallee
12/14/2022, 2:55 PMLandry Norris
12/14/2022, 3:44 PMJohn O'Reilly
12/14/2022, 3:47 PMSebastien Leclerc Lavallee
12/14/2022, 3:47 PMJohn O'Reilly
12/14/2022, 3:48 PMLandry Norris
12/14/2022, 3:48 PMSebastien Leclerc Lavallee
12/14/2022, 4:30 PMMustafa Ozhan
01/17/2023, 9:23 AMAndroid
view ?