Few cents about my commits

RoboVM 2.3.16 release and 2.3.17-SNAPSHOT

|

Idea plugin is not available at Idea Marketplace yet as in review!
But can be downloaded manually from MobiVM site.

2.3.16: What’s new

  • Fixed: ‘duplicate symbol xxx.spfpoffset’ in debug build when using GoogleMobileAds pod PR626
  • Framework target: can produce XCFramework, can produce m1 simulator slice PR624
  • Fixed: missing bitcode in VM libs (introduced by m1 support changes) PR624
  • Fixed #621 – hang of SKStoreReviewController.requestReview by PR615. WARNING: window is to be retained in user code now !!!
  • ByteBuffer J9 API desugaring PR615
  • ios15 binding PR613

2.3.17-SNAPSHOT:

  • Fixed: missing simulator arch in Idea picker PR642
  • New: ios15.4 bindings PR635
  • Changes: to swiftSupport configuration parameter PR638
  • Changes: Debugger – can suspend any thread PR628

Happy coding!
Please report any issue to tracker.

AltPods: pods updated - 1.21.0-SNAPSHOT

|

AltPods were updated to v1.21.0-SNAPSHOT to sync with recent releases.

Updated pods

New pods

These pods were pushed to https://oss.sonatype.org/content/repositories/snapshots maven repo under 1.21.0-SNAPSHOTS version. Source code @github

Updates are not fully tested, please open issue if bug found.

Debugger -- suspend any thread

|

RoboVM code can be stopped only when code reach instrumented hook callbacks (ones that being injected after every line by compiler). As result pausing application will in most cases not stop the application and will not show valid call stack:

Root case

  • Thread state is not delivered from VM to debugger so always reported as running;
  • “Paused” thread doesn’t show any call stack due no ability to pause it other places than instrumented hooks code;

Approach

AltPods: pods updated - 1.20.0-SNAPSHOT

|

AltPods were updated to v1.20.0-SNAPSHOT to sync with recent releases.

Updated pods

New pods

These pods were pushed to https://oss.sonatype.org/content/repositories/snapshots maven repo under 1.20.0-SNAPSHOTS version. Source code @github

Updates are not fully tested, please open issue if bug found.

AltPods: pods updated - 1.19.0-SNAPSHOT

|

AltPods were updated to v1.19.0-SNAPSHOT to sync with recent releases.

Updated pods

New pods

These pods were pushed to https://oss.sonatype.org/content/repositories/snapshots maven repo under 1.19.0-SNAPSHOTS version. Source code @github

Updates are not fully tested, please open issue if bug found.

AltPods: pods updated - 1.18.0-SNAPSHOT

|

ios12: class_copyProtocolList crash

|

Issue was reported on gitter and caused crash inside ObjC library of RoboVM with following stacktrace:

0 _mapStrHash(_NXMapTable*, void const*) + 4
1 _NXMapMember(_NXMapTable*, void const*, void**) + 52
2 NXMapGet + 20
3 getProtocol(char const*) + 28
4 class_copyProtocolList + 328
5 [J]org.robovm.objc.ObjCRuntime.class_copyProtocolList(JJ)J + 4358277632

Issue was reproduced on iOS12 simulator. Sample was simplified to following RoboVM/Java snippet:

Native Apple Silicon M1 support

|

Apple Silicon proposed in PR586. It includes:

  • m1 arm64 version of llvm, ilibmobiledevice, hfsconmpressor libraries to allow it being used with arm64 version of java;
  • support for arm64 iOS simulator and arm64 MacOSX console target.

How fast it is (compiling classes using 8 threads):

(Mac Mini m1): Compiled 3317 classes in 36.45 seconds
(Mac Pro W3565): Compiled 3317 classes in 111.60 seconds
(MacBook Pro, i5-4278U @ 4 threads): Compiled 3317 classes in 219.09 seconds

How to use

RoboVM 2.3.13 release and 2.3.14-SNAPSHOT

|

Available at Idea Marketplace (for AndroidStudio as well), also IDE plugins are available for download.

2.3.13: What’s new

Fixes and maintenance release:

  • fixed: NumberFormatException when compiling 1.4/1.5 kotlin code for Debugger PR581
  • changed: the way how dynamic libraries appears at linker command line PR580
  • fixed #561: reverted binding of structs with flexible array members PR565
  • fixed: GlobalValueEnumeration crash #567 PR571
  • reworked way swift dependencies are picked up PR552
  • Idea plugin maintenance: support for 2021.1 EAP PR570
  • fix for #557. merged several CryptoLib/OpenSSL fixes PR564
  • fix for: ClassCastException - passing java Interface implementation as ObjC protocol PR563
  • hot fix for CompilerException while compiling UIKey.keyCode PR553
  • CocoaTouch 14.3 and fixes PR551
  • fixed: @ByVal is not working for GlobalValues/Struct getters PR550
  • fixed #542: Dagger with Kotlin, IDE IPA Creation Problem PR549

2.3.14-SNAPSHOT:

Includes functionality currently in testing:

Happy coding!
Please report any issue to tracker.

Kotlin coroutines: Dispatchers.Main context for RoboVM applications

|

Android has kotlinx-coroutines-android Dispatcher.Main that coroutine execution on main/ui thread.
It allows writing an effective suspend logic on main thread as described on the usage page:

fun setup(hello: Text, fab: Circle) {
    GlobalScope.launch(Dispatchers.Main) { // launch coroutine in the main thread
        for (i in 10 downTo 1) { // countdown from 10 to 1 
            hello.text = "Countdown $i ..." // update text
            delay(500) // wait half a second
        }
        hello.text = "Done!"
    }
}

Overview

To make Dispatchers.Main available to kotlinx following steps to be done: