JoakimForslund
03/26/2019, 9:03 AMThomas
03/26/2019, 11:42 AMfailed to demangle superclass of MainViewController from mangled name '13MyProject22BaseViewControllerCySo16MyItemCSo0G24MyPresenter_pG'
This is the original line in Swift:
class MainViewController: BaseViewController<MyItem, MyPresenter>, MyView
(MyItem, MyPresenter, MyView are Kotlin classes)
I found this in the release notes under "Known Issues" (https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_release_notes/swift_5_release_notes_for_xcode_10_2):
Linking against a static Swift library might create a binary with missing type metadata because the object files that define the metadata inside the static archive are mistakenly considered unused. (47598583)
This can manifest as a Swift runtime error with a message such as: “failed to demangle superclass of MyClass from mangled name ‘<mangled name>’”.
Workaround: If you can rebuild the static library, try building it with whole module optimization enabled. Otherwise, add -all_load to the linker flags in the client binary to ensure all object files are linked into it.
I tried adding the all_load linker flag to my Xcode project but there was no difference, but I might have added it wrong as I am very new to Xcode. Could anyone help me out?uli
03/26/2019, 12:04 PMalexcouch
03/27/2019, 2:57 AMalexcouch
03/27/2019, 4:38 AMKris Wong
03/27/2019, 1:46 PMkenji_otsuka
03/27/2019, 2:23 PMobject WebGateway {
fun get(urlString: String): String {
val semaphore = dispatch_semaphore_create(0)
val components = NSURLComponents(urlString)
val url = components.URL
var result: String = ""
val config = NSURLSessionConfiguration.defaultSessionConfiguration()
config.waitsForConnectivity = true
config.timeoutIntervalForResource = 300.0
val request = NSURLRequest.requestWithURL(url!!)
val session = NSURLSession.sessionWithConfiguration(
config, null, NSOperationQueue.mainQueue()
)
val task =
session.dataTaskWithRequest(request) { nsData: NSData?, nsurlResponse: NSURLResponse?, nsError: NSError? ->
nsData?.run { result = toString() }
println(nsData)
dispatch_semaphore_signal(semaphore);
}
task.resume()
session.finishTasksAndInvalidate()
NSOperationQueue.mainQueue().waitUntilAllOperationsAreFinished()
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER)
return result
}
}
when i execute main.kexe
, any meaningful output doesn't appear but the program doesn't finish.Daniel Baird
03/27/2019, 7:01 PMvar entry = readdir(dp)
. The entry that is returned is a CPointer<dirent>. I want to use the dirent directly to get the name. One Attempt was to do this val name = entry[0].d_name.toString()
, but that is giving me a useless string that looks like this "CPointer(raw=0x2904670)"Michael Bryant
03/27/2019, 9:13 PMabstract class Parent(val a: Int) {}
class Child(val b: Int, a: Int) : Parent(a) {}
fun make_thing(): Parent {
return Child(1, 2);
}
sksk
03/28/2019, 2:07 AMlsk
03/28/2019, 7:04 AMstaticCFunction
handler as a reference to my Kotlin function. I can pass a context (a pointer) to the handler. How to pass more structured data, like data class? Primitives are not enough in my case. Can you advice?Hauke Radtki
03/28/2019, 12:37 PMThomas
03/29/2019, 4:32 PMmarcinmoskala
03/29/2019, 11:23 PMlsk
03/30/2019, 12:26 PM.def
file, how can I reference my project’s .h
files? Nothing like headers = ./headers/mine.h
does not work. I dont want reference full project path herese1by
03/30/2019, 7:19 PMse1by
03/30/2019, 11:47 PMalexcouch
03/31/2019, 4:22 AMthevery
04/01/2019, 4:51 PMJoakimForslund
04/02/2019, 11:52 AMif #available(iOS 11, *) {
?mben
04/02/2019, 12:05 PMjosephivie
04/03/2019, 5:21 AM@ObjCMethod(selector, bridge)
? I'm trying to figure out how selectors work with Kotlin/Objective C, as I'm trying to work with UI elements from Kotlin.basher
04/03/2019, 9:25 PMFOLDERID_Documents
constant/symbol? It's in platform.windows.*
, but we're getting this linker error:
undefined reference to `FOLDERID_Documents'
azeDevs
04/06/2019, 9:21 PMJoao Zao
04/08/2019, 12:13 AMTask :common-client:linkDebugFrameworkIOS
Undefined symbols for architecture x86_64:
"_sqlite3_bind_blob", referenced from:
___47-[APMSqliteStore bindValues:toStatement:error:]_block_invoke in GoogleAppMeasurement(APMSqliteStore_ae86ae290f270c42720d24e61ec7eef9.o)
....
My .def
file linkerOpts
👇
linkerOpts = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.osx.a -framework FirebaseFirestore -framework BoringSSL -framework gRPC-C++ -framework gRPC-Core -framework gRPC-ProtoRPC -framework gRPC-RxLibrary -framework gRPC -framework leveldb-library -framework Protobuf -framework FIRAnalyticsConnector -framework Firebase -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseInstanceID -framework GoogleAppMeasurement -framework GoogleUtilities -framework nanopb -framework Protobuf -framework StoreKit
It seems I’m missing the sqlite3 library, how can I add it?Hauke Radtki
04/08/2019, 9:09 AMdrofwarcs
04/09/2019, 3:30 PM_Nullable id verify(id mock) {
return MKTVerifyWithLocation(mock, self, __FILE__, __LINE__);
}
cinterops throws error: use of undeclared identifier 'self'
. Is cinterops not able to handle the self
keyword yet or is there another way I should be handling this?mben
04/09/2019, 3:34 PMazeDevs
04/09/2019, 7:43 PMfun startUiLoop() {
GlobalScope.launch {
delay(32L)
updateUi()
}
}
Tobi
04/10/2019, 7:52 AMString.toByteArray()
, which is just available on the jvm (https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-byte-array.html).
Any idea how I could do this using kotlin/native or just the common stdlib?
https://kotlinlang.slack.com/archives/C3PQML5NU/p1554881432104600Tobi
04/10/2019, 7:52 AMString.toByteArray()
, which is just available on the jvm (https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-byte-array.html).
Any idea how I could do this using kotlin/native or just the common stdlib?
https://kotlinlang.slack.com/archives/C3PQML5NU/p1554881432104600addamsson
04/10/2019, 8:03 AMsvyatoslav.scherbina
04/10/2019, 8:41 AMTobi
04/10/2019, 10:25 AM