Im trying to append some things to a google sheet from a Custom GUI in Minecraft. When i try the same code, isolatet, from IntelliJ instead of ingame it workes. Ingame it throws this error:
java.lang.NoClassDefFoundError: com/google/api/client/http/HttpRequestInitializer
Its thrown at the "<---" in the code below:
public AppendValuesResponse execute(String APPLICATION_NAME) throws GeneralSecurityException, IOException, MissingEntryException {
Sheets sheetsService = SheetsAPI.getSheetsService(APPLICATION_NAME);
if(SHEET_ID == null || RANGE == null ||INPUT == null)
throw new MissingEntryException("One or more Values are null: SHEET_ID: '"+SHEET_ID+"', RANGE: '"+RANGE+"', SHEET_ID: '" + INPUT.toString() + "'");
ValueRange appendBody = new ValueRange().setValues(Arrays.asList(Arrays.asList(INPUT)));
Sheets.Spreadsheets.Values.Append append = sheetsService.spreadsheets().values()
.append(SHEET_ID, RANGE, appendBody)
.setValueInputOption("USER_ENTERED")
.setInsertDataOption("OVERWRITE")
.setIncludeValuesInResponse(true);
return append.execute(); <---
}
Anyone know how to fix this?
Using Gradle, load the Dependency like this:
implementation 'com.google.http-client:google-http-client:1.42.2'