In Compiler.class, I want to include an external library(.jar) while building app.
I seen SUPPORT_JARS variable in Compiler.class but it doesn't seems to include external lib. I think it lists libs which can be compiled in apk(all jar libraries). Is there any other way to do this ?
The support jars list is only for those libraries required by all App Inventor apps due to transitive dependencies from Android library such as appcompat. For per-component libraries. you need to add the library under lib/ and then include the libraries in components/build.xml in the CopyComponentLibraries target. You will then need to include the library using the @UsesLibraries annotation on the component class. For an example, see how CloudDB imports jedis.jar.
Is the .jar file intended for a specific component or the entire app? It's fairly rare outside of the AndroidX libraries to need to add a library that applies to every application built with App Inventor.
I have two jars. I want to include one of them in building process if app have status bar visible I need to include the first jar and if it's invisible then, I want to include the other jar. I know how to get ShowStatusBar value in compiler.java in buildserver. But I don't know how can I include the jars in compilation process ?
I believe it's possible. I think what you would need to do is add the library conditionally to uniqueLibsNeeded in generateClasses. You'll also need to append it to the classpath variable in that function as well, which is used as part of the compiler call.