問題一:
Error:Execution failed for task ':Test:transformClassesWithDexForDebug'.> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
出現這個問題的原因應該不單一, 這個只是一種:從網上也是搜索了好長時間, 有說是.9圖片的合法性問題,有說是arraylist問題,但是都沒有解決我的問題,之后仔細閱讀了log, 發現有這么一段
Running dex as a separate process. To run dex in process, the Gradle daemon needs a larger heap. It currently has 1136 MB. For faster builds, increase the maximum heap size for the Gradle daemon to at least 2560 MB (based on the dexOptions.javaMaxHeapSize = 2g). To do this set org.gradle.jvmargs=-Xmx2560M in the project gradle.properties. For more information see https://docs.gradle.org/current/userguide/build_environment.html
實際上就是說內存不夠用了,因此它給出了需要設定的內存大小:
org.gradle.jvmargs=-Xmx2560M
,所以在gradle.properties
這個文件夾里面按照它所說的改正,編譯成功。