nenick / AndroidStudioAndRobolectric

Minimal Robolectric and Android Studio example
139 stars 29 forks source link

Can't run Roboletric on windows: java.lang.NoSuchMethodException: android.os.Looper.<init>(boolean) #15

Closed andr3medeiros closed 9 years ago

andr3medeiros commented 9 years ago

I don't know if this issue happens only at windows, but as I just run the the project as it is, and got the issue plus, no other related issue was filed, I guess it could be.

I just ran RobolectricTest (right click) and got:

 java.lang.RuntimeException: java.lang.NoSuchMethodException: android.os.Looper.<init>(boolean)
    at org.robolectric.util.ReflectionHelpers.callConstructor(ReflectionHelpers.java:233)
    at org.robolectric.shadows.ShadowLooper.createLooper(ShadowLooper.java:43)
    at org.robolectric.shadows.ShadowLooper.access$000(ShadowLooper.java:25)
    at org.robolectric.shadows.ShadowLooper$1.create(ShadowLooper.java:37) ... 
andr3medeiros commented 9 years ago

I just found out. In my maven settings.xml I added (as specified in maven site):

<localRepository>${user.home}/.m2/repository</localRepository>

After remove it, Roboletric worked fine.

nenick commented 9 years ago

Great, thanks for reporting.