amirpiri / android-maps-extensions

Automatically exported from code.google.com/p/android-maps-extensions
0 stars 0 forks source link

Crashes LazyMarker.java #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem? Please provide sscce (short, self
contained, correct example) when possible.
Use LazyMarker.java's LatLng getPosition() method without try/catch statements.

What is the expected output? What do you see instead?
Exceptions should be gracefully handled.  Instead the app crashes!!!

Original issue reported on code.google.com by eazyigz on 3 Sep 2013 at 1:15

Attachments:

GoogleCodeExporter commented 8 years ago
Issue 31 has been merged into this issue.

Original comment by maciek.g...@gmail.com on 3 Sep 2013 at 6:23

GoogleCodeExporter commented 8 years ago
What is the exception?

What is the code that uses LazyMarker?

Original comment by maciek.g...@gmail.com on 3 Sep 2013 at 6:25

GoogleCodeExporter commented 8 years ago
~"What is the exception?"
I am not able to reproduce it now.  But at least I don't have to worry about my 
app crashing...

~"What is the code that uses LazyMarker?"
There is a whole chain of calls within android-maps-extensions.  That 
particular getPosition() method is not called by my external project.  I would 
have to dig through many calls to get to the bottom of it.  This is irrelevant, 
exception checking is a must here.

Original comment by eazyigz on 3 Sep 2013 at 7:33

GoogleCodeExporter commented 8 years ago
If that's from inside the lib and you are not creating LazyMarkers yourself, 
then I suspect this might be after you call Marker.remove(), which makes 
underlaying LazyMarker unusable in any way. After that, when 
Marker.getPosition() is called for any reason, it throws NPE. Stacktrace would 
help seeing if that's a memory leak in the lib.
Also, which version of the library are you using?

Original comment by maciek.g...@gmail.com on 3 Sep 2013 at 7:44

GoogleCodeExporter commented 8 years ago
Hello,
here is the stacktrace:

java.lang.NullPointerException
        at maps.ag.bn.a(Unknown Source)
        at maps.ag.bn.a(Unknown Source)
        at maps.ag.an.a(Unknown Source)
        at bkw.onTransact(SourceFile:167)
        at android.os.Binder.transact(Binder.java:310)
        at com.google.android.gms.maps.internal.IGoogleMapDelegate$a$a.addMarker(Unknown Source)
        at com.google.android.gms.maps.GoogleMap.addMarker(Unknown Source)
        at pl.mg6.android.maps.extensions.lazy.LazyMarker.createMarker(LazyMarker.java:198)
        at pl.mg6.android.maps.extensions.lazy.LazyMarker.createMarker(LazyMarker.java:190)
        at pl.mg6.android.maps.extensions.lazy.LazyMarker.setVisible(LazyMarker.java:178)
        at pl.mg6.android.maps.extensions.impl.DelegatingMarker.changeVisible(DelegatingMarker.java:230)
        at pl.mg6.android.maps.extensions.impl.ClusterMarker.refresh(ClusterMarker.java:60)
        at pl.mg6.android.maps.extensions.impl.ClusterRefresher.refreshAll(ClusterRefresher.java:52)
        at pl.mg6.android.maps.extensions.impl.ClusterRefresher$1.handleMessage(ClusterRefresher.java:31)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:5293)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
        at dalvik.system.NativeStart.main(Native Method)

I am using the latest version of your library (from Google Drive).

Original comment by eazyigz on 6 Sep 2013 at 4:10

GoogleCodeExporter commented 8 years ago
I know this stacktrace isn't pointing to getPosition(), but it is a similar 
deal.  Just needs good exception handling.

Original comment by eazyigz on 6 Sep 2013 at 4:42

GoogleCodeExporter commented 8 years ago
The question here is why GoogleMap.addMarker throws an exception.

I guess this can be for many reasons.

Check out these links:
http://stackoverflow.com/a/18651429/2183804
http://stackoverflow.com/a/17464628/2183804
http://stackoverflow.com/questions/17138998/layerlist-as-icon-on-marker-in-googl
e-maps-v2
https://groups.google.com/forum/#!msg/android-platform/ZFNrGcYa7h4/y4Z5U3RutCYJ

Make sure your icon is a PNG file and also you have set position in 
MarkerOptions.

Original comment by maciek.g...@gmail.com on 6 Sep 2013 at 6:51

GoogleCodeExporter commented 8 years ago

Original comment by maciek.g...@gmail.com on 23 Feb 2014 at 12:07