【问题标题】:java.lang.RuntimeException: No dex files created at ...../instant-runjava.lang.RuntimeException: 没有在 ...../instant-run 创建 dex 文件
【发布时间】:2023-03-15 20:53:02
【问题描述】:

错误:任务 ':app:transformClassesWithDexForDebug' 执行失败。 com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: 没有在 E:\ad\projects\NearVeg\app\build\intermediates\transforms\dex\debug\ 创建 dex 文件文件夹\1000\10\instant-run_d9024a87e9e4c0d6db37a8c6ebdfd3214367595b

我在 defaultConfig 中添加了 multiDexEnabled true 并替换为

编译'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'

所以请不要给出这样的建议。

 defaultConfig {
    applicationId "com.bhunnu.nearveg"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

repositories {
  mavenCentral()
}

dependencies {
     compile fileTree(dir: 'libs', include: ['*.jar'])
     testCompile 'junit:junit:4.12'
     compile 'com.android.support:appcompat-v7:23.3.0'
     compile 'com.android.support:design:23.3.0'
     compile 'com.facebook.android:facebook-android-sdk:4.0.0'
     compile 'com.google.android.gms:play-services:8.4.0'
     compile 'com.android.support:multidex:1.0.0'
     compile 'com.squareup.picasso:picasso:2.5.2'
     compile 'com.github.rahatarmanahmed:circularprogressview:2.5.0'
}

在清单文件中:

  <application
    android:allowBackup="true"
    android:icon="@drawable/icon1"
    android:label="@string/app_name"
    android:name="android.support.multidex.MultiDexApplication"
    android:theme="@style/AppTheme">

已经提出了一个与此相关的问题,但仍然没有解决方案。提前致谢

【问题讨论】:

标签: android android-gradle-plugin android-manifest


【解决方案1】:

为了暂时删除错误,我只是使用 android studio 的 Instant Run 功能。

为了启用 Instant 刚刚跟随:

1) 文件 => 设置。

2) 点击构建、执行、部署。

3) 点击即时运行

4) 取消选中以启用即时运行到热交换代码.....

【讨论】:

    猜你喜欢
    • 2016-09-03
    • 1970-01-01
    • 2016-09-16
    • 1970-01-01
    • 1970-01-01
    • 2021-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多