task 'assemble' not found in project 'realm'

1,122 views
Skip to first unread message

Ben Plant

unread,
Oct 2, 2014, 6:46:29 AM10/2/14
to realm...@googlegroups.com
Hi,

I'm implementing Realm in an existing project, and I'm having a few issues getting my project to build since. The project uses Parse for cloud storage and I've been working on it for around three months. Currently, Gradle is whinging:

Error:FAILURE: Build failed with an exception.

* What went wrong:
Task 'assemble' not found in project ':realm'.

I've set the project up exactly how it's depicted in the tutorial on the site:

settings.gradle
include ':app'
include
':realm'

root build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript
{
    repositories
{
        mavenCentral
()
   
}
    dependencies
{
        classpath
'com.android.tools.build:gradle:0.12.+'
        classpath
'com.neenbedankt.gradle.plugins:android-apt:1.4'

       
// NOTE: Do not place your application dependencies here; they belong
       
// in the individual module build.gradle files
   
}
}

allprojects
{
    repositories
{
        mavenCentral
()
   
}
}


app level build.gradle
apply plugin: 'android'
apply plugin
: 'com.neenbedankt.android-apt'

android
{
    compileSdkVersion
19
    buildToolsVersion
"19.1.0"

    defaultConfig
{
        applicationId
"com.cyanon.superconcierge5000.app"
        minSdkVersion
19
        targetSdkVersion
19
        versionCode
1
        versionName
"Shellshock"
   
}
    buildTypes
{
        release
{
            runProguard
false
            proguardFiles getDefaultProguardFile
('proguard-android.txt'), 'proguard-rules.pro'
       
}
   
}
}

dependencies
{
    compile fileTree
(dir: 'libs', include: ['*.jar'], exclude: ['realm-annotations-processor*.jar'])
    apt fileTree
(dir: 'libs', include: ['realm-annotations-processor*.jar'])
    compile files
('libs/Parse-1.5.1.jar') // <----------- Is there a known conflict with Parse?
    compile project
(':realm')
}


Reading through the logs from the failed builds, it would appear to be a gradle configuration issue, but Gradle is something I've never really touched and I'm worried about breaking it to the point where I'm not going to be able to get the project to build ever again.

Can anyone point me in the right direction?

Thanks!



Kenneth Geisshirt

unread,
Oct 2, 2014, 7:54:04 AM10/2/14
to Ben Plant, realm...@googlegroups.com
Hi Ben,

Thank you for trying out Realm and taking the time to ask us.

>
> dependencies {
> compile fileTree(dir: 'libs', include: ['*.jar'], exclude: ['realm-annotations-processor*.jar'])
> apt fileTree(dir: 'libs', include: ['realm-annotations-processor*.jar'])
> compile files('libs/Parse-1.5.1.jar') // <----------- Is there a known conflict with Parse?
> compile project(':realm')
> }
>

I’m not a Gradle expert, but the first “compile” and the second “compile” will both include “libs/Parse-1.5.1.jar”. Can you assemble if you remove the second “compile”? If not, you’re welcome your log file directly to send me so I can investigate if we have a conflict with 3rd party jars.

/kneth

--
Kenneth Geisshirt, M.Sc., Ph.D. · +45 60 62 71 82 · k...@realm.io
Njalsgade 19D, DK-2300 Copenhagen S · http://realm.io/

Ben Plant

unread,
Oct 3, 2014, 6:12:43 AM10/3/14
to realm...@googlegroups.com, benpl...@googlemail.com
Hi,

Thanks for your reply! I've looked at a few different bits and pieces to see where the problem lies and can't seem to knock it on the head. Logs-wise, that top bit is what I've got. It says to run Gradle with --info or --debug for more info, but I've no idea how to do that and am currently investigating.

Could it be that Gradle is trying to compile it as a second app, not a dependency to the first? 

Emanuele Zattin

unread,
Oct 3, 2014, 7:39:18 AM10/3/14
to realm...@googlegroups.com, benpl...@googlemail.com
Hello Ben,

may I ask you to share the build.gradle file in the realm folder as well? it looks like that's where the problem might be.

Emanuele

Ben Plant

unread,
Oct 3, 2014, 8:57:53 AM10/3/14
to realm...@googlegroups.com, benpl...@googlemail.com
Sure! Here you go:

configurations.create("default")
artifacts.add("default", file("realm-0.70.1.aar"))

Thanks again!

Emanuele Zattin

unread,
Oct 3, 2014, 8:58:57 AM10/3/14
to Ben Plant, realm...@googlegroups.com
That looks fine.
Are you using the the gradle wrapper?

--
You received this message because you are subscribed to the Google Groups "Realm Java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-java+...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-java/0799fb41-1078-4eee-b784-b1d9062728b4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ben Plant

unread,
Oct 3, 2014, 9:02:05 AM10/3/14
to realm...@googlegroups.com, benpl...@googlemail.com
I'll be honest: I'm not sure. I've been devving for Android for a while, and switched to Android Studio when it became relatively stable because I wanted to see what it was like. Gradle-wise, I've pretty much not touched it, other than Googling how to add the Parse dependency in, and following the tutorial for this. So other than that, any Gradle config should be totally stock and as it comes from a new project in AS.

Does adding things like this in typically need more Gradle fiddling than what was described in the setup on the site?

Emanuele Zattin

unread,
Oct 3, 2014, 9:04:24 AM10/3/14
to Ben Plant, realm...@googlegroups.com
Ok:) From the command line, in the root folder of your project you can try to run:

./gradlew assemble

or if you are on windows:

gradlew.bat assemble

Feel free to paste here the relevant sections of the output

Ben Plant

unread,
Oct 3, 2014, 9:15:42 AM10/3/14
to realm...@googlegroups.com, benpl...@googlemail.com
Incoming wall of text: 


C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000>gradlew
Terminate batch job (Y/N)? y

C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000>gradlew.bat assemble
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareSuperConcierge5000RealmUnspecifiedLibrary UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava
error: The fields of the model must be private
warning: File for type 'io.realm.ValidationList' created in the last round will not be subject to annotation processing.
1 error
1 warning
:app:compileDebugJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJava'.
> 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.084 secs

C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000>

Thank you for that: now the idea of trying it with different flags makes more sense! The failure now seems to be within the 'app' portion of the build, not 'realm', so could it now just be my code being bad? 

Ben Plant

unread,
Oct 3, 2014, 9:18:02 AM10/3/14
to realm...@googlegroups.com, benpl...@googlemail.com
This is with --stacktrace (I thought I'd copied both but no):


C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000>gradlew.bat --stacktrace
:help

Welcome to Gradle 1.12.

To run a build, run gradlew <task> ...

To see a list of available tasks, run gradlew tasks

To see a list of command-line options, run gradlew --help

BUILD SUCCESSFUL

Total time: 4.152 secs
C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000>gradlew.bat assemble --stacktrace
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJava'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.Main.doAction(Main.java:46)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.Main.main(Main.java:37)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
        at org.gradle.api.internal.tasks.compile.jdk6.Jdk6JavaCompiler.execute(Jdk6JavaCompiler.java:47)
        at org.gradle.api.internal.tasks.compile.jdk6.Jdk6JavaCompiler.execute(Jdk6JavaCompiler.java:38)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:96)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:49)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:35)
        at org.gradle.api.internal.tasks.compile.DelegatingJavaCompiler.execute(DelegatingJavaCompiler.java:29)
        at org.gradle.api.internal.tasks.compile.DelegatingJavaCompiler.execute(DelegatingJavaCompiler.java:20)
        at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:33)
        at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:24)
        at org.gradle.api.tasks.compile.Compile.performCompilation(Compile.java:165)
        at org.gradle.api.tasks.compile.Compile.compile(Compile.java:153)
        at org.gradle.api.tasks.compile.Compile.compile(Compile.java:87)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:236)

        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:223)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 46 more


BUILD FAILED

Total time: 5.618 secs

C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000>

Emanuele Zattin

unread,
Oct 3, 2014, 9:23:29 AM10/3/14
to Ben Plant, realm...@googlegroups.com
This looks interesting:

error: The fields of the model must be private

Do you have non-private fields in your model?

Emanuele

Ben Plant

unread,
Oct 3, 2014, 9:26:59 AM10/3/14
to realm...@googlegroups.com, benpl...@googlemail.com
Yeah I saw that too. I did, because I used an existing model and didn't edit it before this problem began. 

I've commented out the changes I made trying to implement Realm and have gone back to how the project was when I started with it. It still won't build, but I now have this:

C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000>gradlew.bat assemble
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareSuperConcierge5000RealmUnspecifiedLibrary UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava
C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000\app\build\generated\source\apt\debug\io\realm\CustomerRealmProxy.java:96: error: method does not override
 or implement a method from a supertype
    @Override
    ^
C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000\app\build\generated\source\apt\debug\io\realm\CustomerRealmProxy.java:101: error: method does not overrid
e or implement a method from a supertype
    @Override
    ^
Note: C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000\app\src\main\java\com\cyanon\superconcierge5000\app\misc\QueueMemberAdapter.java uses unchecked or
unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
:app:compileDebugJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJava'.
> 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: 6.319 secs

C:\Users\benpl_000\CyborgsAnonymous\SuperConcierge5000>

I'm going to go digging in that file and see which method it's unhappy with, but it looks like code generation might have failed to run correctly for this model?

Emanuele Zattin

unread,
Oct 3, 2014, 9:28:41 AM10/3/14
to Ben Plant, realm...@googlegroups.com
That means you don't have the proper getters and setters for the fields in your model :)

Ben Plant

unread,
Oct 3, 2014, 9:37:43 AM10/3/14
to realm...@googlegroups.com, benpl...@googlemail.com
Success!

Aha! I do have them, but the generated code is giving the getter and setter for one particular field a weird name automatically, and therefore it's not overriding mine correctly. I've changed the method names in my code to match the ones that are being generated, and the project builds successfully.

The field is called 'isSatDown', and my getter was called 'isSatDown()'. The generated one was called 'isIsSatDown()', therefore no override. The same was true of the setter, which was called 'setSatDown()' but was being generated as 'setIsSatDown()'. 

Tinkered and fixed. Thanks for your help! And thanks again for the tips around Gradle: I'll have a good look into it because this is an entire side of debugging I've not seen before.

Emanuele Zattin

unread,
Oct 3, 2014, 9:39:10 AM10/3/14
to Ben Plant, realm...@googlegroups.com
Glad I could help! :)

Reply all
Reply to author
Forward
0 new messages