2016-06-12 45 views
0

錯誤這樣 信息發生:搖籃任務[:應用:assembleDebug] :應用程序:預生成UP-TO-DATE :應用:preDebugBuild UP-TO-DATE :應用:checkDebugManifest :應用程序:preReleaseBuild UP-TO-DATE :應用程序:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE :應用程序:prepareComAndroidSupportDesign2311Library UP-TO-DATE :應用程序:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE :應用程序:prepareComAndroidSupportRecyclerviewV72311Library UP-TO - 日期 :app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE :app:prepareComFacebookA ndroidFacebookAndroidSdk420Library UP-TO-DATE :應用:prepareComGoogleAndroidGmsPlayServices840Library UP-TO-DATE :應用:prepareComGoogleAndroidGmsPlayServicesAds840Library UP-TO-DATE :應用:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library UP-TO-DATE :應用:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library UP-TO-DATE :應用程序: prepareComGoogleAndroidGmsPlayServicesAppinvite840Library UP-TO-DATE :應用:prepareComGoogleAndroidGmsPlayServicesAppstate840Library UP-TO-DATE :應用:prepareComGoogleAndroidGmsPlayServicesAuth840Library UP-TO-DATE :應用:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE :應用:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesCast840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesDrive840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesFitness840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesGames840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesIdentity840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesLocation840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesMaps840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesNearby840Library UP-TO -date :應用程序:prepareComGoogleAndroidGmsPlayServicesPanorama840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesPlus840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesVision840Library UP-TO-DATE :應用程序:prepareComGoogleAndroidGmsPlayServicesWallet840Library UP-TO -date :應用程序:prepareComGoogleAndroidGmsPlayServicesWearable840Library UP-TO-DATE :應用程序:prepareDebugDependencies :應用程序:compileDebugAidl UP-TO-DATE :應用程序:compileDebugRenderscript UP-TO-DATE :應用程序:generateDebugBuildConfig UP-TO-DATE :應用:mergeDebugShaders UP-TO-DATE :應用程序:compileDebugShaders UP-TO-DATE :應用程序:generateDebugAssets UP-TO-DATE :應用程序:mergeDebugAssets UP-TO-DATE :應用程序:generateDebugResValues UP-TO-DATE :應用程序:generateDebugResources UP-TO-DATE :應用程序:mergeDebugResources UP-TO-DATE :應用程序:processDebugManifest UP-TO-DATE :應用程序:processDebugResources UP-TO-DATE :應用程序:generateDebugSources UP-TO-DATE :應用程序:incrementalDebugJavaCompilationSafeguard UP-TO-DATE :app:compileDebugJavaWithJavac 注意:C:\ Users \ rockstar \ Desktop \ AstroMaze \ app \ src \ main \ java \ com \ org \ astromaze \ MainActivityUsers.java使用或覆蓋棄用的API。 注意:使用-Xlint:deprecation重新編譯以獲取詳細信息。 在2.053秒內完成6個類的漸進式編譯。 :應用程序:compileDebugNdk UP-TO-DATE :應用程序:compileDebugSources :應用程序:prePackageMarkerForDebug :應用程序:transformClassesWithDexForDebug 要在進程中運行DEX中,搖籃守護程序需要更大的堆。 它目前大約有910 MB。 要獲得更快的構建,請將Gradle守護程序的最大堆大小增加到2048 MB以上。 要執行此操作,請在項目gradle.properties中設置org.gradle.jvmargs = -Xmx2048M。 欲瞭解更多信息,請參閱https://docs.gradle.org/current/userguide/build_environment.html 錯誤:.dex文件中的方法引用數量不能超過64K。 瞭解如何在https://developer.android.com/tools/building/multidex.html 解決此問題:app:transformClassesWithDexForDebug失敗 錯誤:執行任務':app:transformClassesWithDexForDebug'失敗。錯誤,當我在Android Studio中添加jar文件

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_91\bin\java.exe'' finished with non-zero exit value 2 Information:BUILD FAILED Information:Total time: 17.268 secs Information:2 errors Information:0 warnings Information:See complete output in console

+0

使用以下解決方案: http://stackoverflow.com/questions/36785014/the-number-of-method-references-in-a-dex-file-cannot-exceed-64k-api-17 –

+0

when我添加了任何生成錯誤的lib我會嘗試你的鏈接解決方案,但它仍然顯示錯誤 –

回答

0

基本上是你的錯誤是: - 是

1) Error:Execution failed for task ':app:transformClassesWithDexForDebug'. 

2) Error:The number of method references in a .dex file cannot exceed 64K. 

解決這些錯誤如下: -

1)添加multiDexEnabled真正線在你的build.gradle(模塊:應用)defaultConfig

2)用下面的代碼替換gradle.properties文件的全部內容: -

# Project-wide Gradle settings. 

# IDE (e.g. Android Studio) users: 
# Gradle settings configured through the IDE *will override* 
# any settings specified in this file. 

# For more details on how to configure your build environment visit 
# http://www.gradle.org/docs/current/userguide/build_environment.html 

# Specifies the JVM arguments used for the daemon process. 
# The setting is particularly useful for tweaking memory settings. 
# Default value: -Xmx10248m -XX:MaxPermSize=256m 
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 

# When configured, Gradle will run in incubating parallel mode. 
# This option should only be used with decoupled projects. More details, visit 
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 
# org.gradle.parallel=true 

3)轉到幫助>編輯自定義VM選項,如果擴展名爲.vmoptions的文件打開,則用下面的內容替換文件內容,如果文件不存在,則創建一個,然後替換內容與此: -

# custom Android Studio VM options 

# 
# *DO NOT* modify this file directly. If there is a value that you would like to override, 
# please add it to your user specific configuration file. 
# 
# See http://tools.android.com/tech-docs/configuration 
# 
-Xms256m 
-Xmx750m 
-XX:MaxPermSize=350m 
-XX:ReservedCodeCacheSize=240m 
-XX:+UseConcMarkSweepGC 
-XX:SoftRefLRUPolicyMSPerMB=50 
-da 
-Djna.nosys=true 
-Djna.boot.library.path= 

-Djna.debug_load=true 
-Djna.debug_load.jna=true 
-Dsun.io.useCanonCaches=false 
-Djava.net.preferIPv4Stack=true 
-XX:+HeapDumpOnOutOfMemoryError 
-Didea.paths.selector=AndroidStudio2.1 
-Didea.platform.prefix=AndroidStudio 

您的所有錯誤將得到解決。

祝你好運。

+0

如果您發現此信息有幫助,請選擇此爲正確答案:)。 –

相關問題