安装apk到模拟器失败Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]的另一种可能原因

6/27/2018
今天在打包出apk想要去模拟器安装并测试的时候出现异常:
 D:\Development\Code\xxx>flutter install
 Initializing gradle…                                              0.9s
 Resolving dependencies…                                           3.4s
 Installing app.apk to Android SDK built for x86…
 Installing build\app\outputs\apk\app.apk…                         0.2s
 Error: ADB exited with exit code 1
 Performing Streamed Install
 adb: failed to install D:\Development\Code\xxx\build\app\outputs\apk\app.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
 Install failed 

网上找的资料大家都说在gradle配置里面加入:

splits {
         abi {
             enable true
             reset()
             include 'x86', 'x86_64', 'armeabi-v7a'
             universalApk true
         }
     }
增加对对应平台的ABI支持。
可是我之前打包都是好的,应该不是这个问题。

后来一想,是不是我之前安装过的原因?
于是上拉果然发现了有这个包。卸载之后再安装,成功了。。。
 
 D:\Development\Code\xxx>flutter install
 Initializing gradle…                                              1.0s
 Resolving dependencies…                                           4.1s
 Installing app.apk to Android SDK built for x86…
 Uninstalling old version…
 Installing build\app\outputs\apk\app.apk…                         1.8s

Subscribe for the lastest news

Sign up for my mailing list to receive the latest posts and content from me. You can unsubscribe at any time.