Multiple ABIs support in app archiving

DavidBarishevDavidBarishev USMember ✭✭
edited November 2018 in Xamarin.Android

I have a xamarin.android project, that uses a native "Shared Library" written in c.
Currently, when I archive the project and open up the apk file, I see that under the lib folder, only the ABI I have selected is actually getting my library (.so) file into it, all of the other ABIs contain the mono runtime.
How can I build a "fat" apk, that contains all abi's that my app supports ?

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    If you want the apk contains all abi's that your app supports, you need to provide different .so file for different ABI folders

  • DavidBarishevDavidBarishev USMember ✭✭

    @jezh said:
    If you want the apk contains all abi's that your app supports, you need to provide different .so file for different ABI folders

    For calcification, i'm not using an already built .so library, but rather a "Shared object - android library" project, who's build is managed by Visual Studio.

    How do I make it provide all ABIs instead of only the one specified in the build configuration ?

  • jezhjezh Member, Xamarin Team Xamurai
    edited November 2018

    You could try to enable the Generate one package(.apk) per selected ABI options , meanwhile you need to selecte all the Supported architectures. Specific steps are as follows:


  • DavidBarishevDavidBarishev USMember ✭✭
    edited November 2018

    @jezh said:
    You could try to enable the Generate one package(.apk) per selected ABI options , meanwhile you need to selecte all the Supported architectures. Specific steps are as follows:


    Unfortunately, that didn't work.
    It does create a separate apk for each ABI, but only the apk of ABI that was selected at the archive time will have the native library in their lib folder. All other apks have only mono's run-time.

    Please take a look at this example project to observe the behavior I stated in both of my comments. Try archiving the project with different CPU configuration, and observing the output of the lib folder in the apk.

Sign In or Register to comment.