2016-10-25 2 views
-2

내 애플리케이션이 Google Play라고 말하면 Android Studio를 컴파일 할 때 다음 오류가 발생합니다.CPU 사용률 컴파일시 Google지도

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.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:
Process 'command 'C:\Program Files\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 2

+0

오류를 추가를 추가 : 메소드 참조의 수를 덱스 파일에서 64K를 초과 할 수 없습니다. https://developer.android.com/tools/building/multidex.html에서이 문제를 해결하는 방법을 알아보십시오. –

+1

이것은 CPU 사용과 아무 관련이 없습니다. ** 컴파일 할 때 ** CPU 사용량을 100 %로 원합니다. 말 그대로 컴퓨터가 요청한 작업을 수행하고 있음을 의미합니다. – chrylis

+0

build.gradle 파일을 게시 할 수 있습니까? – Kunu

답변

0

귀하는 전체 Google Play 서비스에 의존합니다. the documentation에 명시된 바와 같이 : 당신은 단지 프로젝트에 Google지도를 사용하는 경우

If the number of method references in your app exceeds the 65K limit, your app may fail to compile. You may be able to mitigate this problem when compiling your app by specifying only the specific Google Play services APIs your app uses, instead of all of them.

그래서, 당신은이 종속성을 사용할 수 있습니다 대신

dependencies { 
    compile 'com.google.android.gms:play-services-maps:9.6.1' 
} 

(이 예를 들어 구글의 마지막 vesion Play 서비스 사용)

dependencies { 
    compile 'com.google.android.gms:play-services:9.6.1' 
} 
0

우선 라이브러리 컴파일 중 +을 사용하지 마십시오.

Google Play 서비스 전체를 추가하는 대신 필요한 항목 만 추가하십시오.

귀하의 경우에는

대신

compile 'com.google.android.gms:play-services:4.3.+' 

다운로드 최신 구글 저장소 및

compile 'com.google.android.gms:play-services-maps:9.8.0'