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

Problem with BindingContextFactory dependency and use #852

Closed
siavashabdoli opened this issue Jul 19, 2018 · 2 comments · Fixed by #909
Closed

Problem with BindingContextFactory dependency and use #852

siavashabdoli opened this issue Jul 19, 2018 · 2 comments · Fixed by #909

Comments

@siavashabdoli
Copy link

siavashabdoli commented Jul 19, 2018

mapbox services version: 3.3.0
device: lots of devices but I below stacktrace is for Pixel 1

Hi
I have a problem with BindingContextFactory logger in my app. I'm using my navigation sdk which is using my mapbox android services (I get other mapbox java services module from original one) with some changes in API models. the problem is even when I run app(my app or mapbox nav test app) in debug mode I get the below error:


FATAL EXCEPTION: main
     Process: com.mapbox.services.android.navigation.testapp, PID: 26431
     java.lang.NoClassDefFoundError: Failed resolution of: Lcom/sun/xml/internal/ws/spi/db/BindingContextFactory;
     at com.mapbox.api.directions.v5.MapboxDirections.errorDidOccur(MapboxDirections.java:197)
     at com.mapbox.api.directions.v5.MapboxDirections.access$000(MapboxDirections.java:62)
     at com.mapbox.api.directions.v5.MapboxDirections$1.onResponse(MapboxDirections.java:149)
     at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:70)
     at android.os.Handler.handleCallback(Handler.java:790)
     at android.os.Handler.dispatchMessage(Handler.java:99)
     at android.os.Looper.loop(Looper.java:164)
     at android.app.ActivityThread.main(ActivityThread.java:6494)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
       Caused by: java.lang.ClassNotFoundException: Didn't find class "com.sun.xml.internal.ws.spi.db.BindingContextFactory" on path: DexPathList[[zip file "/data/app/com.mapbox.services.android.navigation.testapp-ibn2OQUrbMDZayAFOVWYUg==/base.apk"],nativeLibraryDirectories=[/data/app/com.mapbox.services.android.navigation

when in Navigation SDK I open MapboxDirections the BindingContextFactory is red in both code and import. I even sync and try the original mapbox services but it's still red! and at last I clone the original version of Mapbox Navigation SDK and it's still red! I have many crashes because of this logger I even tried to find this dependency and add it but I can't find it. is it JDK related lib? I'm using java version 8.
I don't know what is the problem exactly but seems it leads to lots of problem! if you know how we can solve it please let me know because I didn't find any real related thing to this logger on google. is it related to how I import dependency? I'm using implementation keyword but I didn't use BidningContextFactory in my app or Nav SDK
I even tried to add dependency directly and I find this but it doesn't include the class as well:
implementation (group: 'com.sun.xml.ws', name: 'jaxws-rt', version: '2.1.4')
is there any specific reason that you use BindigContextFactory? I actually want to suggest, delete those line and use something else for logging.
P.S: I intentionally force server to give me error instead of 200 for testing this

@siavashabdoli
Copy link
Author

btw another problem there is I think we should send a default message when catch exception. otherwise the callback class would invoke and the progress bar would be visible forever :D

@osana
Copy link
Contributor

osana commented Aug 6, 2018

@siavashabdoli Most probably you need to update your proguard rules.
Android Navigation (which uses mapbox-java as well) had the same issue
Please look at mapbox/mapbox-navigation-android#1028
It got fixed by proguard rules update.

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

Successfully merging a pull request may close this issue.

2 participants