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

I can't build the app #6

Closed
Macarse opened this Issue Jan 25, 2014 · 2 comments

Comments

2 participants
@Macarse

Macarse commented Jan 25, 2014

@JakeWharton:

I just tried building the project and failed.

Running gradle:

10:05:52.806 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
10:05:52.807 [ERROR] [org.gradle.BuildExceptionReporter] 
10:05:52.807 [ERROR] [org.gradle.BuildExceptionReporter] * Where:
10:05:52.807 [ERROR] [org.gradle.BuildExceptionReporter] Build file '/Users/csessa/Documents/u2020/build.gradle' line: 17
10:05:52.808 [ERROR] [org.gradle.BuildExceptionReporter] 
10:05:52.808 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
10:05:52.809 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred evaluating root project 'u2020'.
10:05:52.809 [ERROR] [org.gradle.BuildExceptionReporter] > Could not create plugin of type 'AppPlugin'.
10:05:52.812 [ERROR] [org.gradle.BuildExceptionReporter] 
10:05:52.812 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
10:05:52.813 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'u2020'.
10:05:52.814 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
10:05:52.814 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:132)
10:05:52.815 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
10:05:52.815 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
10:05:52.816 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
10:05:52.816 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
10:05:52.817 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:507)
10:05:52.818 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:82)
10:05:52.818 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
10:05:52.819 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
10:05:52.819 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
10:05:52.820 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
10:05:52.821 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
10:05:52.821 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
10:05:52.822 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
10:05:52.822 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
10:05:52.823 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
10:05:52.823 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
10:05:52.824 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
10:05:52.825 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
10:05:52.825 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
10:05:52.826 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
10:05:52.827 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
10:05:52.827 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
10:05:52.828 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
10:05:52.828 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.Main.doAction(Main.java:46)
10:05:52.829 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
10:05:52.829 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.Main.main(Main.java:37)
10:05:52.830 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
10:05:52.830 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
10:05:52.831 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
10:05:52.831 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'AppPlugin'.
10:05:52.832 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:61)
10:05:52.832 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:103)
10:05:52.832 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68)
10:05:52.833 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
10:05:52.834 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
10:05:52.835 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
10:05:52.836 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
10:05:52.837 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
10:05:52.838 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:39)
10:05:52.839 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.Project$apply.call(Unknown Source)
10:05:52.839 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
10:05:52.840 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.Script$apply.callCurrent(Unknown Source)
10:05:52.841 [ERROR] [org.gradle.BuildExceptionReporter]    at build_500n45a0386fgftenmqsfsk4gs.run(/Users/csessa/Documents/u2020/build.gradle:17)
10:05:52.842 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
10:05:52.842 [ERROR] [org.gradle.BuildExceptionReporter]    ... 30 more
10:05:52.843 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NoClassDefFoundError: org/gradle/api/artifacts/result/ResolvedComponentResult
10:05:52.844 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.AppPlugin.$getStaticMetaClass(AppPlugin.groovy)
10:05:52.845 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.BasePlugin.<init>(BasePlugin.groovy:1712)
10:05:52.846 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.AppPlugin.<init>(AppPlugin.groovy:73)
10:05:52.846 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:62)
10:05:52.847 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:59)
10:05:52.848 [ERROR] [org.gradle.BuildExceptionReporter]    ... 43 more
10:05:52.849 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.ClassNotFoundException: org.gradle.api.artifacts.result.ResolvedComponentResult
10:05:52.849 [ERROR] [org.gradle.BuildExceptionReporter]    ... 48 more

There is an android issue for this: https://code.google.com/p/android/issues/detail?id=65155

To go around this, I downgraded com.android.tools.build:gradle to 0.7.+

Now I get:

Caused by: org.gradle.api.internal.MissingMethodException: Could not find method provided() for arguments [com.squareup.dagger:dagger-compiler:1.2.0] on root project 'u2020'.

Following http://blog.codeaholics.org/2012/emulating-mavens-provided-scope-in-gradle/ I added:

configurations {
    provided
}

sourceSets {
    main.compileClasspath += configurations.provided
    test.compileClasspath += configurations.provided
    test.runtimeClasspath += configurations.provided
}

This makes the app build but I get this error when I run the app:

E/AndroidRuntime(10390): java.lang.RuntimeException: Unable to create application com.jakewharton.u2020.U2020App: java.lang.IllegalStateException: Module adapter for class com.jakewharton.u2020.U2020Module could not be loaded. Please ensure that code generation was run for this module.
E/AndroidRuntime(10390):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4347)
E/AndroidRuntime(10390):    at android.app.ActivityThread.access$1500(ActivityThread.java:135)
E/AndroidRuntime(10390):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime(10390):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10390):    at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(10390):    at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime(10390):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(10390):    at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(10390):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime(10390):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime(10390):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(10390): Caused by: java.lang.IllegalStateException: Module adapter for class com.jakewharton.u2020.U2020Module could not be loaded. Please ensure that code generation was run for this module.

Where should the provided come from rather than configurations {}?

I am using:

  • java version "1.7.0_51"
  • Gradle 1.9
@JakeWharton

This comment has been minimized.

Show comment
Hide comment
@JakeWharton

JakeWharton Jan 25, 2014

Owner

Use the Gradle wrapper in the repo. 1.10 is required.
On Jan 25, 2014 10:10 AM, "Carlos Sessa" notifications@github.com wrote:

@JakeWharton https://github.com/JakeWharton:

I just tried building the project and failed.

Running gradle:

10:05:52.806 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
10:05:52.807 [ERROR] [org.gradle.BuildExceptionReporter]
10:05:52.807 [ERROR] [org.gradle.BuildExceptionReporter] * Where:
10:05:52.807 [ERROR] [org.gradle.BuildExceptionReporter] Build file '/Users/csessa/Documents/u2020/build.gradle' line: 17
10:05:52.808 [ERROR] [org.gradle.BuildExceptionReporter]
10:05:52.808 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
10:05:52.809 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred evaluating root project 'u2020'.
10:05:52.809 [ERROR] [org.gradle.BuildExceptionReporter] > Could not create plugin of type 'AppPlugin'.
10:05:52.812 [ERROR] [org.gradle.BuildExceptionReporter]
10:05:52.812 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
10:05:52.813 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'u2020'.
10:05:52.814 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
10:05:52.814 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:132)
10:05:52.815 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
10:05:52.815 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
10:05:52.816 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
10:05:52.816 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
10:05:52.817 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:507)
10:05:52.818 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:82)
10:05:52.818 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
10:05:52.819 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
10:05:52.819 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
10:05:52.820 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
10:05:52.821 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
10:05:52.821 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
10:05:52.822 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
10:05:52.822 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
10:05:52.823 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
10:05:52.823 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
10:05:52.824 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
10:05:52.825 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
10:05:52.825 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
10:05:52.826 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
10:05:52.827 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
10:05:52.827 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
10:05:52.828 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
10:05:52.828 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:46)
10:05:52.829 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
10:05:52.829 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.main(Main.java:37)
10:05:52.830 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
10:05:52.830 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
10:05:52.831 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
10:05:52.831 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'AppPlugin'.
10:05:52.832 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:61)
10:05:52.832 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:103)
10:05:52.832 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68)
10:05:52.833 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
10:05:52.834 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
10:05:52.835 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
10:05:52.836 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
10:05:52.837 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
10:05:52.838 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:39)
10:05:52.839 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.Project$apply.call(Unknown Source)
10:05:52.839 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
10:05:52.840 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.Script$apply.callCurrent(Unknown Source)
10:05:52.841 [ERROR] [org.gradle.BuildExceptionReporter] at build_500n45a0386fgftenmqsfsk4gs.run(/Users/csessa/Documents/u2020/build.gradle:17)
10:05:52.842 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
10:05:52.842 [ERROR] [org.gradle.BuildExceptionReporter] ... 30 more
10:05:52.843 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NoClassDefFoundError: org/gradle/api/artifacts/result/ResolvedComponentResult
10:05:52.844 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.AppPlugin.$getStaticMetaClass(AppPlugin.groovy)
10:05:52.845 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.BasePlugin.(BasePlugin.groovy:1712)
10:05:52.846 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.AppPlugin.(AppPlugin.groovy:73)
10:05:52.846 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:62)
10:05:52.847 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:59)
10:05:52.848 [ERROR] [org.gradle.BuildExceptionReporter] ... 43 more
10:05:52.849 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.ClassNotFoundException: org.gradle.api.artifacts.result.ResolvedComponentResult
10:05:52.849 [ERROR] [org.gradle.BuildExceptionReporter] ... 48 more

There is an android issue for this:
https://code.google.com/p/android/issues/detail?id=65155

To go around this, I downgraded com.android.tools.build:gradle to 0.7.+

Now I get:

Caused by: org.gradle.api.internal.MissingMethodException: Could not find method provided() for arguments [com.squareup.dagger:dagger-compiler:1.2.0] on root project 'u2020'.

Following
http://blog.codeaholics.org/2012/emulating-mavens-provided-scope-in-gradle/I added:

configurations {
provided
}

sourceSets {
main.compileClasspath += configurations.provided
test.compileClasspath += configurations.provided
test.runtimeClasspath += configurations.provided
}

This makes the app build but I get this error when I run the app:

E/AndroidRuntime(10390): java.lang.RuntimeException: Unable to create application com.jakewharton.u2020.U2020App: java.lang.IllegalStateException: Module adapter for class com.jakewharton.u2020.U2020Module could not be loaded. Please ensure that code generation was run for this module.
E/AndroidRuntime(10390): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4347)
E/AndroidRuntime(10390): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
E/AndroidRuntime(10390): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime(10390): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10390): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(10390): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime(10390): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(10390): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(10390): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime(10390): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime(10390): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(10390): Caused by: java.lang.IllegalStateException: Module adapter for class com.jakewharton.u2020.U2020Module could not be loaded. Please ensure that code generation was run for this module.

I am using:

  • java version "1.7.0_51"
  • Gradle 1.9

Reply to this email directly or view it on GitHubhttps://github.com//issues/6
.

Owner

JakeWharton commented Jan 25, 2014

Use the Gradle wrapper in the repo. 1.10 is required.
On Jan 25, 2014 10:10 AM, "Carlos Sessa" notifications@github.com wrote:

@JakeWharton https://github.com/JakeWharton:

I just tried building the project and failed.

Running gradle:

10:05:52.806 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
10:05:52.807 [ERROR] [org.gradle.BuildExceptionReporter]
10:05:52.807 [ERROR] [org.gradle.BuildExceptionReporter] * Where:
10:05:52.807 [ERROR] [org.gradle.BuildExceptionReporter] Build file '/Users/csessa/Documents/u2020/build.gradle' line: 17
10:05:52.808 [ERROR] [org.gradle.BuildExceptionReporter]
10:05:52.808 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
10:05:52.809 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred evaluating root project 'u2020'.
10:05:52.809 [ERROR] [org.gradle.BuildExceptionReporter] > Could not create plugin of type 'AppPlugin'.
10:05:52.812 [ERROR] [org.gradle.BuildExceptionReporter]
10:05:52.812 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
10:05:52.813 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'u2020'.
10:05:52.814 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
10:05:52.814 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:132)
10:05:52.815 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
10:05:52.815 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
10:05:52.816 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
10:05:52.816 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
10:05:52.817 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:507)
10:05:52.818 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:82)
10:05:52.818 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
10:05:52.819 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
10:05:52.819 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
10:05:52.820 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
10:05:52.821 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
10:05:52.821 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
10:05:52.822 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
10:05:52.822 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
10:05:52.823 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
10:05:52.823 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
10:05:52.824 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
10:05:52.825 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
10:05:52.825 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
10:05:52.826 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
10:05:52.827 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
10:05:52.827 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
10:05:52.828 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
10:05:52.828 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:46)
10:05:52.829 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
10:05:52.829 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.main(Main.java:37)
10:05:52.830 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
10:05:52.830 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
10:05:52.831 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
10:05:52.831 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'AppPlugin'.
10:05:52.832 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:61)
10:05:52.832 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:103)
10:05:52.832 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68)
10:05:52.833 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
10:05:52.834 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
10:05:52.835 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
10:05:52.836 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
10:05:52.837 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
10:05:52.838 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:39)
10:05:52.839 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.Project$apply.call(Unknown Source)
10:05:52.839 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
10:05:52.840 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.Script$apply.callCurrent(Unknown Source)
10:05:52.841 [ERROR] [org.gradle.BuildExceptionReporter] at build_500n45a0386fgftenmqsfsk4gs.run(/Users/csessa/Documents/u2020/build.gradle:17)
10:05:52.842 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
10:05:52.842 [ERROR] [org.gradle.BuildExceptionReporter] ... 30 more
10:05:52.843 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NoClassDefFoundError: org/gradle/api/artifacts/result/ResolvedComponentResult
10:05:52.844 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.AppPlugin.$getStaticMetaClass(AppPlugin.groovy)
10:05:52.845 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.BasePlugin.(BasePlugin.groovy:1712)
10:05:52.846 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.AppPlugin.(AppPlugin.groovy:73)
10:05:52.846 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:62)
10:05:52.847 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:59)
10:05:52.848 [ERROR] [org.gradle.BuildExceptionReporter] ... 43 more
10:05:52.849 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.ClassNotFoundException: org.gradle.api.artifacts.result.ResolvedComponentResult
10:05:52.849 [ERROR] [org.gradle.BuildExceptionReporter] ... 48 more

There is an android issue for this:
https://code.google.com/p/android/issues/detail?id=65155

To go around this, I downgraded com.android.tools.build:gradle to 0.7.+

Now I get:

Caused by: org.gradle.api.internal.MissingMethodException: Could not find method provided() for arguments [com.squareup.dagger:dagger-compiler:1.2.0] on root project 'u2020'.

Following
http://blog.codeaholics.org/2012/emulating-mavens-provided-scope-in-gradle/I added:

configurations {
provided
}

sourceSets {
main.compileClasspath += configurations.provided
test.compileClasspath += configurations.provided
test.runtimeClasspath += configurations.provided
}

This makes the app build but I get this error when I run the app:

E/AndroidRuntime(10390): java.lang.RuntimeException: Unable to create application com.jakewharton.u2020.U2020App: java.lang.IllegalStateException: Module adapter for class com.jakewharton.u2020.U2020Module could not be loaded. Please ensure that code generation was run for this module.
E/AndroidRuntime(10390): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4347)
E/AndroidRuntime(10390): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
E/AndroidRuntime(10390): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime(10390): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10390): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(10390): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime(10390): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(10390): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(10390): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime(10390): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime(10390): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(10390): Caused by: java.lang.IllegalStateException: Module adapter for class com.jakewharton.u2020.U2020Module could not be loaded. Please ensure that code generation was run for this module.

I am using:

  • java version "1.7.0_51"
  • Gradle 1.9

Reply to this email directly or view it on GitHubhttps://github.com//issues/6
.

@Macarse

This comment has been minimized.

Show comment
Hide comment
@Macarse

Macarse Jan 25, 2014

Cool. fixed!

Macarse commented Jan 25, 2014

Cool. fixed!

@Macarse Macarse closed this Jan 25, 2014

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