2016-11-30 5 views
0

Hier ist meine graddle:Android Studio - transformClassesWithDexForDebug Fehler

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.0" 
    defaultConfig { 
     applicationId "com.xxx.yyy" 
     minSdkVersion 16 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES.txt' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/dependencies.txt' 
     exclude 'META-INF/LGPL2.1' 
     exclude 'META-INF/INDEX.LIST' 
    } 
    dexOptions { 
     incremental true 
     javaMaxHeapSize "4g" 
     preDexLibraries = false 
    } 
} 
repositories { 
    maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' } 
} 
dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:multidex:1.0.0' 
    //Support Library 
    compile 'com.android.support:appcompat-v7:25.0.1' 
    compile 'com.android.support:design:25.0.1' 
    //Test 
    androidTestCompile 'com.google.code.findbugs:jsr305:3.0.0' 
    testCompile 'junit:junit:4.12' 
    //Google Play Services 
    compile 'com.google.android.gms:play-services-appindexing:8.4.0' 
    //Common Langs 3 
    compile 'org.apache.commons:commons-lang3:3.5' 
    //Google Cloud Translate 
    compile ('com.google.cloud:google-cloud-translate:0.7.0'){ 
     exclude group: 'org.apache.httpcomponents', module: 'httpclient' 
     exclude group: 'org.json', module: 'json' 
    } 
    //Ksoap 2 
    compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.2' 
    //Gson (Shared Preferences) 
    compile 'com.google.code.gson:gson:2.7' 
    //Loading Animation 
    compile 'com.pnikosis:materialish-progress:1.7' 
    //Snackbar 
    compile 'com.androidadvance:topsnackbar:1.1.1' 
    //SVG Animation 
    compile 'com.jaredrummler:animated-svg-view:1.0.0' 
} 

Hier ist die Androidmanifest.xmlpart

<application 
     android:name="android.support.multidex.MultiDexApplication" 
     android:allowBackup="true" 
     android:configChanges="orientation" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:screenOrientation="portrait" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme"> 
     <activity 
      android:name=".SplashAnimationActivity" 

Hier ist das Android-Studio Fehler:

Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug] 
Warning:The `android.dexOptions.incremental` property is deprecated and it has no effect on the build process. 
Error:trouble processing "javax/transaction/HeuristicCommitException.class": 
Error:Ill-advised or mistaken usage of a core class (java.* or javax.*) 
Error:when not building a core library. 
Error:This is often due to inadvertently including a core library file 
Error:in your application's project, when using an IDE (such as 
Error:Eclipse). If you are sure you're not intentionally defining a 
Error:core class, then this is the most likely explanation of what's 
Error:going on. 
Error:However, you might actually be trying to define a class in a core 
Error:namespace, the source of which you may have taken, for example, 
Error:from a non-Android virtual machine project. This will most 
Error:assuredly not work. At a minimum, it jeopardizes the 
Error:compatibility of your app with future versions of the platform. 
Error:It is also often of questionable legality. 
Error:If you really intend to build a core library -- which is only 
Error:appropriate as part of creating a full virtual machine 
Error:distribution, as opposed to compiling an application -- then use 
Error:the "--core-library" option to suppress this error message. 
Error:If you go ahead and use "--core-library" but are in fact 
Error:building an application, then be forewarned that your application 
Error:will still fail to build or run, at some point. Please be 
Error:prepared for angry customers who find, for example, that your 
Error:application ceases to function once they upgrade their operating 
Error:system. You will be to blame for this problem. 
Error:If you are legitimately using some code that happens to be in a 
Error:core package, then the easiest safe alternative you have is to 
Error:repackage that code. That is, move the classes in question into 
Error:your own package namespace. This means that they will never be in 
Error:conflict with core system classes. JarJar is a tool that may help 
Error:you in this endeavor. If you find that you cannot do this, then 
Error:that is an indication that the path you are on will ultimately 
Error:lead to pain, suffering, grief, and lamentation. 
Error:1 error; aborting 
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. 
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException 
Information:Total time: 46.622 secs 
Information:34 errors 
Information:1 warning 
Information:See complete output in console 

ich arbeite auf einer Google Cloud-Anwendung übersetzen. Ich bekomme Fehler.

Ich suche und ich habe versucht, eine Lösung, aber hilft mir nicht.

Was ist das Problem?

Mein Ordner libs ist leer.

bitte helfen Sie mir.

+0

haben Sie das Multidex initialisiert? –

+0

check out: http://stackoverflow.com/questions/37497882/errorexecution-failed-for-task-apptransformclasseswithdexfordebug-in-androi/37498940#37498940 – Ironman

Antwort

1

Ich hatte ein gleiches Problem. In meiner App benutze ich guava-retrying Bibliothek, die Google Guava Bibliothek Version 21 holte. Guava Version 21 erfordert JDK 1.8 ohne Rückportierung Unterstützung und das verursachte diesen Fehler in meinem Fall.

Ich konnte es lösen, indem die Guave-retrying Bibliothek mit, so dass es Version 19.0 von Guave-Bibliothek verwendet:

compile ("com.github.rholder:guava-retrying:2.0.0") { 
    exclude group: 'com.google.guava', module: 'guava' 
} 
compile 'com.google.guava:guava:19.0' 

Grundsätzlich würden Sie überprüfen mögen, ob eine Abhängigkeit Ihrer App JDK benötigen 1,8 bis kompilieren und entfernen/downgraden sie.

Verwandte Themen