I am currently developing an android application using google maps api and I sometimes get a weird crash (in my opinion) for no ovious reason. Here's the crash log :
12-02 16:38:57.071 20796-21137/com.appsolute.ParkYoo E/AndroidRuntime: FATAL EXCEPTION: GLThread 4623 Process: com.appsolute.ParkYoo, PID: 20796 java.lang.NullPointerException: Attempt to get length of null array at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:399) at java.nio.ByteBufferAsShortBuffer.put(ByteBufferAsShortBuffer.java:159) at com.google.maps.api.android.lib6.gmm6.o.c.a.d.d(Unknown Source) at com.google.maps.api.android.lib6.gmm6.o.c.a.d.a(Unknown Source) at com.google.maps.api.android.lib6.gmm6.o.a.a(Unknown Source) at com.google.maps.api.android.lib6.gmm6.o.c.b(Unknown Source) at com.google.maps.api.android.lib6.gmm6.o.c.a(Unknown Source) at com.google.maps.api.android.lib6.gmm6.o.l.a(Unknown Source) at com.google.maps.api.android.lib6.gmm6.o.l.b(Unknown Source) at com.google.maps.api.android.lib6.gmm6.o.cw.k(Unknown Source) at com.google.maps.api.android.lib6.gmm6.o.cw.run(Unknown Source)
As you can see, the crash happens in google api but the code has been obfuscated so I don't have more infos about that except on the 2 first lines :
final void put(short[] src, int srcOffset, int shortCount) { checkIsAccessible(); int byteCount = checkPutBounds(SizeOf.SHORT, src.length, srcOffset, shortCount); // here is the error this.block.pokeShortArray(offset + position, src, srcOffset, shortCount, order.needsSwap); position += byteCount; } @Override public ShortBuffer put(short[] src, int srcOffset, int shortCount) { byteBuffer.limit(limit * SizeOf.SHORT); byteBuffer.position(position * SizeOf.SHORT); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).put(src, srcOffset, shortCount); } else { ((ByteArrayBuffer) byteBuffer).put(src, srcOffset, shortCount); } this.position += shortCount; return this; }
Has anyone already encountered this bug ? What am I doing wrong ? If anybody has an insight concerning this issue, I'll be pleased to discuss it.
Thanks !