Skip to content
New issue

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

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

Already on GitHub? # to your account

Not compatible with Gradle 7.0 #97

Closed
ZakTaccardi opened this issue May 27, 2021 · 13 comments · Fixed by #106
Closed

Not compatible with Gradle 7.0 #97

ZakTaccardi opened this issue May 27, 2021 · 13 comments · Fixed by #106

Comments

@ZakTaccardi
Copy link

ZakTaccardi commented May 27, 2021

Make compatible with Gradle 7.0

Seeing:

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task 'lib:spoonDebugAndroidTest' (type 'SpoonTask').
  - Type 'com.jaredsburrows.spoon.SpoonTask' property 'applicationApk' is missing an input or output annotation.
    
    Reason: A property without annotation isn't considered during up-to-date checking.
    
    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.
    
    Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#missing_annotation for more details about this problem.

As applicationApk is already marked with @Internal - maybe it needs to be marked with @get:Internal due to it being a lateinit?

@Internal lateinit var extension: SpoonExtension
/** Application APK (eg. app-debug.apk). */
@Internal lateinit var applicationApk: File
/** Instrumentation APK (eg. app-debug-androidTest.apk). */
@Internal lateinit var instrumentationApk: File

@ZakTaccardi
Copy link
Author

Note - I'm using 1.5.1

@ZakTaccardi
Copy link
Author

note: I solved this internally by forking the code in master and adding it into our buildSrc.

b9f5afa

This is strange because it should be near identical to 1.5.1. I didn't need to make any code changes. I think this is one of those things where there is a slight difference between building from source and from the artifact in mavenCentral(). I'd still guess that @get:Internal could be the fix, though I didn't need to add it when building from source

@jaredsburrows
Copy link
Owner

Should we add it back?

@ZakTaccardi
Copy link
Author

The larger issue is that marking these inputs as @Internal is incorrect.

#98
#92 (comment)

They affect whether the SpoonTask should execute or not.

@ZakTaccardi
Copy link
Author

ZakTaccardi commented Jun 4, 2021

Should we add it back?

If you are referring to #98 - then I would argue yes

@pavanagarwal
Copy link

We are seeing same issue on our project when we tried upgrading Android Gradle plugin to 7.0. Any updates or plans on fixing this?

@jaredsburrows
Copy link
Owner

Yes. Just hoping update with the Jcenter updates as well.

@mattinger
Copy link

There's also issues on top of this due to the use of ddmlib which has changed certainly with build tools 30.

Caused by: java.lang.NoSuchMethodError: com.android.ddmlib.logcat.LogCatMessage.getTimestamp()Lcom/android/ddmlib/logcat/LogCatTimestamp;
        at com.squareup.spoon.html.HtmlLog$LogEntry.from(HtmlLog.java:68)
        at com.squareup.spoon.html.HtmlLog.from(HtmlLog.java:36)
        at com.squareup.spoon.html.HtmlRenderer.generateLogHtml(HtmlRenderer.java:145)
        at com.squareup.spoon.html.HtmlRenderer.render(HtmlRenderer.java:63)

This is an issue with spoon itself, which it seems isn't getting very much in the way of updates. They haven't put out a release in a long time, and has seen 2 commits in 3 years.

@mattinger
Copy link

@jaredsburrows Are there any planned workarounds to spoon itself and ddmlib issues i mentioned? I'm not sure what could even be done, but i'm curious about your thoughts on it.

@ZakTaccardi
Copy link
Author

@mattinger did you find any workarounds to the NoSuchMethodError or is it time to abandon Spoon?

note: created relevant Spoon issue here square/spoon#583

@mattinger
Copy link

@ZakTaccardi We abandoned spoon and migrated to Marathon

@rajvinodh
Copy link

After updating the plugin to 1.5.1 version. I had same issue. Even though adding clean with gradle command worked for me, it was time taking.

Instead deleting spoon-output folder before running gradle command solved my problem.

Note - spoon-output is present in build folder. Also spoon-output is not the custom directory that we give in spoon.gradle.

This folder is created by spoon plugin itself, need to debug the reason for this.

@jaredsburrows
Copy link
Owner

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants