我将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