I’ve developed a custom extension to integrate OneSignal SDK for push notifications in MIT App Inventor. The extension works flawlessly in other platforms like Android Builder. However, when I use the same extension in MIT App Inventor, I encounter the following runtime error:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/onesignal/OneSignal$oneSignal$2;
so how to solve this problem?
1 Like
In which platform does the extension work
The message is quite explanatory.
Given class is not present in the apk.
It's not an issue with AI2.
1 Like
You probably forgot to include the onesignal SDK in your extension.
It’s probably working fine on other platforms because they already include the OneSignal component, so the SDK ends up getting added to the APK by default.
i have used 5 aar files

should i have to add more ?
Did you include Onesignal jar and required libs in your extension?
i have these five aar files not jar files. pls tell where and how to get the Onesignal.jar file?
Considering how difficult it is to work with Onesignal 5.x.x SDK, I would recommend to purchase one of the available extensions if you are an app developer.
Otherwise, it might be challenging to manage the complexities involved. For instance, you may not be aware that .aar files are essentially ZIP archives containing .jar files along with other resources.
i have extracted the classes.jar file from the aar file then do it all 5 five files mentioned above then extracted the files from all the jar files into a folder then merge using cmd
to a single jar. is that the correct process?
still i get the same error 
Did I say it'll fix the error? 
please guide me what to do next, i m curious to know
I am afraid I can't do that, since I have published Onesignal extension.
Though being curious is a good thing, one day you will be editing libraries for your convenience.
1 Like
Totally understandable! I appreciate your time and the work you've already done on the extension — it's great that you've published it. I'm still exploring and learning, and hopefully with time and experience, I'll reach the point where I can confidently tweak libraries too. Thanks again for your insights! 