I am using UrbanAirship for receiving push and i can successfully receive notifications. I ve decided to add test to my project using robolectric and created a simple test as shown below.
@Config(emulateSdk = 18)
@RunWith(RobolectricTestRunner.class)
public class MyActivityTest {
@Test
public void test1(){
assertTrue(true);
}
}
and get
test1 FAILED java.lang.RuntimeException
Caused by: java.lang.IllegalStateException
When I run my test with debug i ve noticed a strange error.
java.lang.IllegalStateException: Unable to resolve UrbanAirshipProvider. Please check that the provider is defined in your AndroidManifest.xml, and that the authority string is set to "YOUR_PACKAGENAME.urbanairship.provider"
I checked my manifest but it looks like nothing is wrong.
<provider android:name="com.urbanairship.UrbanAirshipProvider"
android:authorities="com.test.myapp.app.urbanairship.provider"
android:permission="com.test.myapp.app.permission.UA_DATA"
android:exported="true"
android:multiprocess="true" />
I can run my tests without error if i comment out lines related to urbanairship. I am using AndroidStudio and version of the urbanairship jar is 4.0.2. Is there any way to fix this ?