mavlink / MAVSDK-Java

MAVSDK client for Java.
73 stars 42 forks source link

error: method downloadLogFile(Entry,String) is already defined in class LogFiles #117

Open SSSnow opened 2 years ago

SSSnow commented 2 years ago

When I run ./gradlew build in Ubuntu 18.04 , the error report:

MAVSDK-Java/sdk/mavsdk/build/generated/source/proto/main/mavsdk/io/mavsdk/log_files/LogFiles.java:368: error: method downloadLogFile(Entry,String) is already defined in class LogFiles
    public Single<LogFiles.ProgressData> downloadLogFile(@NonNull Entry entry, @NonNull String path) {
                                         ^
1 error
JonasVautherin commented 2 years ago

Yes there is an issue in the proto files that does not work with Java. I need to fix that at some point. In the meantime, just edit the proto files like this:

diff --git a/protos/log_files/log_files.proto b/protos/log_files/log_files.proto
index 8307c89..b4c9bc3 100644
--- a/protos/log_files/log_files.proto
+++ b/protos/log_files/log_files.proto
@@ -17,10 +17,6 @@ service LogFilesService {
         option (mavsdk.options.async_type) = ASYNC;
         option (mavsdk.options.is_finite) = true;
     }
-    // Download log file synchronously.
-    rpc DownloadLogFile(DownloadLogFileRequest) returns(DownloadLogFileResponse) {
-        option (mavsdk.options.async_type) = SYNC;
-    }
     // Erase all log files.
     rpc EraseAllLogFiles(EraseAllLogFilesRequest) returns(EraseAllLogFilesResponse) {
         option (mavsdk.options.async_type) = SYNC;
@@ -42,11 +38,6 @@ message DownloadLogFileResponse {
     ProgressData progress = 2; // Progress if result is progress
 }

-message DownloadLogFileRequest {
-    Entry entry = 1; // Entry of the log file to download.
-    string path = 2; // Path of where to download log file to.
-}
-
 message EraseAllLogFilesRequest {}
 message EraseAllLogFilesResponse {
     LogFilesResult log_files_result = 1;
SSSnow commented 2 years ago

Thanks,