Skip to content

Instantly share code, notes, and snippets.

@skyisle
Created March 13, 2015 02:47
Show Gist options
  • Save skyisle/97d9e6fa607c99010430 to your computer and use it in GitHub Desktop.
Save skyisle/97d9e6fa607c99010430 to your computer and use it in GitHub Desktop.
junit test + retrolambda build error
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:validateDebugSigning
:app:prepareComAndroidSupportAppcompatV72103Library
:app:prepareComAndroidSupportSupportV42103Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:mergeDebugAssets
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:fabricGenerateResourcesDebug
:app:processDebugResources
:app:generateDebugSources
:app:compileDebugJava
:app:patchAndroidJar
:app:_compileDebugJava
:app:compileRetrolambdaDebug
:app:preDexDebug
:app:dexDebug
:app:packageDebug
:app:zipalignDebug
:app:assembleDebug
BUILD SUCCESSFUL
Total time: 47.168 secs
skyisle@abouts ~/w/MyApp> ./gradlew clean testDebug
Parallel execution is an incubating feature.
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:preCompileDebugUnitTestJava
:app:mockableAndroidJar
:app:prepareComAndroidSupportAppcompatV72103Library
:app:prepareComAndroidSupportSupportV42103Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:mergeDebugAssets
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:fabricGenerateResourcesDebug
:app:processDebugResources
:app:generateDebugSources
:app:compileDebugJava
:app:compileDebugUnitTestJava
/Users/skyisle/workspace/MyApp/app/src/test/java/com/myapp/MainActivityTest.java:18: error: cannot find symbol
assertTrue(Robolectric.buildActivity(MainActivity.class).create().get() != null);
^
symbol: class MainActivity
location: class MainActivityTest
1 error
:app:compileDebugUnitTestJava FAILED
:app:patchAndroidJar
:app:_compileDebugJava
:app:compileRetrolambdaDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugUnitTestJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 12.336 secs
@skyisle
Copy link
Author

skyisle commented Mar 13, 2015

If you use retrolambda with junit test, you can met above errors.
To workaround error, you can use following build command.

./gradlew clean compileRetrolambdaDebug testDebug

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