Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.에러 해결방법
If you have recently added any Android library project or upgraded to a newer version of Android SDK build tools and you have got an unable to execute error then this post is for you. You might have got this error even if you are trying to import an existing Android project or if you are working with android librrary. For example google play services.
<textarea style="Z-INDEX: 0; BOX-SIZING: border-box; BORDER-BOTTOM: 0px; POSITION: absolute; BORDER-LEFT: 0px; PADDING-BOTTOM: 0px; LINE-HEIGHT: 15px !important; BACKGROUND-COLOR: rgb(255,255,255); MARGIN: 0px; PADDING-LEFT: 5px; WIDTH: 663px; PADDING-RIGHT: 5px; FONT-FAMILY: Monaco, MonacoRegular, 'Courier New', monospace !important; WORD-WRAP: normal; WHITE-SPACE: pre; HEIGHT: 30px; COLOR: rgb(0,0,0); FONT-SIZE: 12px !important; VERTICAL-ALIGN: top; OVERFLOW: hidden; BORDER-TOP: 0px; BORDER-RIGHT: 0px; PADDING-TOP: 0px; opacity: 0; box-shadow: none; -webkit-box-shadow: none; resize: none; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-top-right-radius: 0px; border-top-left-radius: 0px; tab-size: 4" class="crayon-plain print-no" wrap="off" readonly="readOnly" data-settings="dblclick"></textarea>
|
Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
SearchViewDemo] Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. |
There are two approaches to solve the conversion to Dalvik format failed error.
- Downgrading to Android SDK build tools 18.1.1
- Adding the support library.
Now its up to you, how you want to fix the project.
Downloading Android SDK build tools 18.1.1
In eclipse, go to
<textarea style="Z-INDEX: 0; BOX-SIZING: border-box; BORDER-BOTTOM: 0px; POSITION: absolute; BORDER-LEFT: 0px; PADDING-BOTTOM: 0px; LINE-HEIGHT: 15px !important; BACKGROUND-COLOR: rgb(255,255,255); MARGIN: 0px; PADDING-LEFT: 5px; WIDTH: 663px; PADDING-RIGHT: 5px; FONT-FAMILY: Monaco, MonacoRegular, 'Courier New', monospace !important; WORD-WRAP: normal; WHITE-SPACE: pre; HEIGHT: 15px; COLOR: rgb(0,0,0); FONT-SIZE: 12px !important; VERTICAL-ALIGN: top; OVERFLOW: hidden; BORDER-TOP: 0px; BORDER-RIGHT: 0px; PADDING-TOP: 0px; opacity: 0; box-shadow: none; -webkit-box-shadow: none; resize: none; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-top-right-radius: 0px; border-top-left-radius: 0px; tab-size: 4" class="crayon-plain print-no" wrap="off" readonly="readOnly" data-settings="dblclick"></textarea>
|
Windows -> Android SDK manager |
Now uninstall Android SDK build tools 19
Now Install Android SDK build tools 18.1.1
After successful installation, restart eclipse and now error will be fixed.
If you want to solve the “Conversion to Dalvik format error” without uninstalling android SDK tools, then you need to add(update) the support library.
Adding the support library.
Right click on your project and go to “libs” folder. Delete the android-support-v4 file from the project.
Now add support library again by following these steps.
<textarea style="Z-INDEX: 0; BOX-SIZING: border-box; BORDER-BOTTOM: 0px; POSITION: absolute; BORDER-LEFT: 0px; PADDING-BOTTOM: 0px; LINE-HEIGHT: 15px !important; BACKGROUND-COLOR: rgb(255,255,255); MARGIN: 0px; PADDING-LEFT: 5px; WIDTH: 663px; PADDING-RIGHT: 5px; FONT-FAMILY: Monaco, MonacoRegular, 'Courier New', monospace !important; WORD-WRAP: normal; WHITE-SPACE: pre; HEIGHT: 15px; COLOR: rgb(0,0,0); FONT-SIZE: 12px !important; VERTICAL-ALIGN: top; OVERFLOW: hidden; BORDER-TOP: 0px; BORDER-RIGHT: 0px; PADDING-TOP: 0px; opacity: 0; box-shadow: none; -webkit-box-shadow: none; resize: none; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-top-right-radius: 0px; border-top-left-radius: 0px; tab-size: 4" class="crayon-plain print-no" wrap="off" readonly="readOnly" data-settings="dblclick"></textarea>
|
Right click on project -> Android tools -> Add support library |
Updated library would be downloaded.
Now clean your project.
If error still occurs then delete all projects from project explorer and workspace. And create a new project and delete the support library and add it again by following the above steps. Now conversion to Dalvik will not fail.
If you still have any error then feel free to share. If you have any suggestions, please feel free to tell me.