Android Question JSCH Library and B4A v7.80

Geoff Hunter

New Member
Licensed User
Longtime User
Hi All,

Haven't coded for awhile, and have just
- Upgraded to B4A version 7.8.
- Upgraded to JAVA jdk1.8.0_152 and then jdk-9.0.1 (to be sure)
-> updated the Java path to C:\Program Files\Java\jdk-9.0.1\bin\javac.exe
- Installed all of the recommended Android SDK's using the new command line tool
-> updated the Android path to C:\Android\android-sdk\platforms\android-26\android.jar

Created a simple app to enter login credentials. Only library enabled is Core 7.28. Complies and runs as expected.

Then added code from the JSCH tutorial. Received following error when compiling:

"
B4A Version: 7.80
Parsing code. (0.00s)
Compiling code. (0.07s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
Generating R file. (0.12s)
Compiling debugger engine code. (1.64s)
Compiling generated Java code. (2.06s)
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$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.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.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.runMonoDex(Main.java:313)
at com.android.dx.command.dexer.Main.run(Main.java:279)
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
"
I then removed all code relating to JSCH, but left the library enabled. - Same error.
I increased "MaxRamForDex" to 1536 in "C:\Users\Admin\AppData\Roaming\Anywhere Software\Basic4android\b4xV5.ini". - Same error

Any thoughts ?

much appreciated
Geoff


 

Geoff Hunter

New Member
Licensed User
Longtime User
Thanks for quick reply.
I installed HAXM and enabled VT in BIOS last night. Didn't fix the Dex optomisation issue, but did get the AVD working.
This morning I reverted back to 7.3 and Java 8. Still no joy.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
I was originally going to say to add the following line into your project, but I don't think that will fix your issue.
B4X:
#MultiDex: True
In your b4xV5.ini file, if it is set to 512, double it to 1024, or you can set it to 1536 or even 2048. I believe that it will already be set to 1024 though. If you change the setting, B4A MUST be already closed before you open the b4xV5.ini file.

b4xV5.ini file location:
Either
C:\Documents and Settings\<user>\Application Data\Anywhere Software\Basic4android
Or
C:\Users\<user>\AppData\Roaming\Anywhere Software\Basic4android

Enjoy...
 
Last edited:
Upvote 0

rdkartono

Member
Licensed User
Longtime User
Sorry to wake up an old thread, because I also receive the same Error as Geoff Hunter.

System configuration is :
* Windows 10 64bit
* B4A 7.80
* jdk1.8.0_65
* B4A SDK Manager already update all to latest
* Intel HAXM installed
* MaxRamForDex increased from 512 to 2048
* #Multidex value true or false already tried
* Android.jar from Android-27 version
* I created a small app to test which only use 3 libraries : Core (version 7.28), CustomListView (version 1.76), and Jsch (version 1.30)

Error message is exactly the same.
And I can't find any solution anywhere else.
 
Upvote 0
Top