Hi everyone, I’m new to extension development, I’m using Niotron online Ide for extension build. It usage some external libraries. the extension works perfectly fine in companion but crashes when i build apk. can anyone please help?
Hi Ayan,
it would be better to ask in the Niotron community, but since extensions work on all platforms, we’ll try to help you here as well.
I recommend using ADB to find out exactly what’s causing the app to crash.
Niotron IDE does support external JAR libraries, but with important limitations. Because it’s an online builder, it only handles older Java bytecode and non-AndroidX libraries. That’s why an extension can run in the companion but crash in the compiled APK, the companion uses a different runtime environment than the final build.
Common causes include,
The external library is compiled with newer Java (Java 8+) features that the IDE cannot package.
The library depends on AndroidX, Kotlin, or Google Play Services, which the online builder does not support.
Missing or partially-loaded classes at build time, even though they load during companion testing.
To fix this, ensure that any external library you use is compiled for Java 7 / early Java 8, avoids AndroidX, and contains no modern dependencies that the builder cannot merge.
If you share the exact libraries you’re using, I can tell you whether they are fully compatible with the Niotron online IDE.
Hi Ibrahim,
sorry for jumping in, but wouldn’t enabling this switch solve the problem?
I’m not an expert, but maybe they recently made this update and you weren’t aware of it.
By adding Androidx will not fix the issue
As from this![]()
I mentioned few things to check in his code weather it’s related to AndroidX or other things
My question what type of libraries are used? .Jar or .aar
Hi thank you for your response. I’m using these following .jar files
- socket.io-client-2.1.0.jar
- engine.io-client-2.1.0.jar
- okhttp-3.0.0-RC1.jar
- okio-3.16.2.jar
I think you need to shift the project to Fast CLI
I think companion uses a live runtime with separate native libraries already loaded.
But the APK must merge all dependencies internally.
These libraries contain code the builder cannot process sometimes can resulting in crash. Else for Niotron, you must use,
socket.io-client 0.9.x or 1.x
engine.io-client matching older versions
okhttp 2.x
okio 1.x
Give it a try with the older version
i did installed fast cli but same code which is used in niotron online ide. the build failed from main source. do i need to write code differently for fast cli?
Do you know how to use Fast CLI?
In niotrone we write our code in the builder while in fast we compile through ourfilelocationcode.java=Fast build
