Custom android extension runtime crash – Jetifier not converting support libraries to AndroidX

Hi everyone,

I’m currently developing an Android extension for Defold and have run into a problem.

Following the setup instructions here:

the APK builds successfully, but launching the app results in a runtime crash.

From adb logcat I located the issue:

E unknown:NativeModuleInitError: Failed to create NativeModule "UIManager"

E unknown:NativeModuleInitError: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/widget/AppCompatImageView;

E unknown:NativeModuleInitError:  at com.airbnb.android.react.lottie.LottiePackage.createViewManagers(LottiePackage.java:25)

...

Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.AppCompatImageView" on path:

logcat.log.txt (20.2 KB)

It appears that Jetifier is not working.

Libraries that should have been converted to AndroidX are still referencing the old android.support.* classes.

When building a regular Android app with Gradle, adding this to gradle.properties:

android.useAndroidX=true
android.enableJetifier=true

will automatically rewrite support libraries to AndroidX.

Based on this post:

Defold versions 1.2.177+ support Jetifier.

I have also set this inside appmanifest:

jetifier: true

However, Jetifier still does not seem to run, and the runtime keeps looking for android.support.v7.widget.AppCompatImageView.

Question

Is there any additional step required to make Jetifier work in Defold?

Or is there anything missing in my extension setup that prevents Jetifier from rewriting the support libraries correctly?

Defold ver:

1.11.2

Platforms:

Android

Minimal reproduction case project:

GitHub - ryosumin/defold-extension-skillz-dev

Server Build Log:

log.txt (696.4 KB)