Skip to content
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

proto import statement from Android project to Android project broken? #25

Open
mdusina opened this issue Jan 4, 2016 · 1 comment
Open

Comments

@mdusina
Copy link

mdusina commented Jan 4, 2016

I have two Android libraries, both of which have protos. ProjectB depends on ProjectA -- compile project(':projectA'). The only non-standard thing I've done is to disable nano protos and use the normal style protos (reverting that doesn't solve my problem).

Both protos can compile just fine when they're independent. However, if I add an import statement within protoB.proto to protoA.proto, I get an error:
protoA.proto: File not found.
protoB.proto: Import "protoA.proto" was not found or had errors.

I think this issue is similar to #22 but in my case, both projects are Android instead of plain Java. Should this work?

https://github.com/google/protobuf-gradle-plugin/blob/master/testProjectAndroid/build.gradle shows an Android app depending on protos defined in another Java project. If that works, shouldn't it still work when the other project is an Android project?

Should I move all protos into their own Java projects and have the Android projects depend on that instead?

Details:
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.1'
proto_library_version = '3.0.0-beta-1'
google_proto_library = "com.google.protobuf:protobuf-java:${proto_library_version}"
google_protoc_artifact = "com.google.protobuf:protoc:${proto_library_version}"

@mdusina
Copy link
Author

mdusina commented Jan 5, 2016

I just confirmed my theory by converting ProjectA to a Java project (ProjectB is still an Android library). All of the sudden, protoB.proto is allowed to import a proto from protoA.proto.

In my case, I think I can just convert both of them to Java projects and be done with it. I made them Android library projects even though they only contain regular Java (there was some limitation with Android and eclipse long ago). But it still seems like this shouldn't be a restriction.

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

No branches or pull requests

1 participant