ScottyB
ScottyB

Reputation: 2497

Library Cannot resolve method in TrueTime library

I'm trying to use the relatively new TrueTime library at https://github.com/instacart/truetime-android.

As instructed, I put the following in the build.gradle file:

repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    compile 'com.github.instacart.truetime-android:library-extension-rx:1.5'
}

Then in the Activity, I import it with:

import com.instacart.library.truetime.extensionrx.TrueTimeRx;

and invoke it with:

TrueTimeRx.build().initializeRx("time.apple.com")

except "initializeRx" is red and hover tip says "Cannot invoke method 'initializeRx(java.lang.String)'"

The 'initialize()' and other methods are shown as available when I type "TrueTimeRx.build()." so why isn't initializeRx?

Any ideas? Thanks.

Upvotes: 0

Views: 2118

Answers (1)

diogo
diogo

Reputation: 3976

This happens because you're using an older version of TrueTime library. Its documentation configures version 1.5, but the latest one is 2.0.

So, change your dependency to:

compile 'com.github.instacart.truetime-android:library-extension-rx:2.0'

Remember: every time you need to use a library hosted at GitHub, check the branch combobox and look forward the latest tag version.

Upvotes: 1

Related Questions