actions-on-google / smart-home-dashboard

Apache License 2.0
73 stars 27 forks source link

Compile feilure - device.proto: File not found #17

Closed thgbarros closed 5 years ago

thgbarros commented 5 years ago

I am trying to setup following instructions and I get errors on mvn compile package.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.google.homegraph:dashboard:jar:0.1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.googlecode.objectify:objectify:jar -> duplicate declaration of version 5.1.22 @ line 157, column 15
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-war-plugin @ line 298, column 13
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 4.15
[INFO] os.detected.version.major: 4
[INFO] os.detected.version.minor: 15
[INFO] os.detected.release: ubuntu
[INFO] os.detected.release.version: 18.04
[INFO] os.detected.release.like.ubuntu: true
[INFO] os.detected.release.like.debian: true
[INFO] os.detected.classifier: linux-x86_64
[WARNING] The project com.google.homegraph:dashboard:jar:0.1.0-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building dashboard 0.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ dashboard ---
[INFO] Deleting /home/barros/Documents/smart-home-dashboard/target
[INFO] 
[INFO] --- protobuf-maven-plugin:0.5.0:compile (default) @ dashboard ---
[INFO] Compiling 4 proto file(s) to /home/barros/Documents/smart-home-dashboard/target/generated-sources/protobuf/java
[ERROR] PROTOC FAILED: google/home/graph/v1/device.proto: File not found.
homegraph.proto: Import "google/home/graph/v1/device.proto" was not found or had errors.
homegraph.proto:348:12: "google.home.graph.v1.Device" seems to be defined in "device.proto", which is not imported by "homegraph.proto".  To use it here, please add the necessary import.

[ERROR] /home/barros/Documents/smart-home-dashboard/src/main/proto/device.proto [0:0]: google/home/graph/v1/device.proto: File not found.
homegraph.proto: Import "google/home/graph/v1/device.proto" was not found or had errors.
homegraph.proto:348:12: "google.home.graph.v1.Device" seems to be defined in "device.proto", which is not imported by "homegraph.proto".  To use it here, please add the necessary import.

[ERROR] /home/barros/Documents/smart-home-dashboard/src/main/proto/homegraph.proto [0:0]: google/home/graph/v1/device.proto: File not found.
homegraph.proto: Import "google/home/graph/v1/device.proto" was not found or had errors.
homegraph.proto:348:12: "google.home.graph.v1.Device" seems to be defined in "device.proto", which is not imported by "homegraph.proto".  To use it here, please add the necessary import.

[ERROR] /home/barros/Documents/smart-home-dashboard/src/main/proto/google/api/http.proto [0:0]: google/home/graph/v1/device.proto: File not found.
homegraph.proto: Import "google/home/graph/v1/device.proto" was not found or had errors.
homegraph.proto:348:12: "google.home.graph.v1.Device" seems to be defined in "device.proto", which is not imported by "homegraph.proto".  To use it here, please add the necessary import.

[ERROR] /home/barros/Documents/smart-home-dashboard/src/main/proto/google/api/annotations.proto [0:0]: google/home/graph/v1/device.proto: File not found.
homegraph.proto: Import "google/home/graph/v1/device.proto" was not found or had errors.
homegraph.proto:348:12: "google.home.graph.v1.Device" seems to be defined in "device.proto", which is not imported by "homegraph.proto".  To use it here, please add the necessary import.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.503 s
[INFO] Finished at: 2019-01-23T14:17:56-02:00
[INFO] Final Memory: 18M/43M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.5.0:compile (default) on project dashboard: protoc did not exit cleanly. Review output for more information. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Proto files.

barros@barros-vm:~/Documents/smart-home-dashboard$ find src/main/proto/
src/main/proto/
src/main/proto/device.proto
src/main/proto/homegraph_gapic.yaml
src/main/proto/homegraph.proto
src/main/proto/google
src/main/proto/google/api
src/main/proto/google/api/http.proto
src/main/proto/google/api/annotations.proto
Fleker commented 5 years ago

Can you place the device.proto and homegraph.proto to the applicable directory structure src/main/proto/google/home/graph/v1?

thgbarros commented 5 years ago

I thought that these files were to stay in src/main/proto.

Now I have a new failure:

scenario@barros:~/Documents/smart-home-dashboard$ mvn clean package
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.google.homegraph:dashboard:war:0.1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.googlecode.objectify:objectify:jar -> duplicate declaration of version 5.1.22 @ line 165, column 15
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-war-plugin @ line 306, column 13
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 4.18
[INFO] os.detected.version.major: 4
[INFO] os.detected.version.minor: 18
[INFO] os.detected.release: debian
[INFO] os.detected.release.like.debian: true
[INFO] os.detected.classifier: linux-x86_64
[WARNING] The project com.google.homegraph:dashboard:war:0.1.0-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO] 
[INFO] -------------------< com.google.homegraph:dashboard >-------------------
[INFO] Building dashboard 0.1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ dashboard ---
[INFO] Deleting /home/scenario/Documents/smart-home-dashboard/target
[INFO] 
[INFO] --- protobuf-maven-plugin:0.5.0:compile (default) @ dashboard ---
[INFO] Compiling 4 proto file(s) to /home/scenario/Documents/smart-home-dashboard/target/generated-sources/protobuf/java
[INFO] 
[INFO] --- protobuf-maven-plugin:0.5.0:compile-custom (default) @ dashboard ---
[INFO] Compiling 4 proto file(s) to /home/scenario/Documents/smart-home-dashboard/target/generated-sources/protobuf/grpc-java
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dashboard ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 4 resources
[INFO] Copying 4 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ dashboard ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 29 source files to /home/scenario/Documents/smart-home-dashboard/target/dashboard-0.1.0-SNAPSHOT/WEB-INF/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING : 
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 8
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/home/graph/v1/HomeGraphApiServiceGrpc.java:[29,14] duplicate class: com.google.home.graph.v1.HomeGraphApiServiceGrpc
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/home/graph/v1/DeviceProto.java:[22,14] duplicate class: com.google.home.graph.v1.DeviceProto
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/HttpRule.java:[202,15] duplicate class: com.google.api.HttpRule
[ERROR] /home/scenario/Documents/smart-home-dashboard/target/generated-sources/protobuf/java/com/google/api/HttpProto.java:[6,14] duplicate class: com.google.api.HttpProto
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/CustomHttpPatternOrBuilder.java:[22,8] duplicate class: com.google.api.CustomHttpPatternOrBuilder
[ERROR] /home/scenario/Documents/smart-home-dashboard/target/generated-sources/protobuf/java/com/google/home/graph/v1/HomeGraphApiServiceProto.java:[6,14] duplicate class: com.google.home.graph.v1.HomeGraphApiServiceProto
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/CustomHttpPattern.java:[29,15] duplicate class: com.google.api.CustomHttpPattern
[ERROR] /home/scenario/Documents/smart-home-dashboard/target/generated-sources/protobuf/java/com/google/api/HttpRuleOrBuilder.java:[6,8] duplicate class: com.google.api.HttpRuleOrBuilder
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/Http.java:[31,15] duplicate class: com.google.api.Http
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/AnnotationsProto.java:[22,14] duplicate class: com.google.api.AnnotationsProto
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/HttpOrBuilder.java:[22,8] duplicate class: com.google.api.HttpOrBuilder
[ERROR] /home/scenario/Documents/smart-home-dashboard/target/generated-sources/protobuf/grpc-java/com/google/home/graph/v1/HomeGraphApiServiceGrpc.java:[26,18] cannot find symbol
  symbol:   class Generated
  location: package javax.annotation
[INFO] 12 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.704 s
[INFO] Finished at: 2019-01-23T16:24:50-02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project dashboard: Compilation failure: Compilation failure: 
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/home/graph/v1/HomeGraphApiServiceGrpc.java:[29,14] duplicate class: com.google.home.graph.v1.HomeGraphApiServiceGrpc
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/home/graph/v1/DeviceProto.java:[22,14] duplicate class: com.google.home.graph.v1.DeviceProto
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/HttpRule.java:[202,15] duplicate class: com.google.api.HttpRule
[ERROR] /home/scenario/Documents/smart-home-dashboard/target/generated-sources/protobuf/java/com/google/api/HttpProto.java:[6,14] duplicate class: com.google.api.HttpProto
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/CustomHttpPatternOrBuilder.java:[22,8] duplicate class: com.google.api.CustomHttpPatternOrBuilder
[ERROR] /home/scenario/Documents/smart-home-dashboard/target/generated-sources/protobuf/java/com/google/home/graph/v1/HomeGraphApiServiceProto.java:[6,14] duplicate class: com.google.home.graph.v1.HomeGraphApiServiceProto
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/CustomHttpPattern.java:[29,15] duplicate class: com.google.api.CustomHttpPattern
[ERROR] /home/scenario/Documents/smart-home-dashboard/target/generated-sources/protobuf/java/com/google/api/HttpRuleOrBuilder.java:[6,8] duplicate class: com.google.api.HttpRuleOrBuilder
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/Http.java:[31,15] duplicate class: com.google.api.Http
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/AnnotationsProto.java:[22,14] duplicate class: com.google.api.AnnotationsProto
[ERROR] /home/scenario/Documents/smart-home-dashboard/src/main/java/com/google/api/HttpOrBuilder.java:[22,8] duplicate class: com.google.api.HttpOrBuilder
[ERROR] /home/scenario/Documents/smart-home-dashboard/target/generated-sources/protobuf/grpc-java/com/google/home/graph/v1/HomeGraphApiServiceGrpc.java:[26,18] cannot find symbol
[ERROR]   symbol:   class Generated
[ERROR]   location: package javax.annotation
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Fleker commented 5 years ago

Hmm the error:

cannot find symbol
[ERROR]   symbol:   class Generated
[ERROR]   location: package javax.annotation

seems to suggest that the project hasn't imported javax.annotation, although other errors seem to point to build files that were generated multiple times.

It is good that you got past the first error, but that indicates the documentation needs to be improved.

ldgmaia commented 5 years ago

I'm getting the same error:

[ERROR] symbol: class Generated [ERROR] location: package javax.annotation

Actually I had to fix some other stuff (changing "&&" to ";", for example) by following the instructions. I think a setup instructions update will be good.

Fleker commented 5 years ago

If you can make specific changes and open a pull request, that'll be helpful. It's unusual that folks encounter issues, as I haven't had any build issues when running the sample.