Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Application Crashing When Going Back From MapView - Android 4.1.2 #10030

Closed

Description

@Danny-James

I'm currently developing on a Company PDA, Motorola TC55 running Android 4.1.2 - I have the MapView Loading in a new Activity NavigationMap.java.

When opening the acitivty everything seems to be fine and working, can Zoom, Move etc, However when i press the back button, you would expect the activity to close, what is actually happening is it's closing the application.

I have tested the same app on two other devices, Samsung Galaxy S6 Edge Android 7 & Google Pixel Android 8.0 and this problem does not occur, please see below LOGCAT extract of Android 4.1.2 Device.

Information:
ActivityMain - Application's Main Page
ActivityRouteView - Detailed Information of The Route (Job No, Address, Contact Details) - This activity contains a button "Start Route" - This then starts the intent for NavigationMap.

09-20 09:18:34.963 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:34.993 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:35.003 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:35.033 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:35.063 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:35.083 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:35.113 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:35.143 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:35.223 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:35.413 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:35.453 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-20 09:18:37.345 355-355/uk.co.ainscough.routeinfo D/ainscough.routeinfo: Activity Restarted
09-20 09:18:38.136 355-355/uk.co.ainscough.routeinfo A/libc: Fatal signal 11 (SIGSEGV) at 0x00000230 (code=1), thread 355 (cough.routeinfo)
09-20 09:18:38.296 170-170/? I/DEBUG: pid: 355, tid: 355, name: cough.routeinfo  >>> uk.co.ainscough.routeinfo <<<
09-20 09:18:38.507 170-170/? I/DEBUG:     #09  pc 00050379  /data/app-lib/uk.co.ainscough.routeinfo-1/libmapbox-gl.so
09-20 09:18:38.927 631-2070/? I/WindowState: WIN DEATH: Window{42791600 uk.co.ainscough.routeinfo/uk.co.ainscough.routeinfo.NavigationMap paused=false}
09-20 09:18:38.927 631-755/? W/InputDispatcher: channel '42924de8 uk.co.ainscough.routeinfo/uk.co.ainscough.routeinfo.ActivityMain (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
09-20 09:18:38.927 631-755/? E/InputDispatcher: channel '42924de8 uk.co.ainscough.routeinfo/uk.co.ainscough.routeinfo.ActivityMain (server)' ~ Channel is unrecoverably broken and will be disposed!
09-20 09:18:38.927 631-755/? W/InputDispatcher: channel '431c8eb0 uk.co.ainscough.routeinfo/uk.co.ainscough.routeinfo.ActivityRouteView (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
09-20 09:18:38.927 631-755/? E/InputDispatcher: channel '431c8eb0 uk.co.ainscough.routeinfo/uk.co.ainscough.routeinfo.ActivityRouteView (server)' ~ Channel is unrecoverably broken and will be disposed!
09-20 09:18:38.927 631-2067/? W/InputDispatcher: Attempted to unregister already unregistered input channel '42924de8 uk.co.ainscough.routeinfo/uk.co.ainscough.routeinfo.ActivityMain (server)'
09-20 09:18:38.927 631-2070/? W/WindowManager: Force-removing child win Window{42812a58 SurfaceView paused=false} from container Window{42791600 uk.co.ainscough.routeinfo/uk.co.ainscough.routeinfo.NavigationMap paused=false}
09-20 09:18:38.927 631-2063/? I/ActivityManager: Process uk.co.ainscough.routeinfo (pid 355) has died.
09-20 09:18:38.927 631-2063/? W/ActivityManager: Scheduling restart of crashed service uk.co.ainscough.routeinfo/com.mapbox.services.android.telemetry.service.TelemetryService in 5000ms
09-20 09:18:38.927 631-2063/? W/ActivityManager: Scheduling restart of crashed service uk.co.ainscough.routeinfo/.ContractsService in 5000ms
09-20 09:18:38.927 631-2063/? W/ActivityManager: Scheduling restart of crashed service uk.co.ainscough.routeinfo/.FeedbackService in 14999ms
09-20 09:18:38.927 631-2067/? I/WindowState: WIN DEATH: Window{42924de8 uk.co.ainscough.routeinfo/uk.co.ainscough.routeinfo.ActivityMain paused=false}
09-20 09:18:38.977 631-639/? W/InputDispatcher: Attempted to unregister already unregistered input channel '431c8eb0 uk.co.ainscough.routeinfo/uk.co.ainscough.routeinfo.ActivityRouteView (server)'
09-20 09:18:38.977 631-639/? I/WindowState: WIN DEATH: Window{431c8eb0 uk.co.ainscough.routeinfo/uk.co.ainscough.routeinfo.ActivityRouteView paused=false}
09-20 09:18:38.987 631-2063/? W/ActivityManager: Force removing ActivityRecord{42a19fd8 u0 uk.co.ainscough.routeinfo/.ActivityRouteView}: app died, no saved state
09-20 09:18:38.997 631-2063/? I/ActivityManager: Start proc uk.co.ainscough.routeinfo for activity uk.co.ainscough.routeinfo/.ActivityMain: pid=5655 uid=10091 gids={50091, 3003, 1015, 1028}

On the Android 4.1.2 Device when ever the NavigationMap Activity Loads i get a hell of a lot of these messages in the logcat, when i move around on the map i also get tones and tones of them showing in the log cat - see below.
09:18:34.993 355-355/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502

I did recieve a different error yesterday which i did keep the logcat extract, this was when i was playing around within the Map, moving around zooming in and out etc, see error below.

09-19 16:37:55.146 12353-12353/uk.co.ainscough.routeinfo E/TileRenderer: glEndTilingQCOM: 0x502
09-19 16:37:55.166 12353-12353/uk.co.ainscough.routeinfo W/Adreno200-EGL: <qeglDrvAPI_eglSwapBuffers:3393>: EGL_BAD_SURFACE
09-19 16:37:55.166 12353-12353/uk.co.ainscough.routeinfo E/mbgl: {cough.routeinfo}[OpenGL]: eglSwapBuffers() returned error 12301
09-19 16:37:55.246 12353-12353/uk.co.ainscough.routeinfo W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41dff438)
09-19 16:37:55.266 12353-12353/uk.co.ainscough.routeinfo E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           java.lang.Error: eglSwapBuffers() failed
                                                                               at com.mapbox.mapboxsdk.maps.NativeMapView.nativeRender(Native Method)
                                                                               at com.mapbox.mapboxsdk.maps.NativeMapView.render(NativeMapView.java:179)
                                                                               at com.mapbox.mapboxsdk.maps.MapView.onDraw(MapView.java:406)
                                                                               at android.view.View.draw(View.java:13458)
                                                                               at android.widget.FrameLayout.draw(FrameLayout.java:467)
                                                                               at android.view.View.getDisplayList(View.java:12409)
                                                                               at android.view.View.getDisplayList(View.java:12453)
                                                                               at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
                                                                               at android.view.View.getDisplayList(View.java:12345)
                                                                               at android.view.View.getDisplayList(View.java:12453)
                                                                               at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
                                                                               at android.view.View.getDisplayList(View.java:12345)
                                                                               at android.view.View.getDisplayList(View.java:12453)
                                                                               at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
                                                                               at android.view.View.getDisplayList(View.java:12345)
                                                                               at android.view.View.getDisplayList(View.java:12453)
                                                                               at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
                                                                               at android.view.View.getDisplayList(View.java:12345)
                                                                               at android.view.View.getDisplayList(View.java:12453)
                                                                               at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
                                                                               at android.view.View.getDisplayList(View.java:12345)
                                                                               at android.view.View.getDisplayList(View.java:12453)
                                                                               at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911)
                                                                               at android.view.View.getDisplayList(View.java:12345)
                                                                               at android.view.View.getDisplayList(View.java:12453)
                                                                               at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1168)
                                                                               at android.view.ViewRootImpl.draw(ViewRootImpl.java:2149)
                                                                               at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2021)
                                                                               at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1832)
                                                                               at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
                                                                               at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4214)
                                                                               at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
                                                                               at android.view.Choreographer.doCallbacks(Choreographer.java:555)
                                                                               at android.view.Choreographer.doFrame(Choreographer.java:525)
                                                                               at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
                                                                               at android.os.Handler.handleCallback(Handler.java:615)
                                                                               at android.os.Handler.dispatchMessage(Handler.java:92)
                                                                               at android.os.Looper.loop(Looper.java:137)
                                                                               at android.app.ActivityThread.main(ActivityThread.java:4895)
                                                                               at java.lang.reflect.Method.invokeNative(Native Method)
                                                                               at java.lang.reflect.Method.invoke(Method.java:511)
                                                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
                                                                               at dalvik.system.NativeStart.main(Native Method)
09-19 16:37:55.376 631-1031/? W/ActivityManager:   Force finishing activity uk.co.ainscough.routeinfo/.NavigationMap
09-19 16:37:55.887 631-645/? W/ActivityManager: Activity pause timeout for ActivityRecord{42792ff0 u0 uk.co.ainscough.routeinfo/.NavigationMap}
09-19 16:38:05.888 631-645/? W/ActivityManager: Activity idle timeout for ActivityRecord{429efee0 u0 uk.co.ainscough.routeinfo/.ActivityRouteView}

See below gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "uk.co.ainscough.routeinfo"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 2
        versionName "2.0.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile files('libs/xstream-1.4.7.jar')
    compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.3@aar') {
        transitive=true
    }
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support:design:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:26.+'
    compile 'com.google.android.gms:play-services-maps:8.4.0'
    compile 'junit:junit:4.12'
}

If you require anymore information please let me know.

Activity

  1. Danny-James commented on Sep 20, 2017

    @Danny-James
    Author

    Below is NavigationMap Class

    package uk.co.ainscough.routeinfo;
    
    import android.os.Bundle;
    import android.support.v7.app.AppCompatActivity;
    
    import com.mapbox.mapboxsdk.Mapbox;
    import com.mapbox.mapboxsdk.maps.MapView;
    import com.mapbox.mapboxsdk.maps.MapboxMap;
    import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
    
    public class NavigationMap extends AppCompatActivity {
    
        private MapView mapView;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
    
            // Mapbox access token is configured here. This needs to be called either in your application
            // object or in the same activity which contains the mapview.
            Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
    
            // This contains the MapView in XML and needs to be called after the access token is configured.
            setContentView(R.layout.activity_navigation_map);
    
            // Create a mapView
            mapView = (MapView) findViewById(R.id.mapView);
            mapView.onCreate(savedInstanceState);
            mapView.getMapAsync(new OnMapReadyCallback() {
                @Override
                public void onMapReady(MapboxMap mapboxMap) {
    
                    // Interact with the map using mapboxMap here
    
                }
            });
        }
    
        // Add the mapView lifecycle to the activity's lifecycle methods
        @Override
        public void onResume() {
            super.onResume();
            mapView.onResume();
        }
    
        @Override
        protected void onStart() {
            super.onStart();
            mapView.onStart();
        }
    
        @Override
        protected void onStop() {
            super.onStop();
            mapView.onStop();
        }
    
        @Override
        public void onPause() {
            super.onPause();
            mapView.onPause();
        }
    
        @Override
        public void onLowMemory() {
            super.onLowMemory();
            mapView.onLowMemory();
        }
    
        @Override
        protected void onDestroy() {
            super.onDestroy();
            mapView.onDestroy();
        }
    
        @Override
        protected void onSaveInstanceState(Bundle outState) {
            super.onSaveInstanceState(outState);
            mapView.onSaveInstanceState(outState);
        }
    
    }
    
  2. added
    Android
    on Sep 20, 2017
  3. Danny-James commented on Sep 20, 2017

    @Danny-James
    Author

    When commenting the following code below the error no longer occurs, is their a bug within the onDestroy method?

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //mapView.onDestroy();
    }
    
  4. tobrun commented on Sep 27, 2017

    @tobrun
    Member

    Looked briefly into this issue and haven't been able to reproduce this on a general JellyBean device or emulator. It seems device specific atm.

  5. Danny-James commented on Sep 27, 2017

    @Danny-James
    Author

    @tobrun This is a physical device, Motorola (Zebra) TC55 - Android 4.1.2- When I Comment mapView.onDestroy() Out The Error Doesn't Happen And The App Doesn't Close.

  6. salonkasoli commented on Sep 27, 2017

    @salonkasoli

    @tobrun
    Android emulator 26.1.4 target android 4.1 CPU x86. Crash in mapView.onDestroy() -> nativeMapView.terminateContext(); -> nativeTerminateContext();

    09-27 10:03:17.979 2356-2356/com.example.pici.maptest A/tag: before onDestroy
    09-27 10:03:17.989 2356-2356/? A//system/bin/app_process: stack corruption detected: aborted
    
  7. tobrun commented on Sep 27, 2017

    @tobrun
    Member

    @salonkasoli not able to reproduce that with code used for 5.1.4:

    image
    image

    Will look into doing some tests with the binary.

  8. Danny-James commented on Sep 27, 2017

    @Danny-James
    Author

    @tobrun I Have Some Problems Regarding MultiDex, Let Me Resolve This And I Can Then Get You A GIF Of The Crashing Issue Explained Above.

  9. Danny-James commented on Sep 27, 2017

    @Danny-James
    Author

    @tobrun After Back Press The Screen Is Supposed To Go Back To The Last Activity (Route), As I'm Using The this.finish(); command - It's Actually Going Back To The Main Activity (My Jobs).

    UPDATED GIF
    navigation_back_crash2

    Let Me Know If You Have Difficulty Understanding.

  10. Danny-James commented on Sep 27, 2017

    @Danny-James
    Author

    @tobrun I have the GIF Recorder Working Again, I Will Create A New GIF.

  11. Danny-James commented on Sep 27, 2017

    @Danny-James
    Author

    Full_LogCat.txt

    Full LogCat Attached Whilst Doing The Above.

  12. Danny-James commented on Oct 2, 2017

    @Danny-James
    Author

    @tobrun, Have you managed to look into this issue?

  13. Danny-James commented on Oct 17, 2017

    @Danny-James
    Author

    @tobrun Did this get resolved or investigated further?

  14. Danny-James commented on Nov 21, 2017

    @Danny-James
    Author

    Android 4.1.2 - GIGABYTE/Motorola TC55.

    @tobrun, just to update you on this Issue, I'm now using the following gradle configuration

        // Mapbox Maps SDK
        implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:5.2.0@aar') {
            transitive = true
        }
        implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.7.0'
        implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.7.0'
        implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-traffic:0.3.0'
        implementation "com.mapzen.android:lost:3.0.2"
    

    When viewing the MapView which sits in my Activity (ActivityNavigationMap.java) if i press back or use the up navigation which should take me to the previous screen, i'm still getting a crash.

    The only error i'm seeing the LogCat is shown below;

    11-21 14:32:57.196 15168-15783/uk.co.ainscough.routeinfo A/libc: Fatal signal 11 (SIGSEGV) at 0x00000230 (code=1), thread 15783 (Thread-4152)
    11-21 14:32:57.296 167-167/? I/DEBUG: pid: 15168, tid: 15783, name: Thread-4152  >>> uk.co.ainscough.routeinfo <<<
    
  15. Danny-James commented on Dec 20, 2017

    @Danny-James
    Author

    This is still happening any news on this? When i go back to a previous activity from the MapView the application crashes and loads up my Main Activity.

  16. Danny-James commented on Jan 8, 2018

    @Danny-James
    Author

    @tobrun Can i have an update on this? I'm using the latest mapbox SDK.

    I'm using;

     // Mapbox Maps SDK
        implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-traffic:0.3.0'
        implementation ('com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.8.0') {
            transitive = true
            changing = true
        }

    When viewing the MapView which sits in my Activity (ActivityNavigationMap.java) if i press back or use the up navigation which should take me to the previous screen, i'm still getting a crash.

  17. Danny-James commented on Jan 18, 2018

    @Danny-James
    Author

    @tobrun @Guardiola31337 - I've had no reply on this ticket since this comment

    Could i have an update on this?

  18. tobrun commented on Mar 2, 2018

    @tobrun
    Member

    Capturing from mapbox/mapbox-navigation-android#534 that this is resolved.

  19. JacobJT commented on Jun 14, 2018

    @JacobJT

    @Danny-James If you're still experiencing this, take a look here:

    #10716

    Seems to be the use of onDestroy() instead of onDestroyView(), as actually @tobrun points out in the other thread.

  20. Danny-James commented on Jun 14, 2018

    @Danny-James
    Author

    @JacobJT my issue was with Adreno 2 chipset which was resolved by MapBox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions