0

I've being working on this project for over a week. Everything seems to work perfectly. But for the past three days, I don't know exactly what went wrong. This is my gradle console.

Executing tasks: [:app:assembleDebug]

Configuration on demand is an incubating feature.
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72103Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig 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:compileDebugJava UP-TO-DATE
:app:preDexDebug
 Error: Could not create the Java Virtual Machine.
 Error: A fatal exception has occurred. Program will exit.
 Error: Could not create the Java Virtual Machine.
 Error: Could not create the Java Virtual Machine.
 Error: A fatal exception has occurred. Program will exit.
 Error: A fatal exception has occurred. Program will exit.

  FAILED

 FAILURE: Build failed with an exception.

* What went wrong:
 Execution failed for task ':app:preDexDebug'.
 > com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\Ameni\android-sdks\sdk\build-tools\21.1.2\dx.bat --dex --output D:\Ameni\Android\MoveMore\app\build\intermediates\pre-dexed\debug\jfuzzylogic_2.0.9-4b966e0bdd93414a6ab36ffebfbec8ef2e15deb6.jar D:\Ameni\Android\MoveMore\app\src\main\res\raw\jfuzzylogic_2.0.9.jar
Error Code:
    1
Output:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 27.674 secs

Then this in the run...

Waiting for device.
Target device: genymotion-custom_phone___4_4_4___api_19___768x1280-192.168.110.101:5555
Uploading file
local path: D:\Ameni\Android\MoveMore\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.more.move.movemore
Local path doesn't exist.

And I checked for the apk file... I didn't find them...

Please help me finding the issue...

  • Check this question, see if it is any help: http://stackoverflow.com/q/27262914/269300. – Patrick McLaren Mar 21 '15 at 23:35
  • 1
    No that didn't help :( – Améni Bouattour Mar 21 '15 at 23:44
  • AssembleDebug should not try and create an AVD: `Could not create the Java Virtual Machine.` – Jared Burrows Mar 22 '15 at 00:13
  • I just create a new project and this is what I get... :app:preDexDebug AGPBI: {"kind":"SIMPLE","text":"Error: Could not create the Java Virtual Machine.","position":{},"original":"Error: Could not create the Java Virtual Machine."} AGPBI: {"kind":"SIMPLE","text":"Error: A fatal exception has occurred. Program will exit.","position":{},"original":"Error: A fatal exception has occurred. Program will exit."} – Améni Bouattour Mar 22 '15 at 00:27

2 Answers2

0

I find out the problem: it was due to the latest update of java... Apparently gradle doesn't work well with this particular version of java.. So I uninstall java 8, re-install java 7... Clean project then rebuild project.. Invalidate caches/restart.. and everything seems to work just fine.

0

I am having this exact problem, cant believe this hasn't been answered yet, its so frustrating. Android Studios is a nightmare!

edit

Here is a youtube video link solution, be aware, he uses some colourful language in it. I haven't actually followed the video to the end, but it looks like the same issue. I didn't watch the video because for some bizarre reason, the bug fixed itself haha, fun and games ay!!

laffan
  • 319
  • 3
  • 8