6

I am having this error .

Error:Execution failed for task ':myApp:createDebugMainDexClassList'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: java -Xmx1024M -cp \android-sdk\build-tools\19.1.0\lib\dx.jar com.android.multidex.ClassReferenceListBuilder myApp\build\intermediates\multi-dex\debug\componentClasses.jar myApp\build\intermediates\multi-dex\debug\allclasses.jar

Error Code: 1 Output: Error: Could not find or load main class com.android.multidex.ClassReferenceListBuilder

I am trying to use the multidex library because my application went over the 65000 method because i am using external libraries as Link describes ,I have added the lines in mainfest and build.gradle file,any tips would be appreciated.Thanks

EDIT after few launches I got this error.

Error:Execution failed for task ':myApp:dexDebug'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: \android-sdk\build-tools\21.1.0\dx.bat --dex --no-optimize --multi-dex --main-dex-list myApp\build\intermediates\multi-dex\debug\maindexlist.txt --output myApp\build\intermediates\dex\debug --input-list=myApp\build\intermediates\tmp\dex\debug\inputList.txt ,,Error Code:3.

Output: UNEXPECTED TOP-LEVEL ERROR: java.lang.OutOfMemoryError: Java heap space

I tried to increase the size of Xms1024m -Xmx1024m which is in file 'studio64.exe.vmoptions' but it still does not help ,I also tried in Settings>Compiler>VM Options Xms1024m -Xmx1024m

1
  • I found solution for second part in LINK Commented Jan 13, 2015 at 14:31

1 Answer 1

12

According to the multidex docs at https://developer.android.com/tools/building/multidex.html you need to be running build tools 21.1.0 or higher to use multidex. By your error message it looks like you're using 19.1.0. Try upgrading.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks so much,I did not see that version it works now.
,I got another problem after awhile ,can you please check the update in question? if you need more information please let me know,Thanks.
If only the error message were obvious at all!!! Thank you for your answer.
I am havin the same issue in different case eg. github.com/devoxx/MyDevoxxGluon/issues/… Can't find the solution!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.