0

I want to use the xwalk library to embed a chromium webview in the app. This is done via a gradle dependency.

implementation 'org.xwalk:xwalk_core_library:23.53.589.4'

This dependency is an .aar file which is available in a 32bit and 64bit version. However, only the 32bit version is actually embedded in the build.

By checking the created app bundle, only the lib/x86 and lib/armeabi-v7a versions are embedded.

When checking the available versions on the maven repository for that version - see https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library/23.53.589.4/ - one can see that there are of course versions for all cpu architectures available:

  • xwalk_core_library-23.53.589.4-64bit.aar
  • xwalk_core_library-23.53.589.4-arm.aar
  • xwalk_core_library-23.53.589.4-arm64.aar
  • xwalk_core_library-23.53.589.4-x86.aar
  • xwalk_core_library-23.53.589.4-x86_64.aar
  • xwalk_core_library-23.53.589.4.aar

I assume that by specifying the dependency the way i did, the last one will be embedded in the app. I downloaded the aar and checked the content and as assumed, only the x86 and arm(32) libs are included. I don't know if this is supposed to be that way or if this is a deployment issue.

Anyway, I tried to include 32bit and 64bit dependencies manually by adding the specific gradle classifiers, but because in the aar there are also java classes included, I ended up having build errors because of duplicate classes.

Is there any way to solve that the proper gradle way?

P.Melch
  • 8,066
  • 43
  • 40

1 Answers1

0

I have faced the same issue a few days ago with xwalk_core_library. What I had done:

  1. Download the .aar file from the URL
  2. Add it into the libs folder

in app/build.gradle

For 32bit

dependencies{
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
    debugImplementation files('libs/xwalk_core_library-23.53.589.4.aar')
    releaseImplementation files('libs/xwalk_core_library-23.53.589.4.aar')
}

For 64bit

dependencies{
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
    debugImplementation files('libs/xwalk_core_library-23.53.589.4-64bit.aar')
    releaseImplementation files('libs/xwalk_core_library-23.53.589.4-64bit.aar')
}

And make separate build for 32-bit and 64-bit version. Make sure to include appropriate .aar files before making build.

Android PlayStore provides Multiple APK support. So you can upload multiple APKs at the same time. Also, don't forget to upgrade versionCode for 32-bit and 64-bit version.

Rahul Khurana
  • 8,577
  • 7
  • 33
  • 60
  • actually I'm using a similar workaround right now. since I don't want to use multiple builds (after all, that's why we switched from multi apk to app bundles), I ended up extracting the .libs from the 64bit .aar files and put them in the libs folder manually. Of course the drawback there is that whenever we would change the dependency version, we'd have to remember to manually update the lib files. I hoped there was a better way - more gradle-y – P.Melch Sep 06 '19 at 08:37
  • @P.Melch I have also tried adding `ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'` in `build.gradle` but nothing comes to affect the output of the APK. So, I think currently there is no gradle way to do so. Let me know if you anything in this in the future. – Rahul Khurana Sep 06 '19 at 09:08