2017-04-06 1 views
1

android studio에서 안드로이드 프로젝트에서 일했습니다. 내가 gradle 빌드를 실행하고 다음 오류가 표시 될 때 시작되었습니다. 누구나 문제안드로이드 오류 : ': app : transformClassesWithDexForDebug'작업에 대한 실행이 실패했습니다.

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3

build.gradle

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "com.stage.lookara" 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled = true 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/DEPENDENCIES' 
    } 
    } 

    dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:design:23.1.1' 
    compile files('libs/twitter4j-core-4.0.4.jar') 
    compile files('libs/slider.jar') 
    compile 'com.google.android.gms:play-services:8.3.0' 
    compile 'com.facebook.android:facebook-android-sdk:4.0.0' 
    compile 'com.etsy.android.grid:library:1.0.5' 
    compile 'com.baoyz.swipemenulistview:library:1.3.0' 
    compile files('libs/universal-image-loader-1.9.5.jar') 
    compile 'com.github.darsh2:MultipleImageSelect:v0.0.3' 
    compile files('libs/pherialize-1.2.1.jar') 
    compile 'com.wang.avi:library:2.1.3' 
    compile 'com.mikhaellopez:circularprogressbar:1.1.1' 
    compile 'com.android.support:recyclerview-v7:23.1.1' 
    compile 
    'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1' 
    compile 'com.felipecsl:gifimageview:2.1.0' 
    } 

    repositories { 
    jcenter() 
    } 

    dependencies { 
    compile 'org.adw.library:discrete-seekbar:1.0.1' 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:19.+' 
    compile 'org.jsoup:jsoup:1.7.3' 
    } 
+0

덱스를 구현하고'이 줄을 넣어에서 TRUE '를 multiDexEnabled your build.gradle –

+1

이 링크 http://stackoverflow.com/a/33718050/6644676을 참조하십시오. – Furqan

+0

IDE의 오른쪽 하단에있는 "Gradle console"을 열면 문제에 대한 자세한 정보가 표시됩니다. – azizbekian

답변

1

을 당신은 전체 구글 Play 서비스 라이브러리 컴파일 :

compile 'com.google.android.gms:play-services:8.3.0' 

컴파일시 64K reference limit'을 통과 할 수있는 ..

참조 this

if u

compile 'com.google.android.gms:play-services-maps:8.3.0' 
compile 'com.google.android.gms:play-services-plus:8.3.0' 
compile 'com.google.android.gms:play-services-location:8.3.0' 

나는 또한 정말 경우 compile 'com.google.android.gms:play-services:10.2.1'

2 플레이 서비스 방법의 최신 버전

를 사용하는 것이 좋습니다 것입니다 : 당신이 Selectively compiling APIs into your executable

처럼이 할 수있는 라이브러리에서 일부 서비스를 사용 전체 라이브러리를 사용하려면 응용 프로그램에서 Multidex을 활성화하십시오. 당신의 Gradle을에서

:

android { 
    defaultConfig { 
     ... 
     minSdkVersion 15 
     targetSdkVersion 25 
     multiDexEnabled true 
    } 
    ... 
} 

dependencies { 
    compile 'com.android.support:multidex:1.0.1' 
} 

응용 프로그램 클래스 :

public class MyApplication extends SomeOtherApplication { 
    @Override 
    protected void attachBaseContext(Context base) { 
    super.attachBaseContext(base); 
    MultiDex.install(this); 
    } 
} 

가 매니페스트에 응용 프로그램 클래스를 정의 :

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

덕분에 많은 작업 .. – Sasi

0

깨끗한 첫 번째 시도에서 무엇을 도와.

작동하지 않는 경우 build.gradle 파일에 multiDexEnabled를 추가하십시오.

defaultConfig { 
    multiDexEnabled true 
} 

이를 참조하십시오 com.android.build.transform.api.TransformException

관련 문제