Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2017.2 Gradle Build specific for ARMv7, Google detects also x86 native platform

Discussion in 'Android' started by Mathijs333, Dec 19, 2017.

  1. Mathijs333

    Mathijs333

    Joined:
    May 20, 2014
    Posts:
    15
    Hi,

    We are building specific Armv7 and X86 .apk's to reduce apk size. This worked for years, but after upgrading to 2017.2, I've an issue. Although building for ARMv7, Google Play Store detects that it also runs on x86 devices. I can assure you, this doesn't work at all if you start those .apk's at a x86 device..., although it gives a popup saying that this hardware platform isn't supported. In the past it simply crashed without a notice, when you tried to run an apk on a wrong platform. So, somehow there is indeed some x86 code.

    We are building using the Gradle, due to a dex overflow. In 5.6.x we didn't had the problem. We've updated all plugins to the latest versions.

    I can't find much about it. Is this a bug, or is there some x86 code in one or more plugins being incorporated in the apk or so ang being detected?? Anything else, the build gradle file? The only option I've left is stripping one by one all aar's and jar plugins. But maybe someone has a better idea, then spending hours on building.. :)

    Regards,
    Mathijs.
     
  2. Mathijs333

    Mathijs333

    Joined:
    May 20, 2014
    Posts:
    15
    Seems I can "fix" it by adding this to the gradle file and make sure to have the same architecture selected in the gradle and in the playersettings. Then it no longer contains 2 native platform. I need one, else we can't publish separate apk's for x86 and arm7 to reduce filesize.

    Still the question, is this a bug or is it something in my project which results in this behaviour?

    splits {
    // Configures multiple APKs based on ABI.
    abi {

    // Enables building multiple APKs per ABI.
    enable true

    // By default all ABIs are included, so use reset() and include to specify that we only
    // want APKs for x86, armeabi-v7a, and mips.

    // Resets the list of ABIs that Gradle should create APKs for to none.
    reset()

    // Specifies a list of ABIs that Gradle should create APKs for.
    //include "x86"
    include "armeabi-v7a"
    // Specifies that we do not want to also generate a universal APK that includes all ABIs.
    universalApk false
    }
    }