Robolectic 3.0-rc3 ile kütüphane kullanırken bir ResourceNotFoundException alma. Kaynak derleme 'net.danlew: android.joda: 2.8.0' ile build.gradle içinde bildirildi. Özellikle bu, Joda-Time'ın Android bağlantı noktasıdır.Robolectric 3 ile kütüphane kaynakları - JodaTime
android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f0501da
at org.robolectric.shadows.ShadowResources.checkResName(ShadowResources.java:343)
at org.robolectric.shadows.ShadowResources.getResName(ShadowResources.java:333)
at org.robolectric.shadows.ShadowResources.openRawResource(ShadowResources.java:382)
at android.content.res.Resources.openRawResource(Resources.java)
at net.danlew.android.joda.ResourceZoneInfoProvider.openResource(ResourceZoneInfoProvider.java:120)
at net.danlew.android.joda.ResourceZoneInfoProvider.<init>(ResourceZoneInfoProvider.java:39)
Uygulama sınıfı:
@Override
public void onCreate() {
super.onCreate();
JodaTime.init(this);
}
Testim sınıfı:
@RunWith(RobolectricGradleTestRunner.class)
@Config(constants = BuildConfig.class,
sdk = 21)
public class MyTest {
@Before
public void setup() {
}
@Test
public void myTest() {
//Test my stuff
}
}
, ama testler geçiyoruz, hata sağ günlüğe sadece alır? – Maximosaic
Hayır, JodaTime.init (this) de runtimeException ile başarısız oldu; hat. – Patrick
Üzgünüz o zaman. "Net.danlew: android.joda: 2.7.2" yi kullanıyorum, ancak bu init'i yapmadığımı farkettim. Ama ben sadece JodaTimeAndroid.init (aktivite) denedim ve testimde çalıştı, belki JodaTimeAndroid ve JodaTime arasında bir fark var. Umarım bu size yardımcı olabilir, iyi şanslar! – Maximosaic