Search code examples
javaandroidbarcode-scannerfailed-installation

application with zebra jar failed to build on non zebra device with INSTALL_FAILED_NO_MATCHING_ABIS


I have developed an application that runs on a zebra TC70. The main reason for this is that this device has a built-in 2D barcode scanner.

Now I want to also publish the same app in the app store without the zebra requirement. I have built in a check that checks if the device is a zebra device or not (as described here by Zebra)

Now when I build this app on a doogee s60, this works without a problem. The app uses the camera instead of the barcode scanner. When I want to install in on my Sony Xperia XZ Premiumn, I get the following error in android studio enter image description here

Now I am not really familiar with "ABIS" in android. I tried some googeling and this gave me hints to split APKs per CPU model but I don't get that working.

The end goal is that I can get this app working on "every" android device without having to copy all my code into a second project without the zebra jar.

Android manifest

  • Min SDK: 16
  • Target SDK: 19
  • Zebra device I have run Android 4.4 or android 5.1
  • uses-permission android:name="com.symbol.emdk.permission.EMDK"

build.grade (app)

  • provided fileTree(include: ['com.symbol.emdk.jar'], dir: 'libs') // this needs to be provided as else the app won't build

End status:

  • TC70: app is working with the built-in scanner
  • Doogee S60: app is working with the camera
  • Sony Xperia XZ Premium: app fails to build with error.

Solution

  • I finally found the answer.

    Apparently it was just one specific library.

    I replaced:

    compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
    

    by:

    compile group: 'commons-io', name: 'commons-io', version: '2.5'
    

    and this fixed my issue. It was not related to the zebra library. Also: implementation group: 'commons-io', name: 'commons-io', version: '2.5' //Works.

    Thanks to "sweisgerber.dev" in this post INSTALL_FAILED_NO_MATCHING_ABIS error on Android 8 as it fixed the issue