Ich bin nicht in der Lage, Robolectic-Test zu starten, wenn neue Appcompat-Support-Bibliothek verfügbar seit Android Lollipop kam. Ich habe gefolgt:Android Lollipop Appcompat Probleme mit Robolectric
Mein aktueller Fortschritte hier verfügbar: https://github.com/fada21/android-tdd-bootstrap
Meine Konfiguration (destillierte) ist:
android {
compileSdkVersion 21
buildToolsVersion "21.0.1"
defaultConfig {
applicationId "com.fada21.android.bootstrap"
minSdkVersion 15
targetSdkVersion 21
..
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
...
androidTestCompile('org.robolectric:robolectric:2.4-SNAPSHOT') {
ich ein Problem hier angehoben habe: https://github.com/robolectric/robolectric/issues/1332 (hier für weitere Details).
Dies ist Fehler Ich erhalte:
java.lang.RuntimeException: Could not find any resource from reference ResName{com.fada21.android.bootstrap:style/Theme_AppCompat_Light_NoActionBar} from style StyleData{name='AppTheme', parent='Theme_AppCompat_Light_NoActionBar'} with theme null
at org.robolectric.shadows.ShadowAssetManager$StyleResolver.getParent(ShadowAssetManager.java:456)
at org.robolectric.shadows.ShadowAssetManager$StyleResolver.getAttrValue(ShadowAssetManager.java:394)
at org.robolectric.shadows.ShadowResources.getOverlayedThemeValue(ShadowResources.java:297)
at org.robolectric.shadows.ShadowResources.findAttributeValue(ShadowResources.java:286)
at org.robolectric.shadows.ShadowResources.attrsToTypedArray(ShadowResources.java:189)
at org.robolectric.shadows.ShadowResources.access$000(ShadowResources.java:48)
at org.robolectric.shadows.ShadowResources$ShadowTheme.obtainStyledAttributes(ShadowResources.java:494)
at org.robolectric.shadows.ShadowResources$ShadowTheme.obtainStyledAttributes(ShadowResources.java:489)
at org.robolectric.shadows.ShadowResources$ShadowTheme.obtainStyledAttributes(ShadowResources.java:484)
at android.content.res.Resources$Theme.obtainStyledAttributes(Resources.java)
at android.content.Context.obtainStyledAttributes(Context.java:380)
at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:143)
at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(ActionBarActivityDelegateBase.java:139)
at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:123)
at com.fada21.android.bootstrap.HomeActivity.onCreate(HomeActivity.java:28)
at android.app.Activity.performCreate(Activity.java:5133)
at org.fest.reflect.method.Invoker.invoke(Invoker.java:112)
at org.robolectric.util.ActivityController$1.run(ActivityController.java:113)
at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:265)
at org.robolectric.util.ActivityController.create(ActivityController.java:110)
at org.robolectric.util.ActivityController.create(ActivityController.java:120)
at com.fada21.android.bootstrap.HomeActivityTest.testActivityNotNull(HomeActivityTest.java:24)
Ich folge zur Zeit dieses Thema https://github.com/robolectric/robolectric/issues/1332#issuecomment-61470450. Die gleichen Probleme haben. – loeschg
Ja, ich habe diesen Thread gestartet. @loeschg Hast du diesen ShadowSupportMenuInflater im Kommentar erwähnt? – fada21
Ich habe das versucht ... denke ich. Ich plane morgen einen fokussierten Blick. Danke, dass du mir diese Richtung gezeigt hast! – loeschg