Few cents about my commits

bugfix #233: Unable to start 12.5 inch iPad simulator

|

History Unable to start 12.5 inch iPad simulator #233
Fix PR273

Recently there was a fix for simulator selection in Idea. Its turned out that there is a similar gradle one. But gradle is broken in different way:
gradle -Probovm.arch=x86_64 -Probovm.device.name="iPad Pro (12.9-inch) (2nd generation)" launchIPadSimulator

failed with message
Unable to find a matching device [arch=x86_64, family=iPad, name=iPad Pro (12.9-inch) (2nd generation), sdk=null]

Root case is very simple, code in DeviceType.filter() replaced any ‘-‘ with ‘ ‘ by following code snipped:
deviceName = deviceName == null ? null : deviceName.toLowerCase().replaceAll("-", " ");

as result it was looking for device with name iPad Pro (12.9 inch) (2nd generation) (without ‘-‘) and of course was not able to locate it.

W/L TechNotes 2: xib2nib

|

UIKit xib/storyboard files have be compiled from XML text format to binary NIB. In native Mac environment there is ibtool as part of XCode toolchain that handle this task. Windows/Linux lack this tool and without it not possible compiling iOS application that contains xib/stroryboard layouts. Lucky for us such tool was found in Microsoft/WinObjC project but unfortunately it was not working from scratch. Getting it to so-so working level cost me about 100+ hours to fix showstopper bugs and develop tools that simplifies reverse engineering of nib. Details are bellow:

Tutorial: Investigating silent crash of Release build (e.g. Port death watcher fired)

|

Release build (shared IPA) crashes when shared with QA team or even being uploaded to Apple Store doesn’t give any reason in crash reports. Device console logs shows as much as:

Feb 12 09:32:12 iPhone assertiond[67] : [DemoApp:620] Port death watcher fired.

This can be reproduced with this minimal snippet – it will produce output while on wire with debugger but once started without it (or from IPA or Apple store) will be silent:

public class Main extends UIApplicationDelegateAdapter {
    @Override
    public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
        throw new RuntimeException("You will not see me!");
    }
}

With very high chance crash is Java code and it is not causes any log output/crash report because developer didn’t configured app so. What has to be done:

bugfix #263: Idea launches wrong version of simulator than selected in run configuration

|

not a bug: EXC_BAD_ACCESS if object created with method whose name begins with “alloc”, “new”, “copy”, or “mutableCopy”

|

UPDATED with workaround if “new” prefix is still required.

Native ObjectiveC/Swift code that uses shared code RoboVM code as Framework could ends in following:

Sometimes it happens randomly but here is how to make it upon-request:

Linux/Windows WIP: not a bug - "Error in compatibility flow" exception

|

While working on Linux/Windows port and improving xib2nib faced following issue that was happening only when custom build toolchain was used:

*** Assertion failure in -[UIView _nsis_center:bounds:inEngine:forLayoutGuide:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3698.33.7/NSLayoutConstraint_UIKitAdditions.m:3347
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error in compatibility flow'

It was happening when using recently added UIKit functionality in xibs (UILayoutGuide in this case). Long investigation to simple solution is bellow:

Homemade iOS SDK for Linux/Windows port of RoboVM

|

Apple doesn’t allow SDK/Development Tools to be used on non-apple built hardware. This was limiting RoboVM usage on Linux/Windows platforms as it was required to manually copy files from Mac (breaking the license). Ok then, lets make own SDK for RoboVM.

bugfix: Debugger - broken step over and crashed when using lambda

|

Fix PR #257

Wants find bugs in own product ? Start using it!

1. It was not possible to step over code if this code was generating exception (even if it was handling it)

These lines were not possible to step over as in exists() there was exception generated/catch:

new File("/some/invalid/path").exists();
new File("/some/invalid/path").exists();

bugfix: Debugger hangs when evaluating native objects that has no corresponding Java class loaded

|

Fix PR #256

This happens when evaluating internal of native object in debugger (NSDictionary in my case) and bound Java class for internal objects (NSDictionary$EntrySet in my case) was not loaded by Runtime. E.g. class resolution is happening by Debugger itself. The bug’s symptoms are following: app hangs, and variable is not resolved in debugger:

In idea log it appears as exception:

Tutorial: using app-extensions in RoboVM iOS application

|

Apple added support for app-extensions while ago (ios8). I’ve created today a PR255 that add ability to include pre-build app extension into RoboVM app. Answering the possible question:

Can I use RoboVM to develop appext

Short answer: no, not today