2016-04-06 31 views
1

我一直在嘗試幾個小時來獲得一個簡單的Roboelectric測試類來編譯。所有紅色的項目都找不到,因此會引發編譯錯誤。Roboelectric和Android工作室問題

enter image description here

dependencies { 
    // Robolectric 
    testCompile 'junit:junit:4.12' 
    testCompile 'org.hamcrest:hamcrest-library:1.3' 
    testCompile 'org.apache.maven:maven-ant-tasks:2.1.3' // fixes linux/mac 
    testCompile 'org.robolectric:robolectric:3.0' 
} 
+0

有人嗎?什麼? – Mike6679

+0

在哪個文件夾中是類?它應該在'src/test/java/' –

+0

我還會在同一個包中測試與被測試的類 –

回答

0

問題是我已經安裝了一個過時的插件:Android的工作室單元測試的插件。