Third-party libraries

Hi,
Is it possible to import other third-party libraries to an extension?


the log does say that the package does not exist

Is there any way to “install” these kind of libraries?
Thanks.

1 Like

Sorry, I thought you were talking about Kodular Extension IDE…

http://ide.kodular.io/ has been down for months.

2 Likes

Yes it is possible.
This is what you are looking for:
https://docs.google.com/document/d/1xk9dMfczvjbbwD-wMsr-ffqkTlE3ga0ocCE1KOb2wvw/pub#h.3kn0fmfydnq1

So,
How shall I import it?
This doesn’t work:
@UsesLibraries(libraries = "Twilio.jar")https://github.com/twilio/twilio-java/blob/master/src/main/java/com/twilio/Twilio.java

Sometimes you have to use @UsesLibraries annotation.
Most of the time this will work:

  • Copy jar file to <root>\appinventor-sources-master\appinventor\lib\JarFolder
    (Create JarFolder dir in case it does not exists)

  • Add this line to <root>\appinventor-sources-master\appinventor\components\build.xml:

    <copy toFile="${public.deps.dir}/NameOfJar.jar" file="${lib.dir}/JarFolder/NameOfJar.jar" />
1 Like

I am using the AppyBuilder IDE. Is it possible there?

No it is not possible there.
You can try this template:

It is very lightweight (just 25 mb) , fast and easy to use.

Did it with the Kio4 tutorial. Now I just import it normally (like this)?

You see I’m pushing to get that and the store fixed, but Congress won’t approve the bill :angry:

1 Like

Anyone familiar with this error?

BUILD FAILED
C:\Users\ONT Studios\appinventor-sources\appinventor\build.xml:44: The following error occurred while executing this line:
C:\Users\ONT Studios\appinventor-sources\appinventor\components\build.xml:2: Unexpected element "{}copy" {antlib:org.apache.tools.ant}copy

My build.xml It’s exactly the same as on GitHub

I think you have posted wrong build.xml file.
You should post <root>\appinventor-sources-master\appinventor\components\build.xml but you have posted <root>\appinventor-sources-master\appinventor\build.xml

Right, the first error was the one.
(probably an error with the twilio import)
https://pastebin.com/49y0BHP4

Try this one:
https://pastebin.com/qT2maGf7


Yes, but it doesn’t have the Twilio library.

Are you sure that you have Twillo.jar file in JarFolder directory or you just have copy-pasted?

EDIT: Just noticed that it requires a .jar, not .java file.

You have to put jar file not java file.

Would just renaming the file extension work?

No,not at all.
Java and Jar are quite different.
Java is raw version while jar is compiled version.
Search jar file on google and put there.