2016-07-31 108 views
0

試圖將jar文件添加到我的AndroidStudio項目中。我得到一個很長的錯誤。我添加jar文件的原因是爲了訪問某些類。例如,爲了SFTP所以罐子這樣我就可以導入以下的能力,並採取了PCM文件,並改變從44100到16000的採樣率:重新編譯jar文件

在構建時
com.jcraft.jsch.*; 
com.jcraft.jsch.JSch; 
com.jcraft.jsch.Session; 
javax.sound.sampled.AudioFileFormat; 
javax.sound.sampled.AudioFormat; 
javax.sound.sampled.AudioInputStream; 
javax.sound.sampled.AudioSystem; 
javax.sound.sampled.UnsupportedAudioFileException; 

然而這種錯誤的關鍵點我得到的是

warning: Ignoring InnerClasses attribute for an anonymous inner class 
     (com.jcraft.jsch.Channel$1) that doesn't come with an 
     associated EnclosingMethod attribute. This class was probably produced by a 
     compiler that did not target the modern .class file format. The recommended 
     solution is to recompile the class from source, using an up-to-date compiler 
     and without specifying any "-target" type options. 

我試着找到不同版本的jar文件,或者通過命令行下載源文件來重新編譯。

我該如何構建一個項目來編譯我可以在自己的應用程序中使用的庫?

如何從罐子中編譯源代碼或從哪裏可以找到正確類型的罐子(如果是這種情況)。

回答

0

您可能會從http://www.jcraft.com/jsch/獲取源代碼並自己編譯jar文件。但是,我會首先檢查是否有最新版本 - 這可能也會解決您的問題。