1. Download our Official Android App: Forums for Android!

Apps java.nio.BufferOverflowException

Discussion in 'Android Development' started by Z223I, Dec 27, 2013.

  1. Z223I

    Z223I Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    8
    Joined:
    Dec 27, 2013

    Dec 27, 2013
    8
    1
    6
    I am new to Android and Java. I have been writing C++ since before a commercial compiler was available.

    I have downloaded the latest Android ADT for Windows. I was going through a series of tutorials and everything was going fine.

    Something must have changed because ALL of the tutorial apps, even the ones that had compiled before, quit compiling and generated a "Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace." error.

    I was able to find the Eclipse/Error log. It reads:
    Exception Stack Trace:
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Unknown Source)
    at java.nio.HeapByteBuffer.putShort(Unknown Source)
    at com.android.dex.Dex$Section.writeShort(Dex.java:81 8)
    at com.android.dex.Dex$Section.writeTypeList(Dex.java :870)
    at com.android.dx.merge.DexMerger$3.write(DexMerger.j ava:437)
    at com.android.dx.merge.DexMerger$3.write(DexMerger.j ava:423)
    at com.android.dx.merge.DexMerger$IdMerger.mergeUnsor ted(DexMerger.java:317)
    at com.android.dx.merge.DexMerger.mergeTypeLists(DexM erger.java:423)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerge r.java:163)
    at com.android.dx.merge.DexMerger.merge(DexMerger.jav a:187)
    at com.android.dx.command.dexer.Main.mergeLibraryDexB uffers(Main.java:439)
    at com.android.dx.command.dexer.Main.runMonoDex(Main. java:287)
    at com.android.dx.command.dexer.Main.run(Main.java:23 0)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.android.ide.eclipse.adt.internal.build.DexWrap per.run(DexWrapper.java:187)
    at com.android.ide.eclipse.adt.internal.build.BuildHe lper.executeDx(BuildHelper.java:813)
    at com.android.ide.eclipse.adt.internal.build.builder s.PostCompilerBuilder.build(PostCompilerBuilder.ja va:597)
    at org.eclipse.core.internal.events.BuildManager$2.ru n(BuildManager.java:726)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner .java:42)
    at org.eclipse.core.internal.events.BuildManager.basi cBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basi cBuild(BuildManager.java:321)
    at org.eclipse.core.internal.events.BuildManager.buil d(BuildManager.java:396)
    at org.eclipse.core.internal.resources.Project$1.run( Project.java:618)
    at org.eclipse.core.internal.resources.Workspace.run( Workspace.java:2344)
    at org.eclipse.core.internal.resources.Project.intern alBuild(Project.java:597)
    at org.eclipse.core.internal.resources.Project.build( Project.java:124)
    at com.android.ide.eclipse.adt.internal.project.Proje ctHelper.doFullIncrementalDebugBuild(ProjectHelper .java:1116)
    at com.android.ide.eclipse.adt.internal.launch.Launch ConfigDelegate.launch(LaunchConfigDelegate.java:14 7)
    at org.eclipse.debug.internal.core.LaunchConfiguratio n.launch(LaunchConfiguration.java:855)
    at org.eclipse.debug.internal.core.LaunchConfiguratio n.launch(LaunchConfiguration.java:704)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildA ndLaunch(DebugUIPlugin.java:1047)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run( DebugUIPlugin.java:1251)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.j ava:53)

    Session Data:
    eclipse.buildId=v22.3.0-887826
    java.version=1.7.0_45
    java.vendor=Oracle Corporation
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
    Framework arguments: -product com.android.ide.eclipse.adt.package.product
    Command-line arguments: -os win32 -ws win32 -arch x86_64 -product com.android.ide.eclipse.adt.package.product

    Question 1: Is the problem at the top or the bottom of that stack dump?

    Question 2: Any suggestions?

    By the way, if I create a new project, it compiles ok.

    Thanks!
     

    Advertisement

  2. Rukbat

    Rukbat Extreme Android User
    Rank:
    None
    Points:
    943
    Posts:
    10,391
    Joined:
    Jan 16, 2012

    Jan 16, 2012
    10,391
    2,897
    943
    Male
    Being retired and writing Tasker tasks.
    Fayetteville, NC, USA
    1) Probably near the top, but you know how it is with any C-ish language - an error can hang around for a while before blowing up.

    2) Uninstall it all. Reinstall it all. Unless you prefer the purely intellectual challenge of finding out which line of code walked all over some variable, which is probably what happened (you know, like storing a long in an int variable, stepping all over the following pointer, which etc.) Interesting, but unless it kept happening (after reinstalling everything) I wouldn't want to spend more than a cursory glance to see why.
     
  3. Z223I

    Z223I Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    8
    Joined:
    Dec 27, 2013

    Dec 27, 2013
    8
    1
    6
    Thanks. I will give that a try.
     
  4. Z223I

    Z223I Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    8
    Joined:
    Dec 27, 2013

    Dec 27, 2013
    8
    1
    6
    Been there. Done that. Same problem.

    Oh well.
     

Share This Page

Loading...