lundi 23 octobre 2017

How to import classes implementing annotation @RunTestInLooperThread

I'm new to Realm and Android Programming. I have a problem implementing JUnit tests of async login (SyncUser.loginAsync). When I run the test I get the error:

"Asynchronous login is only possible from looper threads. Realm cannot be automatically updated on a thread without a looper."

To solve this problem I found that I should import these classes (Implementing Annotation @RunTestInLooperThread for tests to be run in a Looper):

import io.realm.rule.RunInLooperThread;
import io.realm.rule.RunTestInLooperThread;
import io.realm.rule.TestRealmConfigurationFactory;

But the package io.realm.rule.* is not found.

What I should do to import those classes?

I'm using gradle plugin io.realm:realm-gradle-plugin:4.1.0

Thanks in advance for your help.

Aucun commentaire:

Enregistrer un commentaire