Bro*_*onx 5 android google-maps google-play-services
我对GoogleMaps有这个奇怪的问题.
当我处于调试模式时,一切正常,但是当我处于发布模式时,onMapReady回调从未被调用,地图显示"Google Play服务正在更新"消息.
另一个奇怪的事情是,如果我在应用程序中运行一个活动,就可以使用地图,即使在其他活动中也是如此.
这是片段中的代码
@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;
}
Run Code Online (Sandbox Code Playgroud)
将我所有的 google-play 依赖项降级到 10.0.1 对我有用。见下图:
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'
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
927 次 |
最近记录: |