Error:
incompatible types: java.io.File cannot be converted to com.google.api.services.drive.model.File
I have this error when i want to use the code to upload a file to drive. I am using the drive API in android studio.
File fileMetadata = new File("video.mp4");
java.io.File filePath = new java.io.File(mVideoFileName);
fileMetadata.createNewFile();
FileContent mediaContent = new FileContent("video/mp4", filePath);
Drive driveService = getDriveService(HTTP_TRANSPORT);
File file = driveService.files().create(fileMetadata)
.setFields("1DpOLhFd4_ZpeQTvROBAmIyfarn80Yg5S")
.execute();
Why do I get this error?
java.io.Filewhere a type of filecom.google.api.services.drive.model.Filewas expected. Could you provide more of the code, the line numbers and the line numbers mentioned in the stack trace?