安装APP出错,Android Unable to identify the apk for variant arm-debug and device

android {
    compileSdkVersion 21
    buildToolsVersion '21.1.2'
    defaultConfig {
        applicationId "com.facebook.samples.comparison"
        minSdkVersion 9
        targetSdkVersion 21
        versionCode 1
        versionName "${VERSION_NAME}"

        testApplicationId "com.facebook.samples.comparison.test"
        testInstrumentationRunner "android.test.InstrumentationTestRunner"

    }
    splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi-v7a', 'mips'
            universalApk true
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), '../../proguard-fresco.pro'
        }
    }

    lintOptions {
        warning 'InvalidPackage'
    }

    productFlavors {
        x86 {
            ndk {
                abiFilter "x86"
            }
        }
        armv7 {
            ndk {
                abiFilter "armeabi-v7a"
            }
        }
        arm {
            ndk {
                abiFilter "armeabi"
            }
        }
    }
}

出现这种错误呢,网上说是改应用程序不支持模拟器一下架构导致的,然后在Stackovewflow搜索一下 照着修改了一下gradle文件然后项目就可以成功运行到模拟器上了.

这是链接网址:

http://stackoverflow.com/questions/29182833/android-unable-to-identify-the-apk-for-variant-arm-debug-and-device

在android目录下添加如下代码

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


这样在将app运行到模拟器上,就不会出现错误了.

你可能感兴趣的:(while,error,running,variant,arm-debug)