我刚开始进入android编程,我遇到了一个问题,似乎只有API版本14-15(16-19构建得很好)。代码只是Netbeans生成的通用代码。我已经尝试删除并重新下载14和15个软件包,但这似乎不起作用。
这是输出:
Android SDK Tools Revision 22.3.0
Installed at C:\Users\DisturbedTK\AppData\Local\Android\android-sdk
Project Name: AndroidApplication2
Project Type: Application
Using latest Build Tools: 19.0.0
Resolving Build Target for AndroidApplication2...
Project Target: Android 4.0.3
API level: 15
WARNING: No minSdkVersion value set. Application will install on all Android versions.
----------
Creating output directories if needed...
Created dir: C:\Users\DisturbedTK\Documents\NetBeansProjects\AndroidApplication2\bin\res
Created dir: C:\Users\DisturbedTK\Documents\NetBeansProjects\AndroidApplication2\bin\rsObj
Created dir: C:\Users\DisturbedTK\Documents\NetBeansProjects\AndroidApplication2\bin\rsLibs
Created dir: C:\Users\DisturbedTK\Documents\NetBeansProjects\AndroidApplication2\bin\classes
Created dir: C:\Users\DisturbedTK\Documents\NetBeansProjects\AndroidApplication2\bin\dexedLibs
----------
Resolving Dependencies for AndroidApplication2...
Library dependencies:
No Libraries
------------------
API<=15: Adding annotations.jar to the classpath.
----------
Building Libraries with 'debug'...
No sub-builds to iterate on
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
Handling aidl files...
No AIDL files to compile.
----------
Handling RenderScript files...
----------
Handling Resources...
Generating resource IDs...
----------
Handling BuildConfig class...
Generating BuildConfig class.
Compiling 3 source files to C:\Users\DisturbedTK\Documents\NetBeansProjects\AndroidApplication2\bin\classes
input: C:\Users\DisturbedTK\Documents\NetBeansProjects\AndroidApplication2\bin\classes
input: C:\Users\DisturbedTK\AppData\Local\Android\android-sdk\tools\support\annotations.jar
Pre-Dexing C:\Users\DisturbedTK\AppData\Local\Android\android-sdk\tools\support\annotations.jar -> annotations-1e22ca79dc71e5118b983b5b66a444ee.jar
Converting compiled files and external libraries into C:\Users\DisturbedTK\Documents\NetBeansProjects\AndroidApplication2\bin\classes.dex...
UNEXPECTED TOP-LEVEL EXCEPTION:
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:818)
at com.android.dex.Dex$Section.writeTypeList(Dex.java:870)
at com.android.dx.merge.DexMerger$3.write(DexMerger.java:437)
at com.android.dx.merge.DexMerger$3.write(DexMerger.java:423)
at com.android.dx.merge.DexMerger$IdMerger.mergeUnsorted(DexMerger.java:317)
at com.android.dx.merge.DexMerger.mergeTypeLists(DexMerger.java:423)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:163)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:187)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
C:\Users\DisturbedTK\AppData\Local\Android\android-sdk\tools\ant\build.xml:892: The following error occurred while executing this line:
C:\Users\DisturbedTK\AppData\Local\Android\android-sdk\tools\ant\build.xml:894: The following error occurred while executing this line:
C:\Users\DisturbedTK\AppData\Local\Android\android-sdk\tools\ant\build.xml:906: The following error occurred while executing this line:
C:\Users\DisturbedTK\AppData\Local\Android\android-sdk\tools\ant\build.xml:284: null returned: 2
BUILD FAILED (total time: 2 seconds)