Android Question B4A 7.80 and Jsch

rdkartono

Member
Licensed User
Longtime User
Have the same problem with an old thread posted before, but as Erel suggested, I should start a new thread about it.

So I want to use Jsch to make SFTP file upload, and found compilation error as follow :
B4X:
B4A Version: 7.80
Parsing code.    (0.00s)
Compiling code.    (0.17s)
Compiling layouts code.    (0.06s)
Organizing libraries.    (0.24s)
Generating R file.    (0.89s)
Compiling debugger engine code.    (1.87s)
Compiling generated Java code.    (2.22s)
Convert byte code - optimized dex.    Error
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. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.jcraft.jsch.ChannelSftp$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. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.jcraft.jsch.ChannelSftp$2) 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. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.jcraft.jsch.ChannelSftp$3) 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. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.jcraft.jsch.ConfigRepository$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. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.jcraft.jsch.ConfigRepository$2) 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. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.jcraft.jsch.JSch$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. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.jcraft.jsch.Util$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. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/jcraft/jsch/Buffer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/jcraft/jsch/Channel;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/jcraft/jsch/Channel$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/jcraft/jsch/Channel$MyPipedInputStream;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/jcraft/jsch/Channel$PassiveInputStream;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/jcraft/jsch/Channel$PassiveOutputStream;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/jcraft/jsch/ChannelAgentForwarding;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/jcraft/jsch/ChannelDirectTCPIP;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/jcraft/jsch/ChannelExec;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:689)
    at com.android.dx.command.dexer.Main.runMultiDex(Main.java:368)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:247)
    at com.android.dx.command.Main.main(Main.java:106)
Caused by: java.lang.InterruptedException: Too many errors
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:681)
    ... 4 more

So I created a trial app,just to prove it, and stilll found above error logs.
I will attach my trial here.

In summary , here is my condition :
* Windows 10 64bit
* JDK 1.8.0_65 64bit
* Android jar from Android-27
* B4A SDK manager, updated all to latest
* component used : Core (7.28), CustomListView (1.76), Jsch (1.30)
* MaxRamForDex=2048
* #Multidex , have tried true or false, same.
* Intel HAXM already installed.


If I remove Jsch componet, then can compile.
If I include Jsch component, then can not compile.
 

Attachments

  • SSH trial.zip
    96.6 KB · Views: 224

Erel

B4X founder
Staff member
Licensed User
Longtime User
Unsurprisingly it compiled fine here.

Your settings look correct. I've uploaded the library again. Make sure that there are no copies of this library in the internal libraries folder and copy the attached library to the additional libraries folder.

Test it in release mode.
 

Attachments

  • JSch.zip
    274 KB · Views: 224
Upvote 0

rdkartono

Member
Licensed User
Longtime User
My bad ! there are two Jsch.jar files, 1 inside B4A library folder and 1 inside additional library folder.
After I delete Jsch.jar inside B4A library folder, then no more error.

Thanks for your support !!
 
Upvote 0
Top