storj / uplink-android

Storj network Android library
MIT License
19 stars 7 forks source link

Opening a project fails #2

Closed dri94 closed 4 years ago

dri94 commented 4 years ago

When opening a project as specified in instructions, the following error is returned

go.Universe$proxyerror: metainfo error: rpccompat: dial tcp: lookup us-central-1.tardigrade.io: No address associated with hostname

The satellite address I am using is us-central-1.tardigrade.io:7777

My code is

    fun login(
        satelliteAddress: String,
        apiKey: String,
        encryptionAccess: String
    ): Result<Scope, Exception> {
        val key = ApiKey.parse(apiKey)
        return try {
            val project = Uplink().openProject(satelliteAddress, key)
            val saltedKey = Key.getSaltedKeyFromPassphrase(project, encryptionAccess)
            val access = EncryptionAccess(saltedKey)
            Success(Scope(satelliteAddress, key, access))
        } catch (ex: StorjException) {
            return Error(ex)
        }
    }
kaloyan-raev commented 4 years ago

This error means that the us-central-1.tardigrade.io DNS name cannot be resolved on your device/emulator.

Make sure that your device/emulator is connected to Internet and that your app has the android.permission.INTERNET in the manifest.

dri94 commented 4 years ago

I feel really embarrassed by that mistake lol. However is there any way to get more human readable error messages? This will make it easier for devs to understand, and bubble up the info to users

kaloyan-raev commented 4 years ago

Ideally, this should be an UnknownHostException, but we are not there yet in converting Golang errors to Java exceptions. We plan to have this in the future.

dri94 commented 4 years ago

I still currently get an io.storj.StorjException: go.Universe$proxyerror: metainfo error: rpccompat: dial tcp 35.184.17.243:7777: socket: operation not permitted when trying to perform this code.. This only exists on emulator so nonblocking. Would like to find a resolve in this thread for informational purposes, however I am closing this thread as its really nonessential.