0

Error like this Information:Gradle tasks [:app:assembleDebug] :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE :app:prepareComAndroidSupportDesign2311Library UP-TO-DATE :app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE :app:prepareComFacebookAndroidFacebookAndroidSdk420Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServices840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAds840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAuth840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesCast840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesDrive840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesFitness840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGames840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesLocation840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMaps840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesNearby840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesVision840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWallet840Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWearable840Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources UP-TO-DATE :app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE :app:compileDebugJavaWithJavac Note: C:\Users\rockstar\Desktop\AstroMaze\app\src\main\java\com\org\astromaze\MainActivityUsers.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Incremental compilation of 6 classes completed in 2.053 secs. :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources :app:prePackageMarkerForDebug :app:transformClassesWithDexForDebug To run dex in process, the Gradle daemon needs a larger heap. It currently has approximately 910 MB. For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB. To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties. For more information see https://docs.gradle.org/current/userguide/build_environment.html 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_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

Anil Ranga
  • 337
  • 1
  • 3
  • 6

1 Answers1

0

Basically Your errors are :-

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

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

Solutions to these errors are as follows :-

1) add multiDexEnabled true line in your build.gradle(Module:app) inside defaultConfig

2) Replace the whole content of gradle.properties file with below :-

# 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) Go to Help > Edit Custom VM Options , if the file with extension .vmoptions opens then replace content of the file with the below content , if the file is not there then create one and then replace the content with this :-

# 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

All your errors will be resolved .

Good Luck .