takimafr / androidkickstartr

AndroidKickstartR helps you to quickly create a well configured Android application using the most popular libraries. It creates and configures your project for you. Just focus on code!
http://androidkickstartr.com
Other
608 stars 116 forks source link

Robolectric support #74

Closed a-thomas closed 11 years ago

a-thomas commented 11 years ago

The support of Roboelectric doesn't work with ABS 4.3.1.

Here is the stacktrace:

java.lang.ExceptionInInitializerError: null
    at android.util.Log.i(Log.java:9)
    at com.actionbarsherlock.ActionBarSherlock.registerImplementation(ActionBarSherlock.java:130)
    at com.actionbarsherlock.ActionBarSherlock.<clinit>(ActionBarSherlock.java:51)
    at com.androidkickstartr.app.test.ABSRobolectricTestRunner.<clinit>(ABSRobolectricTestRunner.java:16)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
    at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:262)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:158)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)

The crash occurs on this line ActionBarSherlock.registerImplementation(MockActionBarSherlock.class); from the ABSRobolectricTestRunner.java file (it's a template file).

Even if I replace the MockActionBarSherlock.class class by this one ActionBarSherlockCompat.class provided by ABS. The error is the same.

jeremiemartinez commented 11 years ago

It appeared with version 4.3.0. The stack is very strange, especially the first line in android.util.Log.i... I will try to look deeper.

jeremiemartinez commented 11 years ago

Robolectric is currently working on the final release for version 2. Before releasing anything, I guess we should wait for stable release.

a-thomas commented 11 years ago

It seems to be a good idea.

jeremiemartinez commented 11 years ago

Apparently, Robolectric final version 2 has been released. I guess we should check if we still have this bug.

a-thomas commented 11 years ago

And the new version is already available on Maven central. We definitely have to check it. Thanks ;)

jeremiemartinez commented 11 years ago

Sorry, I was really unavailable lately. I made a new POC working with latest version of every library. Hopefully, it should come fast.