Reputation: 6117
// spc/main/proto/battery_saver_mode_enum.proto:
syntax = "proto3";
option java_package = "com.freephoenix888.savemylife";
option java_multiple_files = false;
enum BatterySaverMode {
Disabled = 0;
Enabled = 1;
Adaptive = 2;
}
// src/main/proto/location_preferences.proto
syntax = "proto3";
import "battery_saver_mode_enum.proto";
option java_package = "com.freephoenix888.savemylife";
option java_multiple_files = true;
message LocationPreferences {
bool isLocationSharingEnabled = 1;
BatterySaverMode BatterySaverMode = 2;
}
Cannot resolve import 'battery_saver_mode_enum.proto'
When I try Andriod Studio autocomplete I have this:
When I try to use the relative path import "./battery_saver_mode_enum.proto";
I get the error Backslashes, consecutive slashes, ., and .. are not allowed in the virtual path
I have .proto files in the src/main/proto
folder because every Proto DataStore guide says to do so. If I pul them in another directory - I get a lot of compilation errors
Upvotes: 2
Views: 441
Reputation: 6117
Just use import "battery_saver_mode_enum.proto";
and do not care about this hint-error.
It is not a compilation error.
If you build it - your import works and you will not get any compilation errors about this import.
The proto3 Language Guide also tells to use import this way
Upvotes: 3