Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cammace opened this issue Mar 21, 2017 · 23 comments
Closed
Labels
Milestone

Comments

@cammace
Copy link
Contributor

cammace commented Mar 21, 2017

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

@zugaldia
Copy link
Member

Reported upstream: lostzen/lost#173.

@Emeritus-DarranKelinske

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

@Emeritus-DarranKelinske

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

@zugaldia
Copy link
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.

@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!

@msmollin
Copy link

msmollin commented Mar 29, 2017

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

@zugaldia
Copy link
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.

@msmollin
Copy link

Neat. Will continue discussion there as we triage.

@dazza5000
Copy link

Thank you to everyone who makes these projects possible <3

@Emeritus-DarranKelinske
Copy link

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.

@Emeritus-DarranKelinske

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

@Emeritus-DarranKelinske

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

@msmollin
Copy link

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

We're getting there though :)

@zugaldia
Copy link
Member

zugaldia commented May 2, 2017

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).

@Emeritus-DarranKelinske
Copy link

Emeritus-DarranKelinske commented May 2, 2017

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

@Emeritus-DarranKelinske

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

@zugaldia
Copy link
Member

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

@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}"
    }
}

}

@zugaldia
Copy link
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.

@Emeritus-DarranKelinske

I got confused. Thank you.

@sarahsnow1
Copy link

sarahsnow1 commented May 11, 2017

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!

@zugaldia
Copy link
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.

@zugaldia
Copy link
Member

Fixed via #462.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants