Skip to content

Look into reason why LOST can't handle multiple processes in an application. #401

Closed

Description

@cammace

When location permission enabled and you've included a process in your activity inside the manifest, the application will crash with the following error:

03-20 18:04:14.191 5568-5568/? D/sysproxy: [D:5111] Look up api.mapbox.com.
03-20 18:04:14.191 5568-5568/? D/sysproxy: [D:1cd2] Look up events.mapbox.com.
03-20 18:04:14.247 7383-7383/com.mapbox.mapboxandroiddemo:test D/AndroidRuntime: Shutting down VM
03-20 18:04:14.257 7383-7383/com.mapbox.mapboxandroiddemo:test E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                 Process: com.mapbox.mapboxandroiddemo:test, PID: 7383
                                                                                 java.lang.ClassCastException: android.os.BinderProxy cannot be cast to com.mapzen.android.lost.internal.FusedLocationProviderService$FusedLocationProviderBinder
                                                                                     at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.onServiceConnected(FusedLocationProviderApiImpl.java:45)
                                                                                     at com.mapzen.android.lost.internal.FusedLocationServiceConnectionManager.onServiceConnected(FusedLocationServiceConnectionManager.java:79)
                                                                                     at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.onServiceConnected(FusedLocationProviderApiImpl.java:65)
                                                                                     at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1453)
                                                                                     at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1481)
                                                                                     at android.os.Handler.handleCallback(Handler.java:751)
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                     at android.os.Looper.loop(Looper.java:154)
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
03-20 18:04:14.270 1443-1608/system_process W/ActivityManager:   Force finishing activity com.mapbox.mapboxandroiddemo/com.mapbox.mapboxandroidweardemo.examples.SimpleMapViewActivity
03-20 18:04:14.276 1443-1608/system_process W/ActivityManager:   Force finishing activity com.mapbox.mapboxandroiddemo/com.mapbox.mapboxandroidweardemo.MainActivity

cc: @zugaldia @Guardiola31337

Activity

  1. zugaldia commented on Mar 22, 2017

    @zugaldia
    Member

    Reported upstream: lostzen/lost#173.

  2. Emeritus-DarranKelinske commented on Mar 27, 2017

    @Emeritus-DarranKelinske

    this is gnar - any idea on an eta for this?

  3. Emeritus-DarranKelinske commented on Mar 27, 2017

    @Emeritus-DarranKelinske

    In an attempt to workaround. How do I disable the location permission?

  4. zugaldia commented on Mar 28, 2017

    @zugaldia
    Member

    @Emeritus-DarranKelinske Looks like this exception cannot be worked around by removing location permissions. The issue happens during manifest merge when the FusedLocationProviderService from LOST is merged into the app. You might want to look into tools:node="remove" instead.

  5. Emeritus-DarranKelinske commented on Mar 28, 2017

    @Emeritus-DarranKelinske

    Thank you for the suggestion. I will look into using that. In the meantime I removed all location permissions and that seems to fix it, but it means we are unable to use key features of our application which depend on location. Thank you!

  6. msmollin commented on Mar 29, 2017

    @msmollin

    Copying in the question from upstream: is this reproducible on the latest release of LOST- 2.2.0?

  7. zugaldia commented on Mar 29, 2017

    @zugaldia
    Member

    @msmollin Please see lostzen/lost#173 (comment) for details. Bottom line is that we still see the issue after upgrading to LOST 2.2.0.

  8. msmollin commented on Mar 29, 2017

    @msmollin

    Neat. Will continue discussion there as we triage.

  9. dazza5000 commented on Apr 7, 2017

    @dazza5000

    Thank you to everyone who makes these projects possible <3

  10. Emeritus-DarranKelinske commented on Apr 9, 2017

    @Emeritus-DarranKelinske

    Can we please revert the implementation of lost to the previous version until this issue is resolved. It is a showstopper for people that need multi-process.

  11. Emeritus-DarranKelinske commented on Apr 20, 2017

    @Emeritus-DarranKelinske

    This has been committed to master upstream. lostzen/lost#182

  12. Emeritus-DarranKelinske commented on Apr 20, 2017

    @Emeritus-DarranKelinske

    If we can get this into an alpha, I can get it on a device and test it. <3

  13. msmollin commented on Apr 20, 2017

    @msmollin

    The work isn't complete in the upstream ticket yet. lostzen/lost#173 (comment)

    We're getting there though :)

  14. added this to the v2.2.0 milestone on May 2, 2017
  15. zugaldia commented on May 2, 2017

    @zugaldia
    Member

    This has now been fixed upstream, I'm adding this ticket to the next milestone as a release blocker hoping that we can include the fix (we're depending on LOST releasing 2.3 on time).

  16. Emeritus-DarranKelinske commented on May 2, 2017

    @Emeritus-DarranKelinske

    I'm ready to test this whenever we get an alpha.

  17. Emeritus-DarranKelinske commented on May 10, 2017

    @Emeritus-DarranKelinske

    I just updated to the latest snapshot and am still having this issue. Is anyone else? Thank you!

  18. zugaldia commented on May 10, 2017

    @zugaldia
    Member

    @Emeritus-DarranKelinske How're you testing this, using the Test App in this repo? Could you share your full list of dependencies?

  19. Emeritus-DarranKelinske commented on May 10, 2017

    @Emeritus-DarranKelinske

    Im testing this in an app that uses one process for a BLE connection and the other process for UI interaction.

    DEPENDENCIES:

    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'no.nordicsemi.android:dfu:1.2.0'
    compile "com.android.support:support-v4:${android_support_library_version}"
    compile "com.android.support:support-annotations:${android_support_library_version}"
    compile "com.google.android.gms:play-services-location:${google_play_services_client_library_version}"
    compile 'com.google.code.gson:gson'
    compile 'commons-io:commons-io'
    compile 'joda-time:joda-time'
    compile 'org.joda:joda-convert:1.8'
    compile 'com.sothree.slidinguppanel:library'
    compile 'com.parse.bolts:bolts-tasks:1.4.0'
    compile 'no.nordicsemi.android.support.v18:scanner:1.0.0'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'commons-io:commons-io:2.5'
    compile 'joda-time:joda-time:2.9.4'
    compile 'com.sothree.slidinguppanel:library:3.3.1'
    // Guava upgrade requires SDK >= 24
    compile "com.google.guava:guava:20.0"
    compile 'com.jakewharton.timber:timber:4.5.1'
    // Color picker for collar
    compile 'com.thebluealliance:spectrum:0.7.1'
    compile 'com.wada811:android-material-design-colors:3.0.0'
    compile 'net.grandcentrix.tray:tray:0.11.1'

    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
    
    // Bluetooth
    compile 'no.nordicsemi.android.support.v18:scanner'
    compile 'com.github.movisens:SmartGattLib:1.7'
    
    compile 'com.parse.bolts:bolts-tasks'
    
    // DK: For debugging purposes
    compile 'com.facebook.stetho:stetho:1.4.2'
    compile 'com.github.pedrovgs:lynx:1.6'
    
    compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
        transitive = true;
    }
    compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.0-SNAPSHOT@aar') {
        transitive=true
    }
    
    testCompile 'junit:junit:4.12'
    testCompile 'org.mockito:mockito-core:1.10.19'
    

    // androidTestCompile 'com.squareup.assertj:assertj-android:1.1.1'
    androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
    androidTestCompile "com.android.support:support-annotations:${android_support_library_version}"
    androidTestCompile 'org.hamcrest:hamcrest-library'

    // Espresso Dependencies
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support.test:rules:0.5'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.2', {
        exclude module: 'support-annotations'
        exclude module: 'support-v4'
        exclude module: 'recyclerview-v7'
        exclude module: 'design'
    })
    androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
    
    configurations.all {
        resolutionStrategy {
            force "com.android.support:support-annotations:${android_support_library_version}"
        }
    }
    

    }

  20. zugaldia commented on May 10, 2017

    @zugaldia
    Member

    @Emeritus-DarranKelinske I see what the issue is. This project's SNAPSHOT (mapbox-java) has been updated to the latest LOST, but not our Map SDK (yet). We need to merge mapbox/mapbox-gl-native#8872 first.

  21. Emeritus-DarranKelinske commented on May 10, 2017

    @Emeritus-DarranKelinske

    I got confused. Thank you.

  22. sarahcodes100 commented on May 11, 2017

    @sarahcodes100

    Just a heads up- we are targeting a 2.3.0 release in the next few days and would love feedback. Please report any issues you have had integrating the 2.3.0-SNAPSHOT. Thanks for your patience and help, we're looking forward to getting a new stable version out!

  23. zugaldia commented on May 12, 2017

    @zugaldia
    Member

    @sarahlensing Love it, this is much appreciated. To help with testing, we're gonna release beta.2 of our next SDK release today to help everyone test the SNAPSHOT on their own apps mapbox/mapbox-gl-native#8975.

  24. zugaldia commented on May 26, 2017

    @zugaldia
    Member

    Fixed via #462.

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions