GoogleDrive connection is not working on some recent mobile

Hi,

The connection to Google Drive does not work on certain mobile phones.

I get the 'Connection successful' page on the callback uri 127.0.0.1/8889. When I close the window, nothing happens

.With the provided example CloudStorageServiceDemo compiled in FMX for Android 64 bits, the application does not display the cloud files once connected on a Samsung S24+, while it works on an old Samsung S10.

Other issue with OneDrive. If the URI is http://localhost or localhost:8000, I get "age localhhost is not responding". If I set 8887 port or other, it's OK

DropBox connection is OK

I bought the FNC components hoping to have a better experience than with the legacy TMS FMX Cloud components (Recurring issues with serverlocal not responding for 30% of my clients already explained here a few years ago without any response provide from the support)., and I am very disappointed.

For now, it is unusable as it is.

Hi Support

Can I have an answer please ?

It's unclear exactly why some ports work an other ports don't, most likely port 8000 is already being used. Also you might want to switch to HTTPS instead. You can also turn on logging with

TMSFNCCloudStorageServices1.Storage.Logging := True;
TMSFNCCloudStorageServices1.Storage.LogFileName := 'Path To Log File';

Make sure the path to the log file (txt) is writable.

Hi,

I changed the Google URI and the port with no effect.

I activated the logging mode :

1/ On a Galaxy S10+, when I close the screen that indicates that the connection is successful, I get a black screen and it crashes the entire phone. I have to restart.
The log seems to be ok but the connection freeze the mobile and is not successful

The log is (id and secret are manually masked by XXX, YYY and ZZZ) :

0250605T224128: Executing request [TEST TOKENS] with url: [https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=]
20250605T224128: Result from request [TEST TOKENS] is {
  "error": "invalid_token",
  "error_description": "Either access_token, id_token, or token_handle required"
}

20250605T224128: Result from request [TEST TOKENS] is {
  "error": "invalid_token",
  "error_description": "Either access_token, id_token, or token_handle required"
}

20250605T224144: Executing request [RETRIEVE ACCESS TOKEN] with url: [https://accounts.google.com/o/oauth2/token?client_id=XXXXX&client_secret=YYYYY&redirect_uri=http://127.0.0.1:8888&code=ZZZZZ&grant_type=authorization_code]
20250605T224144: Result from request [RETRIEVE ACCESS TOKEN] is {
  "access_token": "ya29.a0AW4XtxiFF87ZdRk1jQPDqU59SzPlLB9Pf_UHMmN1lBsgWOu9S0Ro9bJGNrxjU5l4F8HpGN296L1NRCajrZweZCVb7ZIj6dfxZKw1aZqq0qDpiWYu1N3xPf6uz7GPhlUlVs0-RxuaAXiVWK95-RHFqUXrEV2y0djmb_Hr3PsUaCgYKAcQSARQSFQHGX2Mi6o7G44Y8BCwy36r8lldkbA0175",
  "expires_in": 3599,
  "refresh_token": "1//03juHmCPrrd1BCgYIARAAGAMSNwF-L9Irdehv2ZiIvC_Q-Q8iSG7FGT0Ml9GPPFoENaqo1pgideSCkAql184V4vJ_SSeD64Iw25Q",
  "scope": "https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/userinfo.profile",
  "token_type": "Bearer",
  "id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImJiNDM0Njk1OTQ0NTE4MjAxNDhiMzM5YzU4OGFlZGUzMDUxMDM5MTkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiYXpwIjoiMTA1MjU3NzE3ODg1Ny03Z2ZzbWlwZzI2NTQ1b3VlNTVuanI3bHZsZnRlNGd1MS5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsImF1ZCI6IjEwNTI1NzcxNzg4NTctN2dmc21pcGcyNjU0NW91ZTU1bmpyN2x2bGZ0ZTRndTEuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMDc2ODgxMzkyNTMzMDczNTA0MjgiLCJhdF9oYXNoIjoiRXVvTFd0SWpjM2o1QjA1OC1WSndVQSIsImlhdCI6MTc0OTE1NjEwNCwiZXhwIjoxNzQ5MTU5NzA0fQ.iQc3DALLOLBH0YXWv2h0ujLqeEUkZLBndXUaQC8NyLw_j3duWSxvm3X7_AnGQtGDbwHZAQ0AQFJ03JrcjZo8DOgrprGDTLjPtaKh4Wqy4M-zBlfXgfWQLFkdJGHwA60i2BkvI35BExAS-eeFE9Lm6SORg9882PII21K1eaU1dzRPMQb_Iz3qxqtG4p_3xvMOU5RTwxWg9SzwknbQPrFSpY7xRPNjz6q39UZxrqS5VgOq7Jp0xCPRlMiTKtMetdqrvxlWyPVBzlWT5jRNzkyX_ardIxLE6MXXx7r0trY5TcqnZ7MrS1xsurQKxNlrxqhAMlZuhoIxqmZSHZvgt3DK1g"
}
20250605T224144: Result from request [RETRIEVE ACCESS TOKEN] is {
  "access_token": "ya29.a0AW4XtxiFF87ZdRk1jQPDqU59SzPlLB9Pf_UHMmN1lBsgWOu9S0Ro9bJGNrxjU5l4F8HpGN296L1NRCajrZweZCVb7ZIj6dfxZKw1aZqq0qDpiWYu1N3xPf6uz7GPhlUlVs0-RxuaAXiVWK95-RHFqUXrEV2y0djmb_Hr3PsUaCgYKAcQSARQSFQHGX2Mi6o7G44Y8BCwy36r8lldkbA0175",
  "expires_in": 3599,
  "refresh_token": "1//03juHmCPrrd1BCgYIARAAGAMSNwF-L9Irdehv2ZiIvC_Q-Q8iSG7FGT0Ml9GPPFoENaqo1pgideSCkAql184V4vJ_SSeD64Iw25Q",
  "scope": "https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/userinfo.profile",
  "token_type": "Bearer",
  "id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImJiNDM0Njk1OTQ0NTE4MjAxNDhiMzM5YzU4OGFlZGUzMDUxMDM5MTkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiYXpwIjoiMTA1MjU3NzE3ODg1Ny03Z2ZzbWlwZzI2NTQ1b3VlNTVuanI3bHZsZnRlNGd1MS5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsImF1ZCI6IjEwNTI1NzcxNzg4NTctN2dmc21pcGcyNjU0NW91ZTU1bmpyN2x2bGZ0ZTRndTEuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMDc2ODgxMzkyNTMzMDczNTA0MjgiLCJhdF9oYXNoIjoiRXVvTFd0SWpjM2o1QjA1OC1WSndVQSIsImlhdCI6MTc0OTE1NjEwNCwiZXhwIjoxNzQ5MTU5NzA0fQ.iQc3DALLOLBH0YXWv2h0ujLqeEUkZLBndXUaQC8NyLw_j3duWSxvm3X7_AnGQtGDbwHZAQ0AQFJ03JrcjZo8DOgrprGDTLjPtaKh4Wqy4M-zBlfXgfWQLFkdJGHwA60i2BkvI35BExAS-eeFE9Lm6SORg9882PII21K1eaU1dzRPMQb_Iz3qxqtG4p_3xvMOU5RTwxWg9SzwknbQPrFSpY7xRPNjz6q39UZxrqS5VgOq7Jp0xCPRlMiTKtMetdqrvxlWyPVBzlWT5jRNzkyX_ardIxLE6MXXx7r0trY5TcqnZ7MrS1xsurQKxNlrxqhAMlZuhoIxqmZSHZvgt3DK1g"
}

2/ On a Galaxy S24+, when I close the screen that indicates that the connection is successful, I get nothing, and the connexion is not established.

The log is (id and secret are manually masked by XXX, YYY and ZZZ) :
The 2 last lines are not ok with access token null :

20250605T222352: Executing request [TEST TOKENS] with url: [https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=]
20250605T222353: Result from request [TEST TOKENS] is {
  "error": "invalid_token",
  "error_description": "Either access_token, id_token, or token_handle required"
}

20250605T222353: Result from request [TEST TOKENS] is {
  "error": "invalid_token",
  "error_description": "Either access_token, id_token, or token_handle required"
}

20250605T222403: Executing request [RETRIEVE ACCESS TOKEN] with url: [https://accounts.google.com/o/oauth2/token?client_id=XXXX&client_secret=YYYY&redirect_uri=http://127.0.0.1:8888&code=ZZZ&grant_type=authorization_code]
20250605T222403: Result from request [RETRIEVE ACCESS TOKEN] is 
20250605T222403: Result from request [RETRIEVE ACCESS TOKEN] is

It's a disaster.

Hi,

If the connection is working on an older device and not on a new device, this might be caused by breaking changes in a recent Android version.
Can you please provide the Android version that is used on both your devices so we can further investigate this issue?

Hi,

Tests made with CloudStorageServiceDemo standard demo, compiled in FMX 64 bits

Samsung S24+ with Android 15 : no connexion after the "Successfull page" displayed by the
local server.

**Samsung S20 FE with Android 13" : works fine

Samsung S7 with Android 8 : app freeze where I want to close the "Successfull connexion" displayed by the local server after google validation.I need restart the mobile after that. Sometimes it works, but 80% of the time I have this issue.

For information : legacy TMS FMX Cloud Pack no longer works with Google on recent mobile (Android 15): we get the message "java.net.UnknowsHostException : Unable to resolve host "accounts.google.com" : No address associated with hostname

Hello,

We have identified an issue with Android 15 that is causing a breaking change affecting authentication with Google services. Please note that earlier versions, including Android 13 and 14, are not impacted.

We are investigating the cause and will provide updates as soon as we have more information.

Hi,

Thank you for your feedback.
I look forward to a fix.

Hi,

When do you plan to deliver the next update of the TMSFNCCloudPack that includes this fix?

Regards,

Hi,

Regrettably, we have not yet found a solution to this issue and are still investigating.
We will provide an update here as soon as the problem has been resolved.

Hi,

No news about this issue ?

:frowning:

We are still investigating this. Unfortunately something changed related to certificates and HTTPS in Android 15. We’ll provide more information as soon as possible

We have found the cause for the issue, but haven't yet found a solution. Stay tuned.

Hi,

Good news, Issue is resolved. It's due to new Android 15 security issues that didn't allow executing HTTP requests while the application was in the background. So during authentication, the application isn't active (because the browser is at that moment) and converting the authentication token to an access token failed at that moment. We are currently building a new version of TMS FNC Cloud Pack that should fix the issue. If anything comes up, let us know.