Here's how my protofile looks like in the same directory

*userpreference.proto*




*syntax = "proto3";import 
"com/google/samples/apps/nowinandroid/data/dark_theme_config.proto";*import 
"com/google/samples/apps/nowinandroid/data/theme_brand.proto";






*option java_package = 
"com.google.samples.apps.nowinandroid.core.datastore";option 
java_multiple_files = true;message UserPreferences {    ThemeBrandProto 
theme_brand = 16;    DarkThemeConfigProto dark_theme_config = 17;}*


*dark_theme_config.proto*











*syntax = "proto3";option java_package = 
"com.google.samples.apps.nowinandroid.core.datastore";option 
java_multiple_files = true;enum DarkThemeConfigProto {  
DARK_THEME_CONFIG_UNSPECIFIED = 0;  DARK_THEME_CONFIG_FOLLOW_SYSTEM = 1;  
DARK_THEME_CONFIG_LIGHT = 2;  DARK_THEME_CONFIG_DARK = 3;}*
*Running protoc compiler*

*protoc -I . --include_imports --descriptor_set_out=/dev/stdout 
google/samples/apps/nowinandroid/data/user_preferences.proto*

*errors out and gives me this error*

*com/google/samples/apps/nowinandroid/data/dark_theme_config.proto: File 
not found.*

*com/google/samples/apps/nowinandroid/data/theme_brand.proto: File not 
found.*

*user_preferences.proto:19:1: Import 
"com/google/samples/apps/nowinandroid/data/dark_theme_config.proto" was not 
found or had errors.*

*user_preferences.proto:20:1: Import 
"com/google/samples/apps/nowinandroid/data/theme_brand.proto" was not found 
or had errors.*

*user_preferences.proto:44:5: "ThemeBrandProto" is not defined.*

*user_preferences.proto:45:5: "DarkThemeConfigProto" is not defined.*



*But, if i change userpreferences imports from this*



*import 
"com/google/samples/apps/nowinandroid/data/dark_theme_config.proto";import 
"com/google/samples/apps/nowinandroid/data/theme_brand.proto";*
to



*import "theme_brand.proto";import "dark_theme_config.proto";*
works fine

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/317e2709-2629-4568-bf81-a9b7ce045bf3n%40googlegroups.com.

Reply via email to