Android 8 上的 INSTALL_FAILED_NO_MATCHING_ABIS 错误 [英] INSTALL_FAILED_NO_MATCHING_ABIS error on Android 8

查看:35
本文介绍了Android 8 上的 INSTALL_FAILED_NO_MATCHING_ABIS 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建连接我的 Pixel 手机的应用.我最近将我的手机升级到 Android 8.我能够在我的手机中构建和打开应用程序,直到最后一次升级,但在这次升级之后,我得到 失败 [INSTALL_FAILED_NO_MATCHING_ABIS:无法提取本机库,res=-113]错误.

下面是我的 gradle 文件.有人可以告诉我这是什么问题吗??

应用插件:'com.android.application'安卓 {compileSdkVersion 26buildToolsVersion '26.0.1'默认配置{applicationId "com.my.app.googlemaps"minSdk 版本 16目标SDK版本26版本代码 1版本名称1.0"testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"vectorDrawables.useSupportLibrary = truemultiDexEnabled = 真}构建类型{释放 {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}分裂{阿比{启用真重启()包括x86"、armeabi-v7a"通用Apk真}}lintOptions {abortOnError false}包装选项{排除元信息/依赖项"排除元信息/通知"排除元信息/许可证"排除 'META-INF/LICENSE.txt'排除 'META-INF/NOTICE.txt'}产品风味{}}依赖{编译文件树(包括:['*.jar'],目录:'libs')androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {排除组:'com.android.support',模块:'support-annotations'})...testCompile 'junit:junit:4.12'}应用插件:'com.google.gms.google-services'

解决方案

它有同样的问题,它在替换一个 apache 库 (commons-io) 与不同的 commons-io 后工作,即来自另一个捆绑包.

切换到新的开发设备(Pixel Phone w/Android 8.0 Oreo)后,我遇到了这个问题.

解决方案 1

在您的情况下,您可以停止使用文件系统中的本地 jar(compile fileTree(include: ['*.jar'], dir: 'libs'))并使用适当的 gradle 依赖项来自 bintray(例如).

原始 gradle 依赖项(抛出与您描述的相同的错误):

错误: 失败 [INSTALL_FAILED_NO_MATCHING_ABIS:无法提取本机库,res=-113]

依赖项{编译'org.apache.directory.studio:org.apache.commons.io:2.4'编译'commons-cli:commons-cli:1.4'}

使用适当的 commons-io 工件处理 build.gradle:

依赖项{...编译组:'commons-io',名称:'commons-io',版本:'2.5'编译组:'commons-cli',名称:'commons-cli',版本:'1.4'...}

<块引用>

忽略不同的依赖符号,没关系

解决方案 2

您定义了多个目标 ABI,检查过您的设备支持哪一个.也许您必须添加另一个,以与您的设备 ABI 兼容.

您可以在 Application.mk

另见:

I am trying to build my app connecting my Pixel phone. I recently upgraded my phone to Android 8. I was able to build and open the app in my phone until the last upgrade, but after this upgrade, I get Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113] error.

Below is my gradle file. Can someone please tell me what is the issue ??

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.1'
    defaultConfig {
        applicationId "com.my.app.googlemaps"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi-v7a'
            universalApk true
        }
    }
    lintOptions {
        abortOnError false
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
...
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

解决方案

It had the same problem, it worked after replacing an apache library (commons-io) with a different commons-io, that was from another bundle.

The problem occured to me after switching to a new development device (Pixel Phone w/ Android 8.0 Oreo).

Solution 1

In your case, you could stop using your local jars from the filesystem (compile fileTree(include: ['*.jar'], dir: 'libs')) and use proper gradle dependencies from bintray (e.g.).

Original gradle dependency (threw the same error that you describe):

ERROR: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

dependencies {
    compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
    compile 'commons-cli:commons-cli:1.4'
}

Working build.gradle with proper commons-io artifacts:

dependencies {
    ...
    compile group: 'commons-io', name: 'commons-io', version: '2.5'
    compile group: 'commons-cli', name: 'commons-cli', version: '1.4'
    ...
}

Ignore the different dependency notation, it doesn't matter

Solution 2

You define multiple target ABI, did you check, which one your device supports. Perhaps you have to add another one, to be compatible to your device ABI.

You can define them in the Application.mk

Also see:

这篇关于Android 8 上的 INSTALL_FAILED_NO_MATCHING_ABIS 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆