2017-05-23 65 views
0

先生请帮助我,我的排球错误而运行凌空Android的错误,同时运行

这是我的logcat 错误:执行失败的任务“:应用程序: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/android/volley/VolleyError;

,这是我的应用程序模块的gradle

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.3" 
    defaultConfig { 
     applicationId "com.kalasubaindonesia.kalasubaindonesiamekanik" 
     minSdkVersion 14 
     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' 
     } 
    } 
} 

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:appcompat-v7:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:multidex:1.0.1'`enter code here` 
    compile files ('libs/volley1019.jar') // i use offline volley 
} 

如何解决呢?谢谢

回答

0

我认为这个问题与Multidex有关。您是否尝试添加

multiDexEnabled true 

到您的defaultConfig中?

您也可以在您的清单补充一点:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.android.multidex.myapplication"> 
    <application 
    android:name="android.support.multidex.MultiDexApplication"> 
    </application> 
</manifest> 

更多信息: https://developer.android.com/studio/build/multidex.html#mdex-gradle

+0

谢谢米哈尔 –

+0

如果它帮助,请接受我的答案。谢谢。 –

+0

我是新手在这里stackoverflow michal hehe –