2016-06-02 2 views
2

나는 다음과 같은 출력을 얻을 내 아주 간단한 안드로이드 응용 프로그램을 실행하려고하면 : 나는 원래 multidex를 사용되지 않은안드로이드 - 실행은 작업 실패 ': 응용 프로그램 : transformClassesWithMultidexlistForDebug'을

Information:Gradle: Executing tasks: [:app:assembleDebug]

Information:Kotlin: Kotlin JPS plugin is disabled Information:6/2/16, 11:25 AM - Compilation completed with 1 error and 0 warnings in 6s 706ms

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

을하고 난을 얻고 있었다 표준 덱스와 비슷한 오류. 다음은 다중 출력을 사용하지 않고 얻은 원래 출력입니다.

Information:Gradle: Executing tasks: [:app:assembleDebug]

Information:Kotlin: Kotlin JPS plugin is disabled Information:6/2/16, 11:28 AM - Compilation completed with 1 error and 0 warnings in 7s 624ms

Error:Gradle: Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

생각할 수있는 모든 솔루션을 시도했지만 아무런 효과가없는 것 같습니다. 당신이 볼 수있는 아무 소용하고, 댓글을 주석 내가 라인의 다양한 조합으로 실행 시도

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "24.0.0 rc4" 

    defaultConfig { 
     applicationId "com.example.XXX.testapplication" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
    } 
    buildTypes { 
//  debug { 
//   minifyEnabled true 
//   proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
//  } 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    dexOptions { 
     incremental = true; 
     javaMaxHeapSize "4g" 
     //preDexLibraries = false 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support:design:23.4.0' 
} 

:

여기 내 응용 프로그램 수준 build.gradle입니다.

"lib"폴더에 파일이 없습니다. 여기

내 높은 수준의 build.gradle입니다 :

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.5.0' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

그리고 여기 내 AndroidManifest.xml에 있습니다 :

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
      package="com.example.XXX.testapplication"> 

    <application 
      android:allowBackup="true" 
      android:icon="@mipmap/ic_launcher" 
      android:label="@string/app_name" 
      android:supportsRtl="true" 
      android:name="android.support.multidex.MultiDexApplication" 
      android:theme="@style/AppTheme"> 
     <activity 
       android:name=".MainActivity" 
       android:label="@string/app_name" 
       android:theme="@style/AppTheme.NoActionBar"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN"/> 

       <category android:name="android.intent.category.LAUNCHER"/> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 
+0

오류뿐 아니라 전체 gradle 출력을 표시 할 수 있습니까? –

+0

어떻게 할 수 있습니까? 죄송합니다.이 기술을 처음 접했습니다. – Infamous911

+0

글쎄, 그 오류를 어딘가에서 복사하셨습니까? 위에 나온 출력물로 질문을 편집 할 수도 있습니다. –

답변

1

당신은 당신이 그렇게 할 필요가 multidex 지원을 통합하려는 경우 유치한 방식으로. 이 link

에서 의 변경 사항은 다음을 수행하십시오 :

추가는 defaultConfig 폐쇄에 Gradle을 파일에 충실 multiDexEnabled. 매니페스트에서

는 다음과 지원 라이브러리에서 MultiDexApplication 클래스를 추가로 :`

<application 
    ... 
    android:name="android.support.multidex.MultiDexApplication"> 
    ... 
</application> 
또한

`

이미 프로젝트의 응용 프로그램 클래스가있는 경우를 오버라이드 (override), 참고 메서드 attachBaseContext() 및 메서드 호출 : MultiDex.install (this)

+0

attachBaseContext()와 관련된 부분을 제외하고는 이미 모든 작업을 완료했습니다. AppCompatActivity를 확장하는 MainActivity.java 클래스에서이 메서드를 재정의하려고하면 @Override 태그는 수퍼 클래스의 메서드를 재정의하지 않으므로 오류라고 나와 있습니다. – Infamous911

+0

@ Infamous911 당신은 Activity에 넣지 말고 MultidexApplication을 확장하는 Application 클래스에 넣을 것입니다. 그러나 지금까지 보았 듯이 문제가 해결되지 않았기 때문에 multidex는 필요 없습니다. –

+0

응용 프로그램을 확장하고 MultiDexApplication을 확장합니다. @ cricket_007 일반적으로 Multidex를 사용할 필요가 없습니다. 종속성이 더 적거나 없으면 Multidex를 사용할 필요가 없습니다. –

관련 문제