Td: Sending error for request 1: Error

Created on 9 Mar 2018  Â·  4Comments  Â·  Source: tdlib/td

When I use a precompiled Library the libtd:https://core.telegram.org/tdlib
When I execute the send method, it's like this:
TdApi.TdlibParameters authStateRequest = new TdApi.TdlibParameters(); authStateRequest.apiId = 157364; authStateRequest.apiHash = "<censored>"; Client.send(new TdApi.SetTdlibParameters(authStateRequest),new AuthorizationRequestHandler());\

A mistake like this:
Sending error for request 1: Error { code = 30 message = "File "/td.binlog" can't be opened/created for reading and writing" }

How should I solve it?

Most helpful comment

On Android you can use getApplicationContext().getFilesDir().getAbsolutePath() for example.

All 4 comments

You should specify a lot more tdlibParameters in order to properly init the library. The error happens because you haven't specified writable databaseDirectory, but there are a lot of other parameters which should be also set with a correct value in setTdlibParameters. And please don't publish your apiHash, it should be kept secret. I've removed apiHash from your message.

thank you.
I modified the code
TdApi.TdlibParameters authStateRequest = new TdApi.TdlibParameters();
authStateRequest.apiId = 157364;
authStateRequest.useMessageDatabase = true;
authStateRequest.useSecretChats = true;
authStateRequest.systemLanguageCode = PhoneUtils.getLocale(this).getISO3Language();
authStateRequest.deviceModel = PhoneUtils.getModel();
authStateRequest.systemVersion = PhoneUtils.getVersion();
authStateRequest.applicationVersion = "5.0.2";
authStateRequest.enableStorageOptimizer = true;
Client.send(new TdApi.SetTdlibParameters(authStateRequest));
Still appear this error
The error happens because you haven't specified writable databaseDirectory.
How can I specify a writable databaseDirectory?

On Android you can use getApplicationContext().getFilesDir().getAbsolutePath() for example.

thank you,this error is solved

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikolayozhogov picture nikolayozhogov  Â·  5Comments

FJarvan picture FJarvan  Â·  3Comments

rdlrt picture rdlrt  Â·  3Comments

L11R picture L11R  Â·  4Comments

omkarnathsingh picture omkarnathsingh  Â·  4Comments