Upgrade Java Platform

Sometimes when Google upgrades the Tango network service or the Tango Core client library the API changes and breaks apps. For example a Java app might break with a stack dump like:

JNI DETECTED ERROR IN APPLICATION: JNI CallVoidMethodV called with pending exception 'java.lang.NullPointerException' thrown in unknown throw location
    in call to CallVoidMethodV
"Binder_1" prio=5 tid=12 Runnable
  | group="main" sCount=0 dsCount=0 obj=0x648695b0 self=0x471c5bd0
  | sysTid=7150 nice=0 cgrp=apps sched=0/0 handle=0x471c5988
  | state=R schedstat=( 72639583 42449257 242 ) utm=1 stm=5 core=2 HZ=100
  | stack=0x47bd9000-0x47bdd000 stackSize=1016KB
  (no managed stack frames)

Runtime aborting...
Aborting thread:
"Binder_1" prio=5 tid=12 Runnable
  | group="main" sCount=0 dsCount=0 obj=0x648695b0 self=0x471c5bd0
  | sysTid=7150 nice=0 cgrp=apps sched=0/0 handle=0x471c5988
  | state=R schedstat=( 73404833 42779007 243 ) utm=1 stm=5 core=3 HZ=100
  | stack=0x47bd9000-0x47bdd000 stackSize=1016KB
  native: art::Thread::DumpStack(std::ostream&) const+87 [0x416c9b78] (libart.so)

 native: ??? [0x416c1c62] (libart.so)
  native: art::Runtime::Abort()+79 [0x416c2204] (libart.so)
  native: art::LogMessage::~LogMessage()+507 [0x4156d89c] (libart.so)
  native: ??? [0x41575ad4] (libart.so)
  native: art::JniAbortF(char const*, char const*, ...)+51 [0x41576254] (libart.so)
  native: ??? [0x4157817c] (libart.so)
  native: ??? [0x415783e6] (libart.so)
  native: ??? [0x4157efe6] (libart.so)
  native: _JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+19 [0x48c05560] (libtango_client_api.so)
  native: onPointCloudParcelAvailable+217 [0x48c08326] (libtango_client_api.so)
  native: TangoListener::onPointCloudParcelAvailable(android::Parcel const&)+47 [0x48bfc8f0] (libtango_client_api.so)
  native: tango_binder::ClientListener::onTransact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+197 [0x48c0dbca] (libtango_client_api.so)
  native: android::BBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+57 [0x40197222] (libbinder.so)

The upgrade might be released without the breaking changes noted in release notes or any other documentation.

To keep up the developer might need to download the new release's TangoReleaseLibs and rename them to agree with the Java project's existing build.gradle filenames, eg:

TangoReleaseLibs
├── aar
│   ├── tango_support_java_lib.aar
│   └── tango-ux-support-library.aar
└── jar
    └── tango_java_lib.jar

Then clean the project, try to rebuild and run. Some changes require recoding, for example replacing TangoMesher.java from Google's Github tango-examples-java/java_mesh_builder_example versions prior to the gankino release with the gankino one, because Google changed Tango.OnTangoUpdateListener from an interface to a class (that is also now deprecated).

It's also possible to track the TangoReleaseLibs libraries by Gradle, but it's not as simple as the Tango downloads page implies. For example, the latest (as of this writing) com.google.tango:support-base , 1.52, that's in jcenter for reference in the app's build.gradle doesn't include the com.tango.* packages required by the app, so you have to download the JAR from the downloads page and refer to the local file instead of using the jcenter instance in the app's build.gradle .

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License