I have a root project, two sub-projects A and B.
I want to write a common configuration of A and B in the root project build.gradle file, but I always get the following error:
Plugin with id ‘com.google.protobuf’ not found.
When I write the same configuration in the A project build.gradle file, the compiler can be passed correctly.
I have been stuck here for a long time, who can help me.
You are using incorrect coordinates for the plugin. It should be com.google.protobuf:protobuf-gradle-plugin:0.8.0. For more information please see the GitHub page of the plugin.
I do not quite understand your answer,
I have already said that when I write the same configuration in the build.gradle file of the subproject A, the compilation can pass normally.
But when I move the configuration to the root project, subprojects{ }, compile error, see the code I gave above.
I’ve learned some usage from the links you gave, but I still have not found the cause of the error.
You can help me find out where the wrong configuration? Thank you.
You can learn about it in the user guide. However, I’d like to mention that we could do a better job in being more detailed about limitation and gotchas.