Few cents about my commits

RoboVM maintenance: keeping up to date

|

Today maintenance PR326 delivers following:

  • fixes gradle’s ` Warning: org.robovm.apple.uikit.UIWindow is a phantom class! [issue](https://gitter.im/MobiVM/robovm?at=5b98e2c4f3c26b08f6664e07) when using v4 and implementation` as dependency command. This was happening due using outdated configuration name in dependency path resolution:
// configure the runtime classpath
Set<File> classpathEntries = project.getConfigurations().getByName("runtime").getFiles();

while

 // The name of the "runtime" configuration. This configuration is deprecated and doesn't represent a correct view of
 // the runtime dependencies of a component.
  • update to Idea 2018.2.3: fixes broken Idea plugin build due to gradle dependencies needs to be specified
  • update to Xcode10: sdk 10.14 and removed x86 mac target as deprecated and breaks build process

okhttp3 v3.11.0: playing nice with RoboVM

|

As stated in #325 it doesn’t work. The reason for this is that okhttp3 detects RoboVM as Android (as there are corresponding providers classes present). And crashes while tries to access Android’s Build class, which is not found:

java.lang.NoClassDefFoundError: android/os/Build$VERSION
	at okhttp3.internal.platform.AndroidPlatform.getSSLContext(AndroidPlatform.java:434)
	at okhttp3.OkHttpClient.newSslSocketFactory(OkHttpClient.java:282)

Dirty and fast solution is just to add Build class to your class path:

package android.os;

public final class Build {
    public final static class VERSION {
        public final static int SDK_INT = 16; // android 4.1
    }
}

Long term solution would be updating to OpenJDK10.

XCode/IB: fix for invisible segue actions

|

Alex @avazquezdev 10:32 I’ve been following the basic navigation tutorial using storyboard, but I have the problem that it’s not possible to adding an Unwind Segue. I select Ctrl-drag from the Cancel button to the exit symbol of the editing scene but the exit symbol is not selectable. Could there be a problem generating the Xcode project? I’d like to make sure it’s not a problem with my code. Here you can see the example.title

To have segue action assignments works corresponding objc code shell contains code with action defined as bellow:

/**
 * IBAction unwindToNameList
 */
-(IBAction) unwindToNameList:(UIStoryboardSegue*) sender;

But XCode project generator didn’t make difference in parameter types and uses id for everything, as result IB doesn’t see this method as subject for unwind operations:

-(IBAction) unwindToNameList:(id) sender;

The fix is to provide argument type for actions in case of native or custom classes. Changes are available in PR323

ios12 fix delivery to boehm-gc upstream

|

The fix is confirmed by users.
Same fixes were merged into boehm-gc code base and delivered as PR232, also issue #231 was created to track case.
Also up-to-date boehm-gc with these changes for RoboVM is available in my branch dkimitsa/boehm-gc. Will investigate if there is any benefit to upgrade to recent boehm-gc once ios12 is released.

aggressive treeshaker: fixing ObjectOutputStream.writeObject()

|

Aggressive tree shaker helps to reduce application footprint by removing all methods that are not referenced in code. This often breaks reflection-based code and required classes has to be explicitly specified using <forceLinkClasses> but sometimes it is not enough. While working with nitrite-database I faced case when class is referenced but some methods of it is still removed. Here is an example:

private void testSerialize() {
        try {
            new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(new HashMap<>());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

fails with:

java.io.InvalidClassException: java.util.HashMap doesn't have a field loadFactor of type float
	at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:955)

This happens due internal private and unreferenced methods got removed from HashMap.

java.io.Serializable contract

As specified in documentation there is special case:

ios12 beta crash: fix for testing [vol4]

|

This post continues series of investigations #1 #2 #3. It delivers fix described in previous post: stop/start world changed in way to not loos mach port reference to thread between stop and start world calls. For fix I’ve used old code boehm-gc that is used in MobiVM and not recent one I’ve updated recently just to minimize amount of new problem introduced. I’ll will be back to updated code in one of next snapshots once iOS12 issue is confirmed.

I’ve created a PR1 where all changes can be evaluated.
Pre-built library for testing is also available lib_fix_candidate/libgc.a

Please test and report any issues to gitter channel

ios12 beta: root cause of RoboVM hangs/crashes vol3

|

This post continues series of investigations #1 #2). Root case – boehm-gc doesn’t resume all threads it paused during GC_stop_world. Details bellow.

ios12 beta: why RoboVM hangs/crashes synthetic case in iOS12

|

UPDATE: there is a follow up on this topic.

Few days ago I narrowed issue to simple case (check this post) but it didn’t answer why this was happening. Today I had time to digg this rock and find pice of code that cause issue. What has been done:

ios12 beta: investigating hang up and crash

|

UPDATE: there is a follow up on this topic.
UPDATE2: there is a follow up on this topic.

libgdx developers got concerned about crashes in ios12 beta and there is an issue about it. I was not able to reproduce it using steps provided by Eric Nondahl as was trying to reproduce it on empty iOS system, and following actions helped much:

  • switching to other apps will help;
  • it is better other apps to be OGL ones;

These steps resulted in reproducing Eric’s POC. But POC) is quite verbose as packed with different cases:

Making BouncyCastleProvider work in IntelliJ Idea Plugin vol.2

|

It a follow up of old story. This case hit me back again. This time during a work on keychain utils for linux/windows port. In general this happens in following code:

PKCS12PfxPduBuilder builder = new PKCS12PfxPduBuilder();
...
PKCS12MacCalculatorBuilder macBuilder = new JcePKCS12MacCalculatorBuilder();
PKCS12PfxPdu pfx = builder.build(macBuilder, "".toCharArray());

and the reason in following: