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
proto2 and javalite #92
Comments
@mdusina I have just added testProjectLite that verifies javalite does generate files. @xfxyjwf it seems the javalite plugin is not generating files for him. Is it because his use of proto2 syntax? |
I don't think proto2 syntax is a problem. The lite plugin should work with both proto2 and proto3 syntax. |
This is interesting. When it complains about duplicate classes, can you check if the lite classes are generated? |
(Apologies for the delay, this is a personal project where I'm trying to teach myself Android Studio, Android development, and gradle all at once). I think I know what happened. The builder API for maps seems to have changed in 3.0.0. Instead of When I switch back to Android Studio 2.1.2 and fix all map builder calls, both the real compiler and Android Studio's incremental compiler are happy. Answers to your questions (just FYI): When omitting When I include |
This appears to be true for the new release to the stable channel -- Android Studio 2.2. I upgraded yesterday and can't get Android Studio to recognize any of the proto imports (in Java classes). I can still run tests and deploy apk's just fine. The IDE insists the symbols for the generated proto classes don't exist though. |
Similar to #89 , I'm having issues upgrading from protobuf 3.0.0-beta-3 to 3.0.0 because of the javalite split. I'm wondering if proto2 lite API is even supported anymore? The protobuf release notes for 3.0.0 specifically calls out the Lite runtime, but only mentions proto3 syntax.
General project structure:
Protos are in java projects
An android application project depends on them and uses the generated proto classes
Protos have proto2 syntax and use "option optimize_for = LITE_RUNTIME"
com.google.protobuf:protobuf-gradle-plugin:0.7.7
com.android.tools.build:gradle:2.1.2
gradle-2.14.1
Before the upgrade, this was all that was needed to get the lite api:
After the upgrade, the android project always fails because it can't find the symbols for the generated proto classes. I've tried several combinations of options, none of which seem to produce the symbols.
If I omit the "remove java" portion, it complains about duplicate classes (which is expected). But when "remove java" is included, there's 0 classes...
I also tried compiling com.google.protobuf:protobuf-lite:3.0.1 instead of com.google.protobuf:protobuf-java:3.0.0 just in case that was the root cause (it wasn't).
If I upgrade to 3.0.0, and remove the LITE_RUNTIME option from the protos, everything works just fine (and my apk grows in size).
The text was updated successfully, but these errors were encountered: