Сообщается о большом количестве сбоев в связи с картой Google (в облегченном режиме), отображаемой в держателе представления переработчика.
- Только HockeyApp сообщает об этих сбоях, Firebase Crashlytics - нет.
- Сбои сообщаются сотни раз для относительно небольшого количества пользователей, поэтому, похоже, это влияет на определенный тип пользователей.
- Происходит на различных версиях Android (7.0, 8.0, 8.1, 9) на различных устройствах (Huawei, LG, Samsung и т. Д.).
-
DeadSystemException
всегда сообщается в связи с картами, поэтому я исключил бы, что устройство выключается по какой-то другой причине.
- Проверено на эмуляторе без установленных сервисов Google Play без сбоев; затем на карте отобразится ожидаемое сообщение об ошибке
MyApp won't run without Google Play services, which are not supported by your device.
В зависимости от устройства трассировка стека выглядит немного иначе.
Для Huawei:
java.lang.RuntimeException: android.os.DeadSystemException
at huawei.android.app.HwApiCacheMangerEx.getApplicationInfoAsUser(HwApiCacheMangerEx.java:145)
at android.app.ApplicationPackageManager.getApplicationInfoAsUser(ApplicationPackageManager.java:417)
at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:409)
at pt.a(:com.google.android.gms.dynamite_mapsdynamite@17122079@17.1.22 (100306-245988633):3)
at com.google.maps.api.android.lib6.drd.r.b(:com.google.android.gms.dynamite_mapsdynamite@17122079@17.1.22 (100306-245988633):15)
at com.google.maps.api.android.lib6.impl.fl.a(:com.google.android.gms.dynamite_mapsdynamite@17122079@17.1.22 (100306-245988633):50)
at com.google.maps.api.android.lib6.impl.fk.a(:com.google.android.gms.dynamite_mapsdynamite@17122079@17.1.22 (100306-245988633):4)
at com.google.maps.api.android.lib6.impl.fm.run(:com.google.android.gms.dynamite_mapsdynamite@17122079@17.1.22 (100306-245988633):4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:784)
Caused by: android.os.DeadSystemException
... 11 more
для Samsung:
java.lang.RuntimeException: android.os.DeadSystemException
at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:264)
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:237)
at pt.b(:com.google.android.gms.dynamite_mapsdynamite@17122081@17.1.22 (100400-245988633):4)
at com.google.android.gms.maps.internal.CreatorImpl.a(:com.google.android.gms.dynamite_mapsdynamite@17122081@17.1.22 (100400-245988633):58)
at com.google.android.gms.maps.internal.CreatorImpl.newMapViewDelegate(:com.google.android.gms.dynamite_mapsdynamite@17122081@17.1.22 (100400-245988633):29)
at com.google.android.gms.maps.internal.h.a(:com.google.android.gms.dynamite_mapsdynamite@17122081@17.1.22 (100400-245988633):62)
at hj.onTransact(:com.google.android.gms.dynamite_mapsdynamite@17122081@17.1.22 (100400-245988633):4)
at android.os.Binder.transact(Binder.java:675)
at com.google.android.gms.internal.maps.zza.a(zza.java:7)
at com.google.android.gms.maps.internal.zzf.a(zzf.java:11)
at com.google.android.gms.maps.MapView$zzb.a(MapView.java:31)
at com.google.android.gms.dynamic.DeferredLifecycleHelper.a(DeferredLifecycleHelper.java:44)
at com.google.android.gms.dynamic.DeferredLifecycleHelper.a(DeferredLifecycleHelper.java:5)
at com.google.android.gms.maps.MapView.a(MapView.java:22)
at com.myapp.myapp.viewholder.MyViewHolder.E(MyViewHolder.java:3)
at com.myapp.myapp.viewholder.MyViewHolder.A(MyViewHolder.java:6)
at com.myapp.myapp.viewholder.MyViewHolder.<init>(MyViewHolder.java:159)
at com.myapp.myapp.activities.MyActivity$18.a(MyActivity.java:55)
at com.myapp.myapp.adapter.MyAdapter.a(MyAdapter.java:8)
at android.support.v7.widget.RecyclerView$Adapter.b(RecyclerView.java:5)
at android.support.v7.widget.RecyclerView$Recycler.a(RecyclerView.java:293)
at android.support.v7.widget.RecyclerView$Recycler.a(RecyclerView.java:5)
at android.support.v7.widget.RecyclerView$Recycler.c(RecyclerView.java:1)
at android.support.v7.widget.LinearLayoutManager$LayoutState.a(LinearLayoutManager.java:11)
at android.support.v7.widget.LinearLayoutManager.generateDefaultLayoutParams(LinearLayoutManager.java:0)
onDetachedFromWindow(LinearLayoutManager.java:0)
onInitializeAccessibilityEvent(LinearLayoutManager.java:0)
onRestoreInstanceState(LinearLayoutManager.java:0)
setStackFromEnd(LinearLayoutManager.java:0)
smoothScrollToPosition(LinearLayoutManager.java:0)
onLayoutCompleted(LinearLayoutManager.java:0)
onAnchorReady(LinearLayoutManager.java:0)
updateAnchorInfoForLayout(LinearLayoutManager.java:0)
updateAnchorFromPendingData(LinearLayoutManager.java:0)
fixLayoutEndGap(LinearLayoutManager.java:0)
updateLayoutStateToFillEnd(LinearLayoutManager.java:0)
scrollHorizontallyBy(LinearLayoutManager.java:0)
updateLayoutState(LinearLayoutManager.java:0)
collectPrefetchPositionsForLayoutState(LinearLayoutManager.java:0)
collectInitialPrefetchPositions(LinearLayoutManager.java:0)
collectAdjacentPrefetchPositions(LinearLayoutManager.java:0)
assertNotInLayoutOrScroll(LinearLayoutManager.java:0)
recycleChildren(LinearLayoutManager.java:0)
recycleViewsFromStart(LinearLayoutManager.java:0)
recycleByLayoutState(LinearLayoutManager.java:0)
fill(LinearLayoutManager.java:0)
layoutChunk(LinearLayoutManager.java:0)
findFirstVisibleChildClosestToStart(LinearLayoutManager.java:0)
findReferenceChild(LinearLayoutManager.java:0)
findOneVisibleChild(LinearLayoutManager.java:0)
onFocusSearchFailed(LinearLayoutManager.java:0)
prepareForDrop(LinearLayoutManager.java:0)
at android.support.v7.widget.LinearLayoutManager.a(LinearLayoutManager.java:44)
at android.support.v7.widget.LinearLayoutManager.c(LinearLayoutManager.java:394)
at android.support.v7.widget.RecyclerView.O(RecyclerView.java:38)
at android.support.v7.widget.RecyclerView.q(RecyclerView.java:37)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:5)
at android.view.View.layout(View.java:22407)
at android.view.ViewGroup.layout(ViewGroup.java:6579)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:22407)
at android.view.ViewGroup.layout(ViewGroup.java:6579)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:22407)
at android.view.ViewGroup.layout(ViewGroup.java:6579)
at android.support.design.widget.CoordinatorLayout.d(CoordinatorLayout.java:143)
at android.support.design.widget.CoordinatorLayout.a(CoordinatorLayout.java:32)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:48)
at android.view.View.layout(View.java:22407)
at android.view.ViewGroup.layout(ViewGroup.java:6579)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:22407)
at android.view.ViewGroup.layout(ViewGroup.java:6579)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:22407)
at android.view.ViewGroup.layout(ViewGroup.java:6579)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:22407)
at android.view.ViewGroup.layout(ViewGroup.java:6579)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:22407)
at android.view.ViewGroup.layout(ViewGroup.java:6579)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:1041)
at android.view.View.layout(View.java:22407)
at android.view.ViewGroup.layout(ViewGroup.java:6579)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3357)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2826)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1874)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8491)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7058)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Caused by: android.os.DeadSystemException
... 84 more
Карта реализована так:
Вид держателя (упрощенно):
<com.google.android.gms.maps.MapView
android:id="@+id/map"
android:layout_width="@dimen/_100sdp"
android:layout_height="@dimen/_100sdp"
android:visibility="gone"
map:liteMode="true"
map:mapType="none" />
Держатель вида (упрощенный):
public class MyHolder extends RecyclerView.ViewHolder implements OnMapReadyCallback {
private @NonNull MapView mapView;
private @Nullable Location location;
public MyHolder(@NonNull View itemView) {
super(itemView);
mapView = itemView.findViewById(R.id.map);
mapView.onCreate(null);
mapView.getMapAsync(this);
LocalBroadcastManager.getInstance(App.getInstance().getApplicationContext()).registerReceiver(broadcastReceiver, new IntentFilter(MyFilter));
}
// Called when the view holder is recycled
public void recycle() {
mapView.setVisibility(View.GONE);
releaseMap();
}
// Called when binding the view holder or by the broadcast receiver
public void update(@NonNull Location location) {
this.location = location;
mapView.setVisibility(View.VISIBLE);
setMapLocation();
}
@Override
public void onMapReady(GoogleMap googleMap) {
MapsInitializer.initialize(App.getInstance().getApplicationContext());
map = googleMap;
map.getUiSettings().setMapToolbarEnabled(false);
map.getUiSettings().setAllGesturesEnabled(false);
setMapLocation();
}
private void setMapLocation() {
if (map == null) {
return;
}
if (location == null) {
map.setMapType(GoogleMap.MAP_TYPE_NONE);
return;
}
LatLng mapLocation = new LatLng(location.getLatitude(), location.getLongitude());
map.addMarker(new MarkerOptions().position(mapLocation));
map.moveCamera(CameraUpdateFactory.newLatLngZoom(mapLocation, 14f));
map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
}
private void releaseMap() {
if (map == null) {
return;
}
map.clear();
map.setMapType(GoogleMap.MAP_TYPE_NONE);
}
private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
update();
}
};
}
Что может быть причиной этого?