0

My question is basically the same as this question from 4 years ago, but the only answer to the question did not work. So I am asking this again.

My configuration is the followings.

implementation 'com.google.android.gms:play-services-maps:11.8.0'
compile 'com.google.maps.android:android-maps-utils:0.5'
targetSdkVersion 27
compileSdkVersion 27
buildToolsVersion "27.0.3"

The main activity has tabs which of which is a fragment. One of the fragments contain Google Maps, which itself is a fragment.

    <fragment
        android:id="@+id/mapView"
        android:name="com.google.android.gms.maps.SupportMapFragment"

It works fine, but when I see the log with "No Filters" there are strange red logs flooding.

system_process E/LocSvc_eng_nmea: I/<=== nmea_cb line 62 [some hex value]
system_process E/LocSvc_eng_nmea: I/<=== nmea_cb line 62 [some hex value]

I have tried the answer in the question aforementioned, and changed the 'fragment' to a 'FrameLayout' and replaced it with SupportMapView at runtime, but the logs did not disappear.

    var mapFragment = SupportMapFragment.newInstance();
    this.childFragmentManager.beginTransaction()
            .replace(R.id.mapView, mapFragment)
            .commit();

How to prevent the error logs?

PS: When I created a sample application and added a support map fragment directly to the main activity, the error messages did not happen. So I think it has something to do with fragments.

PS2: It may not be related to fragments, because I changed the sample app and placed the map fragment inside another fragment, but the logs did not happen. I have tried some things but failed to reproduce the problem in the sample app.

PS3: Removing isMyLocationEnabled = true; solved the problem, but I need this feature.

Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135
  • Do the logs still show if you filter logcat messages to just contain your apps? The logs look like they are from a system component, so maybe you don't have control over it. – Xavier Rubio Jansana Dec 29 '17 at 12:05
  • No, if I choose "Show only selected application" the messages are not shown. But when I created a sample application and added the support map fragment directly to the main activity, the error messages did not happen. So I think it has something to do with fragments. – Damn Vegetables Dec 29 '17 at 12:09
  • NMEA is most likely related to the protocol used to communicate with GPS chips: https://en.wikipedia.org/wiki/NMEA_0183 That's why I suspect is related to system. Probably if you use a map without Location permissions and the Location related functionalities (e.g. disabling the "My Location" blue dot) the message will disappear. Then, of course, you may need this functionality and the tip may be useless, but at least you may find that this is the cause. – Xavier Rubio Jansana Dec 29 '17 at 12:15
  • Oh yeah. I think I had tried disabling isMyLocationEnabled, but it did not solve it but I probably did something wrong (or saw an old log). Now I have tried again, removing `isMyLocationEnabled = true` did solve the problem. But, since I need that feature, should I ignore the error messages? As you have said, the error messages are coming from the Google Map library, not from my app. – Damn Vegetables Dec 29 '17 at 13:52
  • Yes, I think is the more reasonable thing to do. So, I will put the discussion as an answer. – Xavier Rubio Jansana Dec 29 '17 at 14:09

1 Answers1

1

The logs look like they are from a system component, so you don't have control over it. NMEA is most likely related to the protocol used to communicate with GPS chips. See en.wikipedia.org/wiki/NMEA_0183

Solution: If you use a map without Location permissions and the Location related functionalities (e.g. disabling the "My Location" blue dot) the message will disappear. Then, of course, you may need this functionality and the tip may be useless, but this is the cause.

Practical solution: So, if I choose "Show only selected application" the messages will be not shown. It is safe to ignore the error.

Xavier Rubio Jansana
  • 6,388
  • 1
  • 27
  • 50