Getting "java.lang.UnsatisfiedLinkError: android.util.Log.isLoggable" exception when using latest Robolectric 2.2 jar

1,896 views
Skip to first unread message

Abhi

unread,
Jun 19, 2013, 11:30:44 AM6/19/13
to robol...@googlegroups.com
I am using Robolectric latest jar to write my Unit test cases and for some reason I am getting "java.lang.UnsatisfiedLinkError: android.util.Log.isLoggable" exception when I run my test case. 

java.lang.UnsatisfiedLinkError: android.util.Log.isLoggable(Ljava/lang/String;I)Z
at android.util.Log.isLoggable(Native Method)
at android.os.StrictMode.<clinit>(StrictMode.java:116)
at android.app.Activity.<init>(Activity.java:746)


I see that Robolectric has a ShadowLog class in the jar which shadows "android.util.Log" but not sure why it doesn't use it and let the call go to the Native code. I am assuming that I don't need to manually add this shadow file to each of my test cases as it is already present in Robolectric jar. Can someone please let me know how to resolve this issue ? 

Thanks
Abhi

Alex Beggs

unread,
Jul 21, 2013, 12:27:20 PM7/21/13
to robol...@googlegroups.com
Hi Abhi,

I ran into the same issue.  Are you declaring the RobolectricTestRunner annotation at the top of your test class?

@RunWith(RobolectricTestRunner.class)
public class HelloAndroidActivityTest {
Reply all
Reply to author
Forward
0 new messages