Git Product home page Git Product logo

Comments (20)

cavallium avatar cavallium commented on August 25, 2024 1

Login using phone number or token works the same as the original tdlib.

from tdlight-java.

eos1d3 avatar eos1d3 commented on August 25, 2024 1

Hi, please check if it is openssl issue.

For TDLIB, I found that if openssl is not installed, there is an error Library not loaded. And for the Mac I am using, it does not have it installed.

And for the error of this library on Mac, I am seeing:

Caused by: java.lang.UnsatisfiedLinkError: /Users/xxx/eclipse-workspace/telegram-forwarder/.cache/version-tdlight-3.171.36-3.2.48/tdjni/tdjni.dylib: dlopen(/Users/xxx/eclipse-workspace/telegram-forwarder/.cache/version-tdlight-3.171.36-3.2.48/tdjni/tdjni.dylib, 1): Library not loaded: /usr/local/opt/[email protected]/lib/libssl.1.1.dylib

from tdlight-java.

cavallium avatar cavallium commented on August 25, 2024

I updated the examples, they were outdated.
Also, use the latest version of tdlight java:

<dependency>
  <groupId>it.tdlight</groupId>
  <artifactId>tdlight-java</artifactId>
  <version>3.171.36</version>
</dependency>
<dependency>
  <groupId>it.tdlight</groupId>
  <artifactId>tdlight-natives-linux-amd64</artifactId>
  <version>3.2.48</version>
</dependency>

from tdlight-java.

eos1d3 avatar eos1d3 commented on August 25, 2024

I test the example on Mac, so I use these:

<dependency>
	<groupId>it.tdlight</groupId>
	<artifactId>tdlight-java</artifactId>
	<version>3.171.36</version>
</dependency>
<dependency>
	<groupId>it.tdlight</groupId>
	<artifactId>tdlib-natives-osx-amd64</artifactId>
	<version>3.2.48</version>
</dependency>

But there is still error:

it.tdlight.common.utils.CantLoadLibrary: FATAL: Init failled when load tdlib library, execution can't continue
	at it.tdlight.common.utils.LoadLibrary.loadLibrary(LoadLibrary.java:88)
	at it.tdlight.common.utils.LoadLibrary.load(LoadLibrary.java:66)
	at it.tdlight.common.Init.start(Init.java:44)
	at eos1d3.telegram_forwarder.App.main(App.java:13)
Caused by: java.io.IOException: Native libraries for platform osx-amd64 not found!
	at it.tdlight.common.utils.LoadLibrary.loadJarLibrary(LoadLibrary.java:177)
	at it.tdlight.common.utils.LoadLibrary.loadLibrary(LoadLibrary.java:83)
	... 3 more
it.tdlight.common.utils.CantLoadLibrary: FATAL: Init failled when load tdlib library, execution can't continue
	at it.tdlight.common.utils.LoadLibrary.loadLibrary(LoadLibrary.java:88)
	at it.tdlight.common.utils.LoadLibrary.load(LoadLibrary.java:66)
	at it.tdlight.common.Init.start(Init.java:44)
	at it.tdlight.common.InternalClientManager.<init>(InternalClientManager.java:19)
	at it.tdlight.common.InternalClientManager.lambda$get$0(InternalClientManager.java:28)
	at java.util.concurrent.atomic.AtomicReference.updateAndGet(AtomicReference.java:179)
	at it.tdlight.common.InternalClientManager.get(InternalClientManager.java:28)
	at it.tdlight.common.CommonClientManager.getClientManager(CommonClientManager.java:9)
	at it.tdlight.common.CommonClientManager.create(CommonClientManager.java:16)
	at it.tdlight.tdlight.ClientManager.create(ClientManager.java:20)
	at eos1d3.telegram_forwarder.App.main(App.java:20)
Caused by: java.io.IOException: Native libraries for platform osx-amd64 not found!
	at it.tdlight.common.utils.LoadLibrary.loadJarLibrary(LoadLibrary.java:177)
	at it.tdlight.common.utils.LoadLibrary.loadLibrary(LoadLibrary.java:83)
	... 10 more
Exception in thread "TDLib thread" java.lang.UnsatisfiedLinkError: it.tdlight.jni.NativeClient.nativeClientReceive([I[J[Lit/tdlight/jni/TdApi$Object;D)I
	at it.tdlight.jni.NativeClient.nativeClientReceive(Native Method)
	at it.tdlight.common.NativeClientAccess.receive(NativeClientAccess.java:22)
	at it.tdlight.common.ResponseReceiver.run(ResponseReceiver.java:54)

from tdlight-java.

eos1d3 avatar eos1d3 commented on August 25, 2024

I find 'tdlib-natives-osx-amd64-3.2.48.jar' is already in Eclipse project "Maven Dependencies" folder already. So...?

from tdlight-java.

cavallium avatar cavallium commented on August 25, 2024

You aren't reading what you are writing. You are writing "tdlib", not "tdlight"...

from tdlight-java.

cavallium avatar cavallium commented on August 25, 2024

use "tdlight-natives-osx-amd64'"

from tdlight-java.

eos1d3 avatar eos1d3 commented on August 25, 2024

Just realised this. Thanks!

from tdlight-java.

eos1d3 avatar eos1d3 commented on August 25, 2024

After fixing the name, it shows the same error above

<dependency>
	<groupId>it.tdlight</groupId>
	<artifactId>tdlight-natives-osx-amd64</artifactId>
	<version>3.2.48</version>
</dependency>

from tdlight-java.

cavallium avatar cavallium commented on August 25, 2024

You are building it wrong, i don't know what you are doing but it must work

from tdlight-java.

cavallium avatar cavallium commented on August 25, 2024

Does it work on linux?

from tdlight-java.

eos1d3 avatar eos1d3 commented on August 25, 2024

I created a Maven project in Eclipse, then I just copy the Example, and include the following in pom.xml

<dependency>
	<groupId>it.tdlight</groupId>
	<artifactId>tdlight-natives-osx-amd64</artifactId>
	<version>3.2.48</version>
</dependency>

When I run it, it show "Init failled when load tdlib library, execution can't continue".

I can try to test on Windows later. I do not have linux to test.

from tdlight-java.

eos1d3 avatar eos1d3 commented on August 25, 2024

In order to use on Windows, I change to tdlight-natives-windows-amd64

<dependency>
	<groupId>it.tdlight</groupId>
	<artifactId>tdlight-java</artifactId>
	<version>3.171.36</version>
</dependency>
<dependency>
	<groupId>it.tdlight</groupId>
	<artifactId>tdlight-natives-windows-amd64</artifactId>
	<version>3.2.48</version>
</dependency>
		 

It shows the same compilation errors on both Mac and Windows:

Failed to read artifact descriptor for it.tdlight:tdlight-natives-windows-amd64:jar:3.2.48
Missing artifact it.cavallium:concurrent-locks:jar:1.0.8	
Missing artifact it.tdlight:tdlight-api:jar:3.2.48
Missing artifact it.tdlight:tdlight-java:jar:3.171.36
Missing artifact it.tdlight:tdlight-natives-osx-amd64:jar:3.2.48
Missing artifact it.tdlight:tdlight-natives-windows-amd64:jar:3.2.48
Missing artifact it.unimi.dsi:fastutil:jar:8.3.1
Missing artifact junit:junit:jar:4.11
Missing artifact org.hamcrest:hamcrest-core:jar:1.3	pom.xml	
The container 'Maven Dependencies' references non existing library '/Users/xxx/.m2/repository/it/tdlight/tdlight-natives-windows-amd64/3.2.48/tdlight-natives-windows-amd64-3.2.48.jar'
The project cannot be built until build path errors are resolved

from tdlight-java.

cavallium avatar cavallium commented on August 25, 2024

Did you add the repository?

from tdlight-java.

eos1d3 avatar eos1d3 commented on August 25, 2024

Of course I do, see below.

During testing on Windows with Eclipse, if I use tdlight-natives-osx-amd64, there are no such compilation errors. After changing it to tdlight-natives-windows-amd64, the errors appear.

Then I did the same on Mac with tdlight-natives-windows-amd64, I see exactly the same error on Windows.

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<maven.compiler.source>1.8</maven.compiler.source>
	<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<repositories>
<repository>
	<id>mchv</id>
	<name>MCHV Apache Maven Packages</name>
	<url>https://mvn.mchv.eu/repository/mchv/</url>
</repository>
</repositories>

<dependencies>
<dependency>
	<groupId>junit</groupId>
	<artifactId>junit</artifactId>
	<version>4.11</version>
	<scope>test</scope>
</dependency>

<dependency>
	<groupId>it.tdlight</groupId>
	<artifactId>tdlight-java</artifactId>
	<version>3.171.36</version>
</dependency>
<dependency>
	<groupId>it.tdlight</groupId>
	<artifactId>tdlight-natives-osx-amd64</artifactId>
	<version>3.2.48</version>
</dependency>
<dependency>
	<groupId>it.tdlight</groupId>
	<artifactId>tdlight-natives-windows-amd64</artifactId>
	<version>3.2.48</version>
</dependency>

</dependencies>

from tdlight-java.

cavallium avatar cavallium commented on August 25, 2024

That's strange, it should work...

from tdlight-java.

eos1d3 avatar eos1d3 commented on August 25, 2024

Please note that whenever I use tdlight-natives-windows-amd64 on both Mac and Windows, those are compilation error. I can't even run it.

But these compilation errors are all gone when using tdlight-natives-osx-amd64.

from tdlight-java.

cavallium avatar cavallium commented on August 25, 2024

I tried now and it works also with windows.
Try to delete .m2 cache folder, maybe your local maven repository is broken.

from tdlight-java.

eos1d3 avatar eos1d3 commented on August 25, 2024

Removing .m2 is not enough, it needs to update Maven project as well.
Now I see these output on Windows. So it seems Windows version is working.

[ 3][t 0][1610818462.646162033][Client.cpp:276][&td_requests]	Begin to wait for updates with timeout 2.000000
[ 3][t 5][1610818462.653428792][Td.cpp:4621][#1][!Td][&td_requests]	Sending update: UpdateOption {
  name = "version"
  value = OptionValueString {
    value = "1.7.0"
  }
}

But doing the same (remove .m2 and update Maven) on Mac is having the same problem:

  1. If I add tdlight-natives-windows-amd64 on Mac, there are 8 compilation errors.
  2. If I use only tdlight-natives-osx-amd64, it always gives Init failled when load tdlib library, execution can't continue

PS: How to login account or using TOKEN to login? I know how to do in TDLIB, but not this library.

Thanks a lot!

from tdlight-java.

andrew-ld avatar andrew-ld commented on August 25, 2024

you must install libssl 1.1 on your operating system

from tdlight-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.