Skip to content

Gradle 5.0 Depreciated API features #253

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

Closed
tjoneslo opened this issue Jul 24, 2018 · 16 comments
Closed

Gradle 5.0 Depreciated API features #253

tjoneslo opened this issue Jul 24, 2018 · 16 comments
Assignees
Labels
bug gradle compatibility Compatibility issues with Gradle

Comments

@tjoneslo
Copy link

A problem was found with the configuration of task '<task>'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0
 - Directory '/Users/tjoneslo/Documents/workspace/<project>/.out/extracted-include-protos/main' specified for property '$3' does not exist.

I get this warning using Gradle 4.6 and protobug-gradle-plugin 0.8.6

@zhangkun83
Copy link
Collaborator

Can you provide a demo project for us to easily reproduce this issue?

@davidkraus
Copy link

same/similar issue:

* What went wrong:
A problem was found with the configuration of task ':app:generateDebugProto'.
> Directory '/Users/admin/LocalProjects/MyApplication/app/build/extracted-include-protos/main' specified for property '$3' does not exist.

Details:

  • Android Project (com.android.tools.build:gradle:3.4.0-alpha04) with kotlin-android and kotlin-android-extensions plugins
  • Gradle 5.0-milestone-1

attached a sample project

MyApplication.zip

@Zhuinden
Copy link

Zhuinden commented Nov 28, 2018

I just wanted to chime in and say we're also getting this warning, and with Gradle 5.0 being released that's a problem.

But I'm not sure how to get more info out of Gradle 😄

@zhangkun83 zhangkun83 added the gradle compatibility Compatibility issues with Gradle label Dec 13, 2018
@bubenheimer
Copy link

I am seeing a similar-looking issue with Gradle 5.0 and protobuf-gradle-plugin 0.8.7. It is a build error, not a warning, and it is a blocker for me. I need to upgrade to Gradle 5.0 to upgrade to errorprone-gradle-plugin 0.6 to upgrade to Dagger 2.20. It looks like this issue has been around for a while and I hope it can be prioritized.

Here's my build output; the various directories correspond to Android productFlavors composing a build variant; I don't think there should be separate directories for these, the only directory needed is extracted-include-protos/fastNocheckLocalDebug, and I see that this directory is indeed created, while the others are not:

Some problems were found with the configuration of task ':app_grpcclient:generateFastNocheckLocalDebugProto'.
> Directory '/Users/uli/Developer/Android/production/Rucksack/app_grpcclient/build/extracted-include-protos/main' specified for property '$3' does not exist.
> Directory '/Users/uli/Developer/Android/production/Rucksack/app_grpcclient/build/extracted-include-protos/local' specified for property '$6' does not exist.
> Directory '/Users/uli/Developer/Android/production/Rucksack/app_grpcclient/build/extracted-include-protos/nocheck' specified for property '$9' does not exist.
> Directory '/Users/uli/Developer/Android/production/Rucksack/app_grpcclient/build/extracted-include-protos/fast' specified for property '$12' does not exist.
> Directory '/Users/uli/Developer/Android/production/Rucksack/app_grpcclient/build/extracted-include-protos/fastNocheckLocal' specified for property '$15' does not exist.

@zhangkun83
Copy link
Collaborator

Sorry about the slow response. I have just upgraded the build to Gradle 5.0 (#286) and I am working on adding Gradle 5.0 to the tests. While this particular issue is seemingly straightforward to fix, the tests just start to have various failures with the new Gradle version -- probably not due to bugs of the plugin, but due to the way the tests are written and the way dependencies are wired up. It will take some time to clean things up.

@xapienz
Copy link

xapienz commented Jan 2, 2019

Also facing same problem with Gradle 5.0/5.1.
Workaround to unblock this is to manually create those missing dirs (and add creation of directories somewhere into your own build scripts, so it will work in a clean project), and build finishes successfully.

@bubenheimer
Copy link

Problem persists with Gradle 5.1 and Android Gradle Plugin 3.4.0-alpha10 (latest preview)

@zhangkun83
Copy link
Collaborator

The issue is not an compatibility issue, but rather a functionality issue with Android plugin >= 2.5. The error from Gradle just makes it more obvious. #287 should fix it, and you can find explanation about this issue on that PR. Can any of you check it out, install it locally (./gradlew install -x test) and verify that it works in your project?

@zhangkun83 zhangkun83 added the bug label Jan 4, 2019
@zhangkun83 zhangkun83 self-assigned this Jan 4, 2019
@xapienz
Copy link

xapienz commented Jan 4, 2019

@zhangkun83 Worked for me, thank you!

@gxshao
Copy link

gxshao commented Jan 9, 2019

Facing the same problem. And the build.gradle was worked in version 4.6. Now, my gradle version is 5.1...Is that compatibility problem?

Directory ' XXX ' specified for property '$3' does not exist.

@Zhuinden
Copy link

Zhuinden commented Jan 9, 2019

you need to use the protobuf plugin in this PR: #287

@gxshao
Copy link

gxshao commented Jan 9, 2019

@Zhuinden

Thanks for reply.

I decide to use version 4.10.3 finally. But i wanna make sure it's gonna work for NESTED build right?

zhangkun83 added a commit that referenced this issue Jan 10, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…dle 3.0 in tests. (#287)

- `gradle/wrapper/gradle-wrapper.properties`: the Protobuf plugin is now built with Gradle 5.1
-  `ProtobufPlugin.groovy`: fixed a bug where GenerateProtoTask may "include" the wrong directory when running with Android plugin >= 2.5.
   - The bug: `addGenerateProtoTask()` always use the directory per *sourceSet* as input (original line 328), but with Android plugin >= 2.5, the extract task writes to the directory per *variant* (original line 272), thus they don't match. The GenerateProtoTask ends up using a nonexistent directory as an input. We didn't catch it in tests because the integration tests were only run with Android plugin up to 2.3. However, Gradle produced a warning about missing input directory, which becomes an error on Gradle 5.0 (#253). Adding Gradle 5.1 and Android 3.1.0 to the test reproduces this bug.
   - The fix refactored the file and moved the assigning of inputs closer to where the extract task is created.  This makes sure the input of the generate task matches the output of the extract task.
- Updated tests
  - Added Gradle 5.1/Android 3.1.0 to tests, and removed Gradle 2.14.1 the oldest version on the tested list, raising the minimum supported version to Gradle 3.0. Removed code paths dedicated to Gradle <3.0.
    - Gradle 3.0/Android 2.2.0 is commented out from the list because of gradle/gradle#8158. I have verified this pair passes the tests if it's the only one in the list, presumably bypassing the Gradle issue.
@Zhuinden
Copy link

I see that #287 was merged, is there a release scheduled for 0.8.8? ❤️

@zhangkun83
Copy link
Collaborator

0.8.8 is now released.

@douruanliang
Copy link

I have the same problem ,Android studio 3.4.1 gradle 5.1.1 ,proto setup
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0'
}
plugins {
javalite {
artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
}
task.plugins {
javalite { }
}
}
}

@Zhuinden
Copy link

Zhuinden commented Jun 5, 2019

@douruanliang const val protobuf_gradle_plugin: String = "0.8.8" ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug gradle compatibility Compatibility issues with Gradle
Projects
None yet
Development

No branches or pull requests

8 participants