The Google Play Services message is updated "in SupportMapFragment when in release mode

I have this weird issue with GoogleMaps.

When I'm in debug mode, everything works fine, but when I'm in release mode, the onMapReady callback is never called, and a message about updating the Google Play services is displayed on the map.

Another strange thing: if I start activity when I launch the application using the map, it works even in other actions.

This is my code in the snippet

@Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { FrameLayout fr = (FrameLayout) inflater.inflate(R.layout.my_fragment, null); //views code SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map); mapFragment.getMapAsync(this); return fr; } 
+5
source share
2 answers

For me, it worked with decreasing all my dependencies on Google Play to 10.0.1. See below:

 compile 'com.google.android.gms:play-services:10.0.1' compile 'com.google.android.gms:play-services-places:10.0.1' compile 'com.google.android.gms:play-services-analytics:10.0.1' compile 'com.google.firebase:firebase-crash:10.0.1' 
0
source

Try adding this line to the proguard rule file

 -keep class com.google. ** {*; } 

Hope this helps

0
source

Source: https://habr.com/ru/post/1264691/


All Articles