I ever spent some time learning LAMW - Android programming. I can build games on PC but I want to something further. I wanted to develop a game builder that can run on Windows, Linux and Android.
Tutorials are hard to find, even worse some years ago most of the information was outdated. With some diligent efforts I managed to build the first app that run on my phone. But it crashed and closed frequently.
I carefully inspected the steps I did and tried to understand the toolchain I used. I finally understood and can build fat binaries. I even wrote test code to benchmark the performance of running ARM-based code on Intel-based phone vs its native code. No crash, it worked as what it should be.
And now the time to play with graphics. I tried both jCanvasES and jCanvasES2. Wow I could draw shapes on my phone. So I started to build simple games. Unfortunately it crashed even more.
I got a lot of crash-and-close cases. After examining patiently one by one I fixed almost all the issues. There are plenty of things that can cause crash and close. Debugging Android app is hard, it really needs patience.
Now back to your question.
The short answers is: you did it wrong.
Because you gave us a short description so I gave you a short answer. Next time, please provide more helpful information.