How to build Autobahn-Java with all dependencies?

#1

Hey guys,

I’m trying to build the Autobahn-Java project locally and include it in my Android project, but so far all my attempts to include the Autobahn-Java project with all the dependencies have failed. I’m trying to ‘fix’ an issue we have between Autobahn-Java and the Nexus router by forcing the Autobahn-Java to use the JSON serializer (something is going wrong with the negotiation which serializer to use: https://github.com/gammazero/nexus/issues/146#issuecomment-547376483). I tried to clone the project, change the AndroidWebSocket.java file and rebuild the project. Then, I copied the autobahn-android-debug.aar file from the autobahn/build/outputs/aar/ location to the libs folder of my Android project and included it in the Gradle file with implementation(name: 'autobahn-android-debug', ext: 'aar'). But every time I try to make a connection with the Nexus router, it returns the runtime error:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/fasterxml/jackson/core/JsonFactory;
...
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.fasterxml.jackson.core.JsonFactory" on path: DexPathList[[zip file "/data/app/com.our.app-1-1/base.apk"],nativeLibraryDirectories=[/data/app/com.our.app-1/lib/arm64, /data/app/com.our.app-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/vendor/lib64]]

I tried to mannually add the dependency with adding implementation 'com.fasterxml.jackson.core:2.10' in the gradle file, but it results in getting: ERROR: Failed to resolve: com.fasterxml.jackson.core:2.10: Affected Modules: app.

I’m probably missing a step in getting/setting the dependencies for Autobahn-Java, but I don’t know which one. How should you build the Autobahn-Java project with all the dependencies and use it in another Android project?

#2

Try adding
implementation 'com.fasterxml.jackson.core:jackson-databind:2.10.0',

According to https://bintray.com/bintray/jcenter/com.fasterxml.jackson.core%3Ajackson-databind, the version is 2.10.0 not 2.10

#3

Thanks, that did the trick!