Ich versuche, eine E-Mail wie in diesem Beitrag zu senden: Sending Email in Android using JavaMail API without using the default/built-in appFehler: Ausführung fehlgeschlagen für Task ': app: transformClassesWithDexForDebug'. versuchen, E-Mails
und das Hinzufügen in meiner build.gradle und App-Datei dieser Zeilen: https://javaee.github.io/javamail/Android
Fehler:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/sun/activation/registries/LineTokenizer;
Aber mit der folgenden App-Datei habe ich eine Ausführung fehlgeschlagen und weiß nicht warum.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.github.ocaparrostortosa.MyApplication"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
pickFirst 'META-INF/LICENSE.txt' // picks the JavaMail license file
}
}
dependencies {
compile 'com.sun.mail:android-mail:1.5.5'
compile 'com.sun.mail:android-activation:1.5.5'
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-database:10.2.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
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'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Und dieses ist mein Projekt gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.java.net/content/groups/public/"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
mir jemand Kann bitte helfen? Ich bin kurz davor, das Projekt zu beenden: D
P.D: Entschuldigung für mein Englisch und für die Präsentation, ich bin neu in stackoverflow.
Wie groß ist Ihre App? übertrifft es das 64-MB-APK-Limit? –
Problem ist wahrscheinlich die Abhängigkeit von Google-Diensten. Ich denke, es ist wirklich groß. Vielleicht hilft multidex: https://stackoverflow.com/questions/26609734/how-to-enable-multidexing-with-the-new-android-multidex-support-library#27284064 – PhilipB
Nein, nur 2KB die app.file und die Projekt im Allgemeinen 50MB. Ich weiß nicht, wie das Gewicht der apk-Datei zu sehen ist. –