Build configurations fpr armeabi, armeabi-v7a and x86

Hi all,

I would like to create different Visual Studio 2010 "Release" build configurations for the different supported architectures, ultimately creating three different APK files to upload to Google Play. Unfortunately the choice of the "supported architectures" is on the project settings "Application" tab which does not depend on the actual configuration to build.

Does anybody have an idea how to create different builds without manually switching back and forth?

Or maybe the Mono for Android project setting pages should be changed to move the "supported architectures" choice from the "Application" to the "Mono Android Options" tab.

Posts

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai
    edited October 2012

    One thought, which might be a bit of a hack, is to automate your build with rake/psake/FinalBuilder/Visual Builder/build tool of your choice. Compile the app once for each ABI. Before you compile though, tweak the .csproj file and modify AndroidSupportedAbis element to specify one and only one ABI. For example
    <AndroidSupportedAbis><armeabi | armeabi-v7a | x86></AndroidSupportedAbis> (just pick one of those values per build.

    Just out of curiosity, why do you want a different build for each ABI in Google Play?

    Also, be aware that there are issues with armeabi and SMP devices, as discussed in the CPU Architectures document.

  • AndreasSelleAndreasSelle DEBeta ✭✭

    Thanks for your reply. There are 2 reasons: 1) Smaller APK files and 2) the problem that you linked to. Unfortnately we found that about 5% of our existing customers still have devices that require "armeabi" so we cannot just stop supporting it.

    BTW: a few current customers (about 1%) also have reproducible app crashes that we cannot explain. I did hope that including just armeabi-v7a may solve that problem. But this is another story.

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    Unfortunately the choice of the "supported architectures" is on the project settings "Application" tab which does not depend on the actual configuration to build.

    I suspect that moving "supported architectures" to a different tab would do nothing to fix the dependency problem, as the real problem is that the .targets files don't consider the value of $(AndroidSupportedAbis) as a build dependency. (That could be fixed without reodering the tabs as well; please file an enhancement request if you would like this.)

    Does anybody have an idea how to create different builds without manually switching back and forth?

    Using msbuild from the command line (yay scripts!) and specifying a different $(OutputPath) MSBuild property for each configuration:

    msbuild /t:SignAndroidPackage /p:OutputPath=bin.armv5 /p:AndroidSupportedAbis=armeabi /p:Configuration=Release Project.csproj
    
    msbuild /t:SignAndroidPackage /p:OutputPath=bin.armv7 /p:AndroidSupportedAbis=armeabi-v7a /p:Configuration=Release Project.csproj
    
    msbuild /t:SignAndroidPackage /p:OutputPath=bin.x86 /p:AndroidSupportedAbis=x86 /p:Configuration=Release Project.csproj
    

    The above should result in bin.armv5/Project.Name.apk, bin.armv7/Project.Name.apk, and bin.x86/Project.Name.apk, each containing only one ABI.

  • AndreasSelleAndreasSelle DEBeta ✭✭

    Thanks for your answer. This did solve my problem.

  • subhamoybsubhamoyb Member ✭✭

    I know this an old thread - but the following may help someone who is using VS 2017/19.

    1. Right click on your Android Project and open "Options" or "Project Options".
      Select the configuration dropdown to Release.
      On "General" tab please select the checkbox "Generate one package (.apk) per selected ABI"

    2. Now to go advanced tab of the same window. Select whichever ABI you want to support.

    Now if you build and deploy to your device, it will create selected ABI builds in bin/Release folder

Sign In or Register to comment.