gpt4 book ai didi

android - 运行时异常 :Unable to find pre-dex

转载 作者:行者123 更新时间:2023-11-29 01:09:49 25 4
gpt4 key购买 nike

当我尝试在 Studio 2.3 中运行项目时出现错误

失败:构建失败,出现异常。

Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: Unable to pre-dex 'C:\Users\xxxxx.android\build-cache\398355577ef004d4acd9193504f7c3a1515a7b74\output\jars\classes.jar' to 'C:\Users\xxxxx\Desktop\yyyyyy\build\intermediates\transforms\dex\debug\folders\1000\10\classes_e69b3e5768928e64d7b1ee699d266a32be93412d'

我已经尝试了下面的步骤,但还是一样1)清理和重建2)通过选择“Invalidate caches and restart”重启Android studio3) 同时重启笔记本电脑

这是我的应用模块build.gradle文件

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.1'

dexOptions {
preDexLibraries false
javaMaxHeapSize "2g" // Use gig increments depending on needs
incremental true
}

defaultConfig {
applicationId "com.test.example"
minSdkVersion 14
targetSdkVersion 24
multiDexEnabled true
testInstrumentationRunner
'android.support.test.runner.AndroidJUnitRunner'
}

lintOptions {
disable 'NamespaceTypo'
enable 'MissingTranslation'
abortOnError false
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.txt'
}
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}

instrumentTest.setRoot('tests')
debug.setRoot('build-types/debug')

}

packagingOptions {
exclude 'META-INF/BCKEY.DSA'
exclude 'META-INF/BCKEY.SF'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

}

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:preference-v7:24.1.1'
compile 'com.android.support:preference-v14:24.1.1'
compile 'com.google.http-client:google-http-client-android:1.20.0'
compile 'com.google.api-client:google-api-client-android:1.20.0'
compile 'com.google.api-client:google-api-client-gson:1.22.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.makeramen:roundedimageview:2.2.0'
compile 'me.leolin:ShortcutBadger:1.1.4@aar'
compile 'org.whispersystems:axolotl-android:1.3.4'
compile 'org.bouncycastle:bcprov-jdk15on:1.52'
compile 'org.bouncycastle:bcmail-jdk15on:1.52'
compile 'org.jitsi:org.otr4j:0.22'
compile 'org.sufficientlysecure:openpgp-api:10.0'
compile 'com.soundcloud.android:android-crop:1.0.1@aar'
compile 'org.gnu.inet:libidn:1.15'
compile 'com.google.zxing:core:3.2.1'
compile 'com.google.zxing:android-integration:3.2.1'
compile 'de.measite.minidns:minidns:0.1.7'
compile 'de.timroes.android:EnhancedListView:0.3.4'
compile ('com.google.android.gms:play-services-gcm:9.0.1')
compile ('com.android.support:support-v13:23.2.1')
compile 'com.android.support:multidex:1.0.1'
}

apply plugin: 'com.google.gms.google-services'

下面是我的主要 build.gradle 文件

buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.google.gms:google-services:3.0.0'
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
}

最佳答案

我已经解决了这个问题。由于内存大小问题,我遇到了这个错误,增加 ram 解决了我的问题

关于android - 运行时异常 :Unable to find pre-dex,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43964070/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com