我將Google地圖API集成到我的應用程序中,現在需要更多時間來首次啓動(即使我不啓動地圖),而且我也不能使用地圖Build APK
。我可以簡單地在設備上運行它,但無法在Android Studio中構建它。無法使用谷歌地圖創建應用程序
依賴關係:
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.google.android.gms:play-services:9.8.0'
下面是錯誤的:
Error:The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
:app:transformClassesWithDexForDebug FAILED
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_101\bin\java.exe'' finished with non-zero exit value 2
於是,兩個問題:如何降低時間首次發射,以及如何構建應用程序?
乘坐看看http://stackoverflow.com/questions/40958192/i-get-errorexecution-failed-for-task-apptransformclasseswithdexfordebug-w/40958284#40958284 – antonio
和在這裏 - > http://stackoverflow.com/a/40958251/5188159 –
多個庫的問題,您正在使用庫文件和gradle鏈接,請確保您正在使用所需的庫。還要在defaultConfig中添加multiDexEnabled true。 – Nithin