Piasy
01/29/2020, 9:41 AMtypedef const char* (*PCClientOnPreferCodecs)(void*, const char*, const char*);
And my Kotlin code implementing it is:
private fun PCClientCallbackOnPreferCodecs(opaque: COpaquePointer?, peerUidPtr: CPointer<ByteVar>?, sdpPtr: CPointer<ByteVar>?): CPointer<ByteVar>? {
initRuntimeIfNeeded()
if (opaque == null) {
return null
}
memScoped {
return opaque.asStableRef<PeerConnectionClientCallback>().get().onPreferCodecs(peerUid, sdp).cstr.ptr
}
}
I pass it into C++ with staticCFunction(::PCClientCallbackOnPreferCodecs)
, and pass opaque
with StableRef.create(callback).asCPointer()
.
It could be compiled and linked, but at runtime the string I get at C++ is scrambled code.Olenyov Kirill
01/29/2020, 9:46 AMdata class MyTestDataClass(val ppp: Int, val ttt: List<Int>)
But in obj-c it looks like:
CommonMyTestDataClass : KotlinBase
- (instancetype)initWithPpp:(int32_t)ppp ttt:(NSArray<CommonInt *> *)ttt
So different types: int32_t and CommonInt
WTF?Kris Wong
01/29/2020, 5:13 PMdimsuz
01/29/2020, 5:57 PMjvm {
compilations.main.kotlinOptions {
jvmTarget = "1.8"
}
}
for android?
it works for jvm, but on android target I get:
Could not get unknown property 'main' for KotlinJvmAndroidCompilation container of type org.gradle.api.internal.FactoryNamedDomainObjectContainer.
during gradle syncNikky
01/29/2020, 11:18 PMConsoleOutputAppender.kt:6
what do you use for logging inside shared code ?Larten
01/30/2020, 7:28 AMlanguage = Objective-C
modules = FirebaseAnalytics
compilerOpts = -framework FIRAnalyticsConnector -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseInstallations -framework FirebaseInstanceID -framework GoogleAppMeasurement -framework GoogleDataTransport -framework GoogleDataTransportCCTSupport -framework GoogleUtilities -framework nanopb
linkerOpts = -framework FIRAnalyticsConnector -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseInstallations -framework FirebaseInstanceID -framework GoogleAppMeasurement -framework GoogleDataTransport -framework GoogleDataTransportCCTSupport -framework GoogleUtilities -framework nanopb
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SKPaymentQueue", referenced from:
objc-class-ref in GoogleAppMeasurement(APMAnalytics_8b8a060bbe8023e2a8dc40576f3452ac.o)
"_OBJC_CLASS_$_SKProductsRequest", referenced from:
objc-class-ref in GoogleAppMeasurement(APMProductsRequest_769d88c7ff80f19356bd57d9fa02e637.o)
....
....
I have no idea, what’s wrong. I did everything similiar as the the other modules (which are testes and working), but I can’t build this module.
Actually the Studio can solve dependencies, I could use FIRAnalytics for iOS and FirebaseAnalytics for Android, but build run into error.
Any idea? Can somebody add Analytics dependency to kmp project?
Oh and I set firebase modules binary to 6.15.0, because 6.16.0 has something problem in every module 🙂Kris Wong
01/30/2020, 2:57 PMMikołaj Karwowski
01/30/2020, 3:25 PMMikołaj Karwowski
01/30/2020, 3:26 PMNick Halase
01/31/2020, 2:22 AMfun sectionForIndex(index: Int): Section?
not compile to Int32
in my objective-c framework?Joffrey
01/31/2020, 2:47 PMMikołaj Karwowski
01/31/2020, 4:05 PMVenkat , Bangalore , India
02/01/2020, 6:51 AMVenkat , Bangalore , India
02/01/2020, 6:53 AMGarouDan
02/01/2020, 4:29 PMcommonMain
and commonTest
source sets?moltendorf
02/01/2020, 7:27 PMandroid.os.Build
)
• When I add a second jvm()
target (for the server), the library builds, but the android app is no longer able to resolve dependencies.SrSouza
02/02/2020, 2:24 PMBig Chungus
02/02/2020, 8:09 PM1.) JCenter hosts open source applications using the Maven naming convention which has 3 components. For example, a valid allocated path might be: org/apache/maven
2.) You can only have one JCenter path assigned to one bintray package. Since the above requires 3 components your path options are the following:
/lt/petuska/kvdom-dsl
/lt/petuska/kvdom-dsl-js
/lt/petuska/kvdom-dsl-metadata
/lt/petuska/kvdom-dsl-wasm32
Do I get this right and that essentially means there's no way to publish MPP libraries with gradle metadata to any mainstream maven repo?krtko
02/02/2020, 8:59 PMbuild.gradle.kts
file for the new module
plugins {
kotlin("multiplatform")
}
kotlin {
targets {
targetFromPreset(presets.getByName("jvm"), "android")
}
sourceSets {
commonMain {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61")
}
}
getByName("androidMain") {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.61")
}
}
}
}
Everything builds fine, but my Android module can't see the kotlin MPP oneTony
02/03/2020, 8:33 PMkotlin {
jvm {
apply plugin: 'kotlin-android-extensions'
...
androidExtensions {
experimental = true
}
}
}
Can someone help me?Dariusz Rusin
02/04/2020, 10:34 AMtargets {
final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") \
? presets.iosArm64 : presets.iosX64
fromPreset(iOSTarget, 'ios') {
binaries {
framework('multiplatform-code') {
freeCompilerArgs.add("-Xobjc-generics")
}
}
}
fromPreset(presets.jvm, 'android')
}
And I'm getting this error:
Build file '/..../multiplatform-code/build.gradle' line: 40
* What went wrong:
A problem occurred evaluating root project 'multiplatform-code'.
> Operation is not supported for read-only collection
And line 40 is:
freeCompilerArgs.add("-Xobjc-generics")
I dont understand the source of the problem. What exactly "Operation is not supported for read-only collection" is mean?Kris Wong
02/04/2020, 1:31 PMlouiscad
02/04/2020, 4:19 PMKris Wong
02/04/2020, 6:06 PMjames
02/05/2020, 4:56 AMcocoapods { }
block
• Generate podspec with Gradle task
• pod install
in the ios project folder successfully
• Try to build from Xcode but get the following error:
> Task :someapp:cinteropSomeModuleIos
`Showing All Messages
Exception in thread "main" java.lang.Error: /var/folders/nv/hdlrvk9j2g77bsvj_npsm46r0000gn/T/tmp8525659560237793549.m:1:9: fatal error: module 'SomeModule' not found`
I checked FRAMEWORK_SEARCH_PATHS and it includes the path to SomeModule.framework
Any ideas?Kashif
02/05/2020, 7:26 AMNikolay Kasyanov
02/05/2020, 11:01 AMimport kotlin.test.Test
is highlighted red in the IDE when the test is located in the commontTest
source set? Gradle build doesn’t fail, seems like an IDE issue.Patrick Jackson
02/05/2020, 1:43 PMcurioustechizen
02/05/2020, 3:37 PMcurioustechizen
02/05/2020, 3:41 PMMyApp
- app
- feature1_domain
- feature1_presentation
- feature2_domain
- feature2_presentation
- and so on
All the _`domain` modules serve the purpose of common
in KMP (they have platform-agnostic code already). app
, and all the _presentation
modules have Android-specific code.
Wondering what's the best approach to add iOS here. From what I understand, the goal is to generate a single .framework
from the common code for use in iOS. I did not find any examples of this