首页 > 解决方案 > 安装失败并显示消息 Failed to finalize session : INSTALL_FAILED_DEXOPT:

问题描述

Android Studio 没有运行我的任何项目,甚至没有运行 hello world 应用程序。

我几乎尝试了一切。我已经敲了2天的头了。我尝试了所有这些:

如何解决 INSTALL_FAILED_DEXOPT 错误?

我禁用了即时运行,但没有任何效果。我已经清理了我的项目,但没有任何效果。我曾尝试在其上构建具有相同错误的真实手机。我试过清除模拟器的数据但没有效果。在这里尝试了几乎所有东西之后。我也卸载了Android Studio,重装了3次,没有效果。

gradle:应用程序应用插件:'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.tete.myapplication"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

项目级 gradle 文件为:

// 顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

这是一个非常简单的 Hello world 项目。请告诉我您还需要什么信息。这个问题已经开始让我生气了。

标签: androidgradle

解决方案


推荐阅读