webrtc-java icon indicating copy to clipboard operation
webrtc-java copied to clipboard

How to install the native libraries?

Open customautosys opened this issue 3 years ago • 3 comments

Hi, I added this line to my gradle dependencies: api 'dev.onvoid.webrtc:webrtc-java:0.5.0' and I got

java.lang.RuntimeException: Load library 'webrtc-java' failed
	at dev.onvoid.webrtc.PeerConnectionFactory.<clinit>(PeerConnectionFactory.java:45)

I then tried to add:

api 'dev.onvoid.webrtc:webrtc-java-windows-x86_64:0.1.0'
api 'dev.onvoid.webrtc:webrtc-java-macos-x86_64:0.1.0'
api 'dev.onvoid.webrtc:webrtc-java-linux-x86_64:0.1.0'

Then I got:

Caused by: java.lang.NoSuchMethodError: <init>
	at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
	at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
	at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
	at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
	at java.base/java.lang.Runtime.load0(Runtime.java:768)
	at java.base/java.lang.System.load(System.java:1837)
	at dev.onvoid.webrtc.internal.NativeLoader.loadLibrary(NativeLoader.java:71)

How do I add the native dependencies in gradle?

customautosys avatar Dec 21 '21 14:12 customautosys

Please search closed issues related to gradle.

devopvoid avatar Dec 21 '21 14:12 devopvoid

Hi I am so sorry for not searching the closed issues. I followed the instructions in #23 to add the classifiers. However, now it hangs whenever it loads the native library. I have tried to debug it and it does successfully extract the .so file to a temporary file but after that it hangs when calling the native method load0 to actually load the library. Any idea what is wrong?

customautosys avatar Dec 21 '21 15:12 customautosys

Ok so I just tried it faces this problem on Linux but it can run on Windows. However, on Windows it crashed with an error Invalid COM thread model change (MTA->STA)

customautosys avatar Dec 24 '21 19:12 customautosys

This has been fixed in the latest version.

devopvoid avatar Oct 12 '22 05:10 devopvoid