Saturday, May 14, 2022

Genymotion install apk error - An error occured while deploying the file | Failed to extract native libraries, res=-113

If you are trying to deploy an android application on Genymotion Android Emulator and you are getting following error, this solution is for you.

An error occurred while deploying the file.
This probably means that the app contains ARM native code and your Genymotion device cannot run ARM instructions. You should either build your native code to x86 or install an ARM translation tool in your device.

1. First start Genymotion virtual Android Device and connect your Genymotion Android Device to adb. Follow this link

2. Once it is connected to adb, run command

adb shell getprop | grep ro.product.cpu.abi

3.  It shows the list of architecture supported by the device.


 If your app has similar architecture, you can install the app on the device.

4. Now how can you find the architecture of the app? 

An apk is a compressed file, you can extract the content and open the lib directory. Here it lists the architecture as a folder supported by apk.

 


5. Now this apk has armeabi-v7a architecture which is not aupported by the device by default but Genymotion provides ARM translation packages as patch to install such apps on the device.

6. To install ARM Translation package, open link

https://github.com/m9rco/Genymotion_ARM_Translation/tree/master/package

and download the package according to your android version of virtual device. Now drag and drop the apk in the device. Once this ARM translation package is installed successfully, turn off the device and reboot again.

If your device is not getting started, turn off the Genymotion software completely, kill all the processes related to it and VBox and start again.

7.  Now once the device is started successfully, check the supported architecture by the device using same command.


You will see, now the device can install apps with existing architecture i.e. x86 as well as apks with armeabi and armeabi-v7a architecture too.

8. If you are still getting same error

adb: failed to install h.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

Your app architecture might be arm64 / arm64-v8a

Currently Genymotion Desktop do not support applications for aarch64/arm64, even with ARM translation tools.

However, they offer Genymotion Device (PaaS) Android 8.0 (Oreo), 9.0 (Pie), 10 and 11 images which run on an ARM64 virtual machine at AWS and Oracle Cloud Infrastructure (only Android 8.0).

No comments:

Post a Comment