Android 安装 apk 时 INSTALL_FAILED_NO_MATCHING_ABIS

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24572052/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:26:16  来源:igfitidea点击:

INSTALL_FAILED_NO_MATCHING_ABIS when install apk

androidapkadbintelvirtual-device-manager

提问by Peter Zhao

I tried to install my app into Android L Preview Intel Atom Virtual Device, it failed with error:

我尝试将我的应用程序安装到 Android L Preview Intel Atom Virtual Device 中,但失败并显示错误:

INSTALL_FAILED_NO_MATCHING_ABIS

INSTALL_FAILED_NO_MATCHING_ABIS

What does it mean?

这是什么意思?

回答by Hiemanshu Sharma

INSTALL_FAILED_NO_MATCHING_ABISis when you are trying to install an app that has native libraries and it doesn't have a native library for your cpu architecture. For example if you compiled an app for armv7and are trying to install it on an emulator that uses the Intelarchitecture instead it will not work.

INSTALL_FAILED_NO_MATCHING_ABIS是当您尝试安装具有本机库的应用程序并且它没有适用于您的 CPU 架构的本机库时。例如,如果您为armv7编译了一个应用程序,并尝试将其安装在使用Intel架构的模拟器上,则它将无法工作。

回答by Asher Garland

INSTALL_FAILED_NO_MATCHING_ABIS is when you are trying to install an app that has native libraries and it doesn't have a native library for your cpu architecture. For example if you compiled an app for armv7 and are trying to install it on an emulator that uses the Intel architecture instead it will not work.

INSTALL_FAILED_NO_MATCHING_ABIS 是当您尝试安装具有本机库的应用程序并且它没有适用于您的 CPU 架构的本机库时。例如,如果您为 armv7 编译了一个应用程序,并尝试将其安装在使用 Intel 架构的模拟器上,则它将无法工作。

Using Xamarin on Visual Studio 2015.Fix this issue by:

在 Visual Studio 2015 上使用 Xamarin。通过以下方式修复此问题:

  1. Open your xamarin .sln
  2. Right click your android project
  3. Click properties
  4. Click Android Options
  5. Click the 'Advanced' tab
  6. Under "Supported architectures" make the following checked:

    1. armeabi-v7a
    2. x86
  7. save

  8. F5 (build)
  1. 打开你的 xamarin .sln
  2. 右键单击您的 android 项目
  3. 单击属性
  4. 点击安卓选项
  5. 单击“高级”选项卡
  6. 在“支持的架构”下进行以下检查:

    1. armeabi-v7a
    2. x86
  7. 节省

  8. F5(建造)

Edit:This solution has been reported as working on Visual Studio 2017as well.

编辑:据报道,此解决方案也适用于Visual Studio 2017

Edit 2:This solution has been reported as working on Visual Studio 2017 for Macas well.

编辑 2:据报道,此解决方案也适用于Visual Studio 2017 for Mac

回答by Driss Bounouar

I'm posting an answer from another thread because it's what worked well for me, the trick is to add support for both architectures :

我从另一个线程发布了一个答案,因为它对我来说效果很好,诀窍是添加对两种架构的支持:

Posting this because I could not find a direct answer and had to look at a couple of different posts to get what I wanted done...

发布这个是因为我找不到直接的答案,不得不查看几个不同的帖子才能完成我想做的事情......

I was able to use the x86 Accelerated (HAXM) emulator by simply adding this to my Module's build.gradle script Inside android{} block:

我可以通过简单地将它添加到我的模块的 build.gradle 脚本内的 android{} 块来使用 x86 加速 (HAXM) 模拟器:

splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi-v7a'
            universalApk true
        }
    }

Run (build)... Now there will be a (yourapp)-x86-debug.apk in your output folder. I'm sure there's a way to automate installing upon Run but I just start my preferred HAXM emulator and use command line:

运行 (build)... 现在你的输出文件夹中会有一个 (yourapp)-x86-debug.apk。我确定有一种方法可以在运行时自动安装,但我只是启动我喜欢的 HAXM 模拟器并使用命令行:

adb install (yourapp)-x86-debug.apk

回答by R00We

If you using Genymotion you need Installing ARM Translation and GApps

如果您使用 Genymotion,则需要安装 ARM Translation 和 GApps

回答by IgorGanapolsky

This is indeed a strange error that can be caused by multidexing your app. To get around it, use the following block in your app's build.gradlefile:

这确实是一个奇怪的错误,可能是由对您的应用程序进行多重索引造成的。要解决这个问题,请在应用的build.gradle文件中使用以下块:

android {
  splits {
    abi {
        enable true
        reset()
        include 'x86', 'armeabi-v7a'
        universalApk true
    }
  }
  ...[rest of your gradle script]

回答by Jonathan Perry

I know there were lots of answers here, but the TL;DR version is this (If you're using Xamarin Studio):

我知道这里有很多答案,但 TL;DR 版本是这样的(如果您使用的是 Xamarin Studio):

  1. Right click the Android project in the solution tree
  2. Select Options
  3. Go to Android Build
  4. Go to Advancedtab
  5. Check the architectures you use in your emulator (Probably x86/ armeabi-v7a/ armeabi)
  6. Make a kickass app :)
  1. 右键单击解决方案树中的 Android 项目
  2. 选择 Options
  3. Android Build
  4. 转到Advanced选项卡
  5. 检查您在模拟器中使用的架构(可能是x86/ armeabi-v7a/ armeabi
  6. 制作一个kickass应用程序:)

回答by vaibhav

This solution worked for me. Try this, add following lines in your app's build.gradlefile

这个解决方案对我有用。试试这个,在你的应用的build.gradle文件中添加以下几行

splits {
    abi {
        enable true
        reset()
        include 'x86', 'armeabi-v7a'
        universalApk true
    }
}

回答by Saba

On Android 8:

在 Android 8 上:

apache.commons.io:2.4

apache.commons.io:2.4

it gives INSTALL_FAILED_NO_MATCHING_ABIS, try to change it to 2.5 or 2.6 and it will work or comment it out.

它给出了 INSTALL_FAILED_NO_MATCHING_ABIS,尝试将其更改为 2.5 或 2.6,它会起作用或将其注释掉。

回答by Saba

this worked for me ... Android > Gradle Scripts > build.gradle (Module:app) add inside android*

这对我有用... Android > Gradle Scripts > build.gradle (Module:app) add inside android*

android {
  //   compileSdkVersion 27
     defaultConfig {
        //
     }
     buildTypes {
        //
     }
    // buildToolsVersion '27.0.3'

    splits {
           abi {
                 enable true
                 reset()
                 include 'x86', 'armeabi-v7a'
                 universalApk true
               }
    }
 }

enter image description here

在此处输入图片说明

回答by muetzenflo

The comment of @enl8enmentnow should be an answer to fix the problem using genymotion:

@enl8enmentnow 的评论应该是使用 genymotion 解决问题的答案:

If you have this problem on Genymotion even when using the ARM translator it is because you are creating an x86 virtual device like the Google Nexus 10. Pick an ARM virtual device instead, like one of the Custom Tablets.

如果您在使用 ARM 转换器时在 Genymotion 上遇到此问题,那是因为您正在创建一个 x86 虚拟设备,例如 Google Nexus 10。选择一个 ARM 虚拟设备,例如其中一个自定义平板电脑。