New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run Robolectric 3.2 under Windows #2814

Closed
Teka101 opened this Issue Jan 5, 2017 · 23 comments

Comments

Projects
None yet
5 participants
@Teka101

Teka101 commented Jan 5, 2017

My tests stop working with Robolectric 3.2 and with Gradle 2.1.3 / 2.2.0 / 2.2.3

Internal Error occured.
java.lang.IllegalArgumentException: failed to configure myapp.MainActivityTest.testMe: Unexpected internal error near index 1
\
 ^
	at org.robolectric.RobolectricTestRunner.getChildren(RobolectricTestRunner.java:230)
	at org.junit.runners.ParentRunner.getFilteredChildren(ParentRunner.java:426)
	at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:351)
	at com.intellij.junit4.JUnit4IdeaTestRunner.getDescription(JUnit4IdeaTestRunner.java:123)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:99)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
	at java.util.regex.Pattern.error(Pattern.java:1955)
	at java.util.regex.Pattern.compile(Pattern.java:1702)
	at java.util.regex.Pattern.<init>(Pattern.java:1351)
	at java.util.regex.Pattern.compile(Pattern.java:1028)
	at java.lang.String.split(String.java:2380)
	at java.lang.String.split(String.java:2422)
	at org.robolectric.res.FileFsFile.from(FileFsFile.java:177)
	at org.robolectric.internal.GradleManifestFactory.identify(GradleManifestFactory.java:34)
	at org.robolectric.RobolectricTestRunner.getAppManifest(RobolectricTestRunner.java:398)
	at org.robolectric.RobolectricTestRunner.getChildren(RobolectricTestRunner.java:217)
	... 12 more

The bug is in "FileFsFile" with try to split with "" (Windows path separator) but without escape "" character...

@Kisty

This comment has been minimized.

Show comment
Hide comment
@Kisty

Kisty Jan 5, 2017

Ah that's what's happening. @xian, does the code use File.separator to reference the file separator in the regex?

Kisty commented Jan 5, 2017

Ah that's what's happening. @xian, does the code use File.separator to reference the file separator in the regex?

@Kisty

This comment has been minimized.

Show comment
Hide comment
@Kisty

Kisty Jan 5, 2017

Ah, yes it does, ignore that comment. I'll see if I can fix it.

Kisty commented Jan 5, 2017

Ah, yes it does, ignore that comment. I'll see if I can fix it.

@Teka101

This comment has been minimized.

Show comment
Hide comment
@Teka101

Teka101 Jan 5, 2017

Thanks 👍

Teka101 commented Jan 5, 2017

Thanks 👍

@Kisty

This comment has been minimized.

Show comment
Hide comment
@Kisty

Kisty Jan 5, 2017

I've tried to build the project in Windows but I can't. The install-dependencies.rb script assumes we're in Unix-land and failing. Installing Windows 10 Linux subsystem instead but may take some time to rebuild. I think I can see what to do and going to try and make some test cases for it.

Kisty commented Jan 5, 2017

I've tried to build the project in Windows but I can't. The install-dependencies.rb script assumes we're in Unix-land and failing. Installing Windows 10 Linux subsystem instead but may take some time to rebuild. I think I can see what to do and going to try and make some test cases for it.

@ravpacheco

This comment has been minimized.

Show comment
Hide comment
@ravpacheco

ravpacheco Jan 5, 2017

I have the same problem!

ravpacheco commented Jan 5, 2017

I have the same problem!

@xian xian added this to the 3.2.1 milestone Jan 5, 2017

@xian xian added the defect label Jan 5, 2017

@SUPERCILEX

This comment has been minimized.

Show comment
Hide comment
@SUPERCILEX

SUPERCILEX Jan 5, 2017

Same here!

SUPERCILEX commented Jan 5, 2017

Same here!

@xian xian referenced this issue Jan 6, 2017

Merged

Fix FsFile on Windows #2821

0 of 1 task complete
@xian

This comment has been minimized.

Show comment
Hide comment
@xian

xian Jan 6, 2017

Member

Anyone with a Windows box want to help me test a fix?

Member

xian commented Jan 6, 2017

Anyone with a Windows box want to help me test a fix?

@SUPERCILEX

This comment has been minimized.

Show comment
Hide comment
@SUPERCILEX

SUPERCILEX Jan 6, 2017

@xian, sure but the jitpack builds keep failing and 3.2.1-SNAPSHOT doesn't exist yet on sonatype so could you provide an aar?

SUPERCILEX commented Jan 6, 2017

@xian, sure but the jitpack builds keep failing and 3.2.1-SNAPSHOT doesn't exist yet on sonatype so could you provide an aar?

@xian xian closed this in #2821 Jan 6, 2017

@xian xian reopened this Jan 6, 2017

@xian

This comment has been minimized.

Show comment
Hide comment
@xian

xian Jan 6, 2017

Member

@SUPERCILEX I'll get snapshotting fixed, hang tight :-)

Member

xian commented Jan 6, 2017

@SUPERCILEX I'll get snapshotting fixed, hang tight :-)

@SUPERCILEX

This comment has been minimized.

Show comment
Hide comment
@SUPERCILEX

SUPERCILEX Jan 6, 2017

@xian Just ping me when you have it ready! 😄

SUPERCILEX commented Jan 6, 2017

@xian Just ping me when you have it ready! 😄

@xian

This comment has been minimized.

Show comment
Hide comment
@xian
Member

xian commented Jan 6, 2017

@SUPERCILEX

This comment has been minimized.

Show comment
Hide comment
@SUPERCILEX

SUPERCILEX Jan 6, 2017

@xian it works! When can we expect 3.2.1 to come out?

image

SUPERCILEX commented Jan 6, 2017

@xian it works! When can we expect 3.2.1 to come out?

image

@xian

This comment has been minimized.

Show comment
Hide comment
@xian

xian Jan 6, 2017

Member

@SUPERCILEX awesome! There are a couple other small fixes I'm gonna pull in and I'll push 3.2.1 out tomorrow. Thanks for your help!

Member

xian commented Jan 6, 2017

@SUPERCILEX awesome! There are a couple other small fixes I'm gonna pull in and I'll push 3.2.1 out tomorrow. Thanks for your help!

@xian xian closed this Jan 6, 2017

@SUPERCILEX

This comment has been minimized.

Show comment
Hide comment
@SUPERCILEX

SUPERCILEX commented Jan 6, 2017

@xian awesome!

@Kisty

This comment has been minimized.

Show comment
Hide comment
@Kisty

Kisty Jan 6, 2017

After doing a clean build and pointing to robolectric and robolectric-shadows-support-v4 3.2.1-SNAPSHOT, I get the same error, unfortunately.

Kisty commented Jan 6, 2017

After doing a clean build and pointing to robolectric and robolectric-shadows-support-v4 3.2.1-SNAPSHOT, I get the same error, unfortunately.

@xian

This comment has been minimized.

Show comment
Hide comment
@xian

xian Jan 6, 2017

Member

@Kisty same stack trace?

Member

xian commented Jan 6, 2017

@Kisty same stack trace?

@Kisty

This comment has been minimized.

Show comment
Hide comment
@Kisty

Kisty commented Jan 6, 2017

@xian yup

@xian

This comment has been minimized.

Show comment
Hide comment
@xian

xian Jan 6, 2017

Member

Identical line numbers and everything? Sounds like you're not actually getting the SNAPSHOT build somehow... FileFsFile.from() calls String.split() at line 184 now...?

Member

xian commented Jan 6, 2017

Identical line numbers and everything? Sounds like you're not actually getting the SNAPSHOT build somehow... FileFsFile.from() calls String.split() at line 184 now...?

@Kisty

This comment has been minimized.

Show comment
Hide comment
@Kisty

Kisty Jan 6, 2017

Hmm, am still getting call to split at line 177. Trying build with gradlew --refresh-dependencies now.

java.lang.IllegalArgumentException: failed to configure uk.co.imagitech.learn2.hp.AppHazardQuestionEntryTest.canBeParcelled: Unexpected internal error near index 1
\
 ^
	at org.robolectric.RobolectricTestRunner.getChildren(RobolectricTestRunner.java:230)
	at org.junit.runners.ParentRunner.getFilteredChildren(ParentRunner.java:426)
	at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:351)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:359)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:377)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
	at java.util.regex.Pattern.error(Pattern.java:1955)
	at java.util.regex.Pattern.compile(Pattern.java:1702)
	at java.util.regex.Pattern.<init>(Pattern.java:1351)
	at java.util.regex.Pattern.compile(Pattern.java:1028)
	at java.lang.String.split(String.java:2380)
	at java.lang.String.split(String.java:2422)
	at org.robolectric.res.FileFsFile.from(FileFsFile.java:177)
	at org.robolectric.internal.GradleManifestFactory.identify(GradleManifestFactory.java:34)
	at org.robolectric.RobolectricTestRunner.getAppManifest(RobolectricTestRunner.java:398)
	at org.robolectric.RobolectricTestRunner.getChildren(RobolectricTestRunner.java:217)
	... 29 more

Kisty commented Jan 6, 2017

Hmm, am still getting call to split at line 177. Trying build with gradlew --refresh-dependencies now.

java.lang.IllegalArgumentException: failed to configure uk.co.imagitech.learn2.hp.AppHazardQuestionEntryTest.canBeParcelled: Unexpected internal error near index 1
\
 ^
	at org.robolectric.RobolectricTestRunner.getChildren(RobolectricTestRunner.java:230)
	at org.junit.runners.ParentRunner.getFilteredChildren(ParentRunner.java:426)
	at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:351)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:359)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:377)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
	at java.util.regex.Pattern.error(Pattern.java:1955)
	at java.util.regex.Pattern.compile(Pattern.java:1702)
	at java.util.regex.Pattern.<init>(Pattern.java:1351)
	at java.util.regex.Pattern.compile(Pattern.java:1028)
	at java.lang.String.split(String.java:2380)
	at java.lang.String.split(String.java:2422)
	at org.robolectric.res.FileFsFile.from(FileFsFile.java:177)
	at org.robolectric.internal.GradleManifestFactory.identify(GradleManifestFactory.java:34)
	at org.robolectric.RobolectricTestRunner.getAppManifest(RobolectricTestRunner.java:398)
	at org.robolectric.RobolectricTestRunner.getChildren(RobolectricTestRunner.java:217)
	... 29 more
@Kisty

This comment has been minimized.

Show comment
Hide comment
@Kisty

Kisty Jan 6, 2017

Ah, wait. I think it's getting the snapshot I compiled when I was trying to build Robolectric locally so deleted the local snapshot versions and it's all good now.

Yup, no exception thrown now 👍. Still have workaround for #2692. Thought the Matrix fix in 3.2 was related but apparently not. Thanks, @xian!

Kisty commented Jan 6, 2017

Ah, wait. I think it's getting the snapshot I compiled when I was trying to build Robolectric locally so deleted the local snapshot versions and it's all good now.

Yup, no exception thrown now 👍. Still have workaround for #2692. Thought the Matrix fix in 3.2 was related but apparently not. Thanks, @xian!

@xian

This comment has been minimized.

Show comment
Hide comment
@xian

xian Jan 6, 2017

Member

@Kisty awesome! #2692 is closed -- is it still broken?

Member

xian commented Jan 6, 2017

@Kisty awesome! #2692 is closed -- is it still broken?

@Kisty

This comment has been minimized.

Show comment
Hide comment
@Kisty

Kisty Jan 6, 2017

I think so. #2692 was dupe as was #1932 and merged into #2566.

Kisty commented Jan 6, 2017

I think so. #2692 was dupe as was #1932 and merged into #2566.

@xian

This comment has been minimized.

Show comment
Hide comment
@xian

xian Jan 6, 2017

Member

Ah gotcha, yep that's on our backlog. :-)

Member

xian commented Jan 6, 2017

Ah gotcha, yep that's on our backlog. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment