2016-06-30 32 views
1

Roboelectric 3編譯在我的應用我的<code>Roboelectric 2</code>更新<code>Roboelectric 3</code><br/> 在下一個代碼錯誤

final Dialog dialog = ShadowDialog.getLatestDialog(); 
final ShadowDialog shadowDialog = Shadows.shadowOf(dialog); 
Assert.assertNotNull(shadowDialog); 

我有奇怪的併發症錯誤:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (test-compile) on project tunneling-agent-lib: Compilation failure: Compilation failure: 
[ERROR] final ShadowDialog shadowDialog = Shadows.shadowOf(dialog); 
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^ 
[ERROR] The type android.net.ConnectivityManager$NetworkCallback cannot be resolved. It is indirectly referenced from required .class files 

一切工作之前(建立與maven):

<dependency> 
    <groupId>org.robolectric</groupId> 
    <artifactId>robolectric</artifactId> 
    <version>3.0</version> 
    <scope>test</scope> 
</dependency> 

可能的原因是什麼?

回答

0

你可以嘗試添加org.apache.http.legacy.jar在Android/Sdk/platforms/android-23 /可選的你的maven依賴嗎?

相關問題