none
[Android dev] Is it possible to build an native application (NDK, native activity) containing ARM and ARM64 versions of .so in one APK? RRS feed

  • Question

  • Hello.

    I use Visual Studio to develop Android apps. From August 1, according to Google requirements, 64-bit native libraries should be included in the APK. In Visual Studio, i can build APK-s for ARM and ARM64 separately. Is it possible to build an native application (NDK, native activity) containing ARM and ARM64 versions of .so in one APK?

    p.s. I apologize if I wrote in wrong section of the forum.



    • Edited by Vitorio7 Friday, August 23, 2019 4:31 AM
    Thursday, August 22, 2019 8:54 AM

Answers

  • Hi Dylan,

    thank You for your answer and the proposed solution from stackoverflow. There is described my problem, but not conatin solution.

    I found the solution myself. I apologize for having described this on this forum. May be it's will be useful for other developers, who came to this post  from Google.:)

    The solution:

    1. Build a project with ARM64 configuration.

    2. Rename resulting APK-file to a zip-archive (add .zip to the end of the file name) and open it. Unzip and copy the "lib" folder to "NativeActivity.Packacking" project in the "libs" subfolder.

    3. In Visual Studio, right-click on the "libs" folder and choose "Inlcude in Project".

    4. Build a project with ARM configuration.

    In the resulting APK-file we will have both .so-files in the "libs" folder in the subfolders "arm64-v8a" and "armeabi-v7a". The resulting application will be ready for Google Play requirements which are valid from August 1, 2019.


    • Marked as answer by Vitorio7 Monday, August 26, 2019 4:00 AM
    • Edited by Vitorio7 Monday, August 26, 2019 5:59 AM
    Monday, August 26, 2019 3:59 AM

All replies

  • Hi Vitorio7,

    Thank you for posting here.

    According to your description, we recommend you could redirect to Xamarin.Android forum. Since our forum is discussing about extending and integrating with Visual Studio, and you could get dedicated support in that forum.

    BTW, I find a similar issue here: https://stackoverflow.com/a/45658238, hope it could help you.

    Thank you for understanding.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, August 23, 2019 8:43 AM
  • Hi Dylan,

    thank You for your answer and the proposed solution from stackoverflow. There is described my problem, but not conatin solution.

    I found the solution myself. I apologize for having described this on this forum. May be it's will be useful for other developers, who came to this post  from Google.:)

    The solution:

    1. Build a project with ARM64 configuration.

    2. Rename resulting APK-file to a zip-archive (add .zip to the end of the file name) and open it. Unzip and copy the "lib" folder to "NativeActivity.Packacking" project in the "libs" subfolder.

    3. In Visual Studio, right-click on the "libs" folder and choose "Inlcude in Project".

    4. Build a project with ARM configuration.

    In the resulting APK-file we will have both .so-files in the "libs" folder in the subfolders "arm64-v8a" and "armeabi-v7a". The resulting application will be ready for Google Play requirements which are valid from August 1, 2019.


    • Marked as answer by Vitorio7 Monday, August 26, 2019 4:00 AM
    • Edited by Vitorio7 Monday, August 26, 2019 5:59 AM
    Monday, August 26, 2019 3:59 AM