但是有附 ant1.7
安裝 distribution default ant :
apt-get install ant
之後 build:
產生 make file:
$ android update project --path .build:
$ ant release
[dx] [dx] UNEXPECTED TOP-LEVEL EXCEPTION: [dx] java.nio.BufferOverflowException [dx] at java.nio.Buffer.nextPutIndex(Buffer.java:499) [dx] at java.nio.HeapByteBuffer.putShort(HeapByteBuffer.java:296) [dx] at com.android.dex.Dex$Section.writeShort(Dex.java:818) [dx] at com.android.dex.Dex$Section.writeTypeList(Dex.java:870) [dx] at com.android.dx.merge.DexMerger$3.write(DexMerger.java:437) [dx] at com.android.dx.merge.DexMerger$3.write(DexMerger.java:423) [dx] at com.android.dx.merge.DexMerger$IdMerger.mergeUnsorted(DexMerger.java:317) [dx] at com.android.dx.merge.DexMerger.mergeTypeLists(DexMerger.java:423) [dx] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:163) [dx] at com.android.dx.merge.DexMerger.merge(DexMerger.java:187) [dx] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439) [dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287) [dx] at com.android.dx.command.dexer.Main.run(Main.java:230) [dx] at com.android.dx.command.dexer.Main.main(Main.java:199) [dx] at com.android.dx.command.Main.main(Main.java:103)google 一下:
- https://code.google.com/p/android/issues/detail?id=61710
- http://stackoverflow.com/questions/19727915/android-dex-gives-a-bufferoverflowexception
所以 build 2.3 就會 fail 了。
所以解決方法就是安裝 Android SDK Build-tools 18.1.1 :
- 啟動 android sdk manager (console: $ android)
- Tools -- Android SDK Build-tools , check 18.1.1
再指定使用 18.1.1 來 build:
在 project.properties 加一行: sdk.buildtools=18.1.1
其他:
沒有留言:
張貼留言