taksan / skype-java-api

Skype API for Java, based on Skype4Java library
128 stars 57 forks source link

Mac OS X (Lion 64 bit, Mac OS JDK 1.6) issue #8

Closed evluhin closed 12 years ago

evluhin commented 12 years ago

Try to start com.skype.sample.ShowVersion and get an error:

Exception in thread "main" com.skype.SkypeException: Loading libskype.jnilib failed. ~/git/skype-java-api/target/classes/libskype.jnilib: Library not loaded: @loader_path/Skype.Framework Referenced from: ~/git/skype-java-api/target/classes/libskype.jnilib Reason: no suitable image found. Did find: /Users/evluhin/git/skype-java-api/target/classes/Skype.Framework: file too short ~/git/skype-java-api/target/classes/Skype.Framework: file too short at com.skype.Utils.convertToSkypeException(Utils.java:61) at com.skype.Utils.getProperty(Utils.java:157) at com.skype.Skype.getVersion(Skype.java:200) at com.skype.sample.ShowVersion.main(ShowVersion.java:27)

To fix it just comment line: writeStreamToFile(skypeFrameworkStream, skypeFramework);

in ConnectorUtils.rehydrateFrameworkAtLibraryPath(String param) method.

because somehow ConnectorUtils.class.getResourceAsStream("/"+"Skype.Framework"); method returns stream of the same file and in result we have zero size Skype.Framework file (input stream and just opened output stream are opened on the same resource). I think it actually is not an issue of the skype-api but It would be great to add check if output folder (classes) contains Skype.Framework For example add lines:

URL skypeFrameworkResourceUrl = ConnectorUtils.class.getResource("/"+"Skype.Framework"); if(!skypeFramework.getAbsolutePath().equals(skypeFrameworkResourceUrl.getPath())){ .... copy....

taksan commented 12 years ago

Hi,

Sorry for the late response, I was on vacation. I'll look into this issue.

tpepitas commented 12 years ago

hello. i don't get it working on mac os x lion 64 nor 32 bit version.

With the proposed -d32 i can call Skype.getProfile() for example. Skype.getProfile().getCity() (whatever i call) doesn't work. Skype.call(..) doesn't work too. I don't see any Exceptions at all. It just hangs somewhere..

Is it planned to be running in 64-bit version as well someday soon?

tpepitas commented 12 years ago

maybe to be more precise. i used version 1.1. i now saw that there is a newer version 1.3. Changing the dependency to 1.3 shows me the error skype-java-api:jar:1.3 is missing.. i guess the 1.3 is not available in the repository. thanks for your effort

hcpeter commented 12 years ago

Hi tpepitas!

I tried this api under macosx lion 64 bit. Everything works, but there is a strange thing: after start your java application you have to focus skype (click on the dock) otherwise the app can't connect to the skype client. It's very strange...

taksan commented 12 years ago

@tpepitas

About making skype-java-api running natively under Mac 64 bit: the problem is that Skype's Framework API for Mac OS is 32bit only. They never recompiled a 64bit version...And skype-java-api mac's native library needs Skype's Framework to work. So, it is not possible to compile the native library targeting 64bit unless they release a 64bit framework.

Anyway, I didn't test skype-java-api extensively under MacOS... in fact, I just tested under Leopard, for which I have a virtual box image. So far, most of the tests worked... there is a test application that comes with Skype.Framework.. did you ever tried to run it and check whether it works?

hcpeter commented 12 years ago

@taksan

I tried under Osx Lion but just a quick look. My first impressions: skype client have to be in focus otherwise my app can't connect. Some API calls seems doesn't work: for example ChatMessageReceived, and ChatMessageSent. I don't have much time to find out what's the problem and it's possible that I made some mistake.

taksan commented 12 years ago

The first post problem has been addressed and fixed.