Obsolete
Status Update
Comments
[Deleted User] <[Deleted User]> #2
Note: in my case the RuntimeException was thrown when tying to create a Canvas from a non-mutable Bitmap.
The dummy throw code-line is only here to make the sample as simple as possible.
The dummy throw code-line is only here to make the sample as simple as possible.
[Deleted User] <[Deleted User]> #3
[Comment deleted]
[Deleted User] <[Deleted User]> #4
Update:
It does actually look like it's muting ANY throwable...
So, any subclass of java.lang.Exception AND java.lang.Error, possibly.
At least with NoSuchMethodError.
If you are using my workaround-sample, make sure to catch java.lang.Error as well...
I'm wondering what would happen with OutOfMemoryError in this case...
Definitely a critical bug.
It does actually look like it's muting ANY throwable...
So, any subclass of java.lang.Exception AND java.lang.Error, possibly.
At least with NoSuchMethodError.
If you are using my workaround-sample, make sure to catch java.lang.Error as well...
I'm wondering what would happen with OutOfMemoryError in this case...
Definitely a critical bug.
an...@google.com <an...@google.com> #5
Thank you for reporting this issue. We are currently only able to investigate issues that satisfy all these criteria:
- You can reproduce the issue on a minimally-modified version of one of our code samples or sample apps, and are able to share that code with us. [1]
- The app has been built against the latest available version of the Maps Android API. [2]
- Your testing device (or the Android emulator) uses the latest available version of Google Play Services. [3]
Please feel free to reopen this issue if you are able to reproduce it while ensuring all the criteria above. Thank you for your understanding.
[1]: Samples are available fromhttps://developers.google.com/maps/documentation/android-api/code-samples
[2]: Release information is available athttps://developers.google.com/maps/documentation/android-api/releases
[3]: Release information is available athttps://developers.google.com/android/guides/releases
- You can reproduce the issue on a minimally-modified version of one of our code samples or sample apps, and are able to share that code with us. [1]
- The app has been built against the latest available version of the Maps Android API. [2]
- Your testing device (or the Android emulator) uses the latest available version of Google Play Services. [3]
Please feel free to reopen this issue if you are able to reproduce it while ensuring all the criteria above. Thank you for your understanding.
[1]: Samples are available from
[2]: Release information is available at
[3]: Release information is available at
Description
When implementing TileProvider.getTile(int x, int y, int zoom), any RuntimeException your code might be firing will be muted/silenced but the (gms) callers.
How I came by the bug:
This results in code being very hard to debug.
Some tiles wouldn't show up on my map and I spent most of the day looking into my code that fetches and saves my cached tiles before I found out that there was a RuntimeException-derived exception firing in my getTile code. I never seen if because the parent callers ignore the exception and don't print any error nor warning message.
What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.
1. Add a TileOverlay to your GoogleMap object with the following implementation
public class MyTileProvider implements TileProvider {
public MyTileProvider() {
}
public Tile getTile(int x, int y, int zoom) {
if (true) {
throw new RuntimeException("ashjdasd");
}
return NO_TILE;
}
}
2. The "NO_TILE" tile (or any other tile) isn't returned because the RuntimeException avoided it to be returned, AND The application does not crash AND The application does not print any error nor warning message.
Workaround:
For developers willing to save debugging time, be sure to wrap your code in getTile with a try-catch block, like:
public Tile getTile(int x, int y, int zoom) {
try {
if (true) {
throw new RuntimeException("ashjdasd");
}
return NO_TILE;
} catch (RuntimeException e) {
Log.d("MyTag/MyTileProvider", "getTile x=" + x + ", y=" + y + ", zoomLevel=" + zoom + " raised an exception", e);
throw e;
}
}
*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************