Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Problem with missing ddmlib method #74

Closed
outlying opened this issue Sep 21, 2015 · 13 comments · Fixed by #81
Closed

Problem with missing ddmlib method #74

outlying opened this issue Sep 21, 2015 · 13 comments · Fixed by #81

Comments

@outlying
Copy link

* What went wrong:
Execution failed for task ':app:spoonProductionDebugAndroidTest'.
> com.android.ddmlib.IDevice.installPackage(Ljava/lang/String;Z[Ljava/lang/String;)Ljava/lang/String;

I'm not really sure what's the problem, but I will leave it here and investigate more in future

@outlying
Copy link
Author

Full stacktrace, problem is with plugin, current Spoon runner is working just fine

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:spoonProductionDebugAndroidTest'.
    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:310)
    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:88)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:90)
    at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:49)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:40)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:71)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.NoSuchMethodError: com.android.ddmlib.IDevice.installPackage(Ljava/lang/String;Z[Ljava/lang/String;)Ljava/lang/String;
    at com.squareup.spoon.SpoonDeviceRunner.run(SpoonDeviceRunner.java:175)
    at com.squareup.spoon.SpoonRunner.runTests(SpoonRunner.java:153)
    at com.squareup.spoon.SpoonRunner.run(SpoonRunner.java:113)
    at com.squareup.spoon.SpoonRunner$run.call(Unknown Source)
    at com.stanfy.spoon.gradle.SpoonRunTask.runSpoon(SpoonRunTask.groovy:166)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:589)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:572)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 57 more

@roman-mazur
Copy link
Contributor

Do you run it with #73 ?
The problem is that gradle plugin dependency update could bring a newer version of ddm lib that is not compatible with one used to build spoon runner...

@outlying
Copy link
Author

Same problem even if I use newer dependencies

@ligi
Copy link
Contributor

ligi commented Oct 4, 2015

for me this is working:

index 00cd7b1..0d1d0c3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,6 +7,7 @@ buildscript {
     dependencies {
         classpath 'com.android.tools.build:gradle:1.4.0-beta5'
         classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
+        classpath 'com.squareup.spoon:spoon-runner:1.2.0'
         classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.3') {
             exclude module: "guava"
         }

but would be great to see a released 1.0.4 with #73 included

ligi added a commit to ligi/PassAndroid that referenced this issue Oct 18, 2015
@outlying
Copy link
Author

For me it's still not working, something is bogus here, with my project is still not working

https://github.com/SmokSmog/smoksmog-android
branch 'StanfySpoonIssue'

@svenjacobs
Copy link

We have the same issue with com.android.tools.build:gradle:1.4.0-beta6. A new release of the plugin would be greatly appreciated.

@mbenci
Copy link

mbenci commented Oct 28, 2015

Same issue also for me.

@mandrachek
Copy link

Running spoon-runner with dependencies from the command line works. Running connectedAndroidTest works.

Not sure why this fails. I've tried 1.0.4-SNAPSHOT, as well as updating spoon to 1.2.1-SNAPSHOT, and the gradle plugin dependency to match my project, and still no go. The ddmlib version on spoon was compiling against was old, so I tried updating that to the latest in maven central, but it didn't help.

Could it be because the method signature for installPackage() has changed? https://android.googlesource.com/platform/tools/base/+/master/ddmlib/src/main/java/com/android/ddmlib/IDevice.java vs http://grepcode.com/file/repo1.maven.org/maven2/com.google.android.tools/ddmlib/r10/com/android/ddmlib/IDevice.java#IDevice.installPackage%28java.lang.String%2Cboolean%29

@roman-mazur
Copy link
Contributor

Yes, this is because of this signature change.
You can run spoon runner from command line because it has nothing to do
with gradle android plugin which has a dep on newer ddmlib version.
connectedAndroidTest also works because spoon-related is obviously not
invoked.
But when you try to run a spoon task, you get to a state when newer ddmlib
is in the classpath (because android plugin requests it), and spoon runner
cannot invoke installPackage.

Hence, the solution would to update spoon runner, make it use newer ddmlib,
than use this new spoon runner version.

On Wed, 11 Nov 2015 at 20:13 Mark Andrachek notifications@github.com
wrote:

Running spoon-runner with dependencies from the command line works.
Running connectedAndroidTest works.

Not sure why this fails. I've tried 1.0.4-SNAPSHOT, as well as updating
spoon to 1.2.1-SNAPSHOT, and the gradle plugin dependency to match my
project, and still no go. The ddmlib version on spoon was compiling against
was old, so I tried updating that to the latest in maven central, but it
didn't help.

Could it be because the method signature for installPackage() has changed?
https://android.googlesource.com/platform/tools/base/+/master/ddmlib/src/main/java/com/android/ddmlib/IDevice.java
vs
http://grepcode.com/file/repo1.maven.org/maven2/com.google.android.tools/ddmlib/r10/com/android/ddmlib/IDevice.java#IDevice.installPackage%28java.lang.String%2Cboolean%29


Reply to this email directly or view it on GitHub
#74 (comment)
.

@mandrachek
Copy link

@roman-mazur I just tried building spoon using a locally installed copy of ddmlib.jar which I pulled from tools folder (and which I verified has the 3 parameter version of the method) and then rebuilt 1.0.4-SNAPSHOT with the newer version. Everything compiles just fine, but I still get the same exception.

I even changed the spoon-runner's installPackage() calls to pass null as the 3rd argument, and I still get the NoSuchMethodError.

Very strange.

Hopefully we get a new stable gradle plugin in the not too distant future. (I'm using 1.5.0-beta1)

@roman-mazur
Copy link
Contributor

And are sure the new spoon version is used when you run from gradle?

On Wed, 11 Nov 2015 at 22:38 Mark Andrachek notifications@github.com
wrote:

@roman-mazur https://github.com/roman-mazur I just tried building spoon
using a locally installed copy of ddmlib.jar which I pulled from tools
folder (and which I verified has the 3 parameter version of the method) and
then rebuilt 1.0.4-SNAPSHOT with the newer version. Everything compiles
just fine, but I still get the same exception.

I even changed the spoon-runner's installPackage() calls to pass null as
the 3rd argument, and I still get the NoSuchMethodError.

Very strange.


Reply to this email directly or view it on GitHub
#74 (comment)
.

@mandrachek
Copy link

  • I did a clean of both spoon and the plugin.
  • I removed all copies of spoon and the plugin from my local maven repository.
  • I built and installed spoon-runner:1.2.1-SNAPSHOT, referencing the new version of ddmlib in the pom.xml.
  • I built and installed the plugin (1.0.4-SNAPSHOT), after updating the dependency to spoon in the plugin's build.gradle to 1.2.1-SNAPSHOT, with --refresh-dependencies.
  • I have no references to spoon directly in my app's build.gradle, apart from the classpath to the plugin, which is referencing the 1.0.4-SNAPSHOT, and I also did a clean with --refresh-dependencies.

If it's using any other version of spoon... I don't know where it would be coming from.

@ligi
Copy link
Contributor

ligi commented Nov 14, 2015

the build-plugin 1.5.0 is now out - unfortunately I get this error when using it - even with com.squareup.spoon:spoon-runner:1.2.0 included ( which fixed this problem for me with build-plugin 1.3.1 )

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants