I\'ve been reading the other posts on tracking down the reasons for getting a SIGSEGV
in an Android app. I plan to scour my app for possible NullPointers relate
Add these two lines to your build.gradle in the android section:
android{
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
I also got this error many times and I solved it. This error will be faced in case of memory management in native side.
Your application is accessing memory outside of its address space. This is most likely an invalid pointer access. SIGSEGV = segmentation fault in native code. Since it is not occurring in Java code you won't see a stack trace with details. However, you may still see some stack trace information in the logcat if you look around a bit after the application process crashes. It will not tell you the line number within the file, but will tell you which object files and addresses were in use in the call chain. From there you can often figure out which area of the code is problematic. You can also setup a gdb native connection to the target process and catch it in the debugger.
Try disabling Android hardware acceleration in your manifest.
android:hardwareAccelerated="false"
Check your JNI/native code. One of my references was null, but it was intermittent, so it wasn't very obvious.
I had this issue with a package that was added to my app (FancyShowCaseView) and caused this problem on pre-lolipop. that package was written in kotlin and my main codes were written in java. so now I'm checking version in pre-lolipop and don't let its class to be executed. temporary solved the problem. check this out if you have similar problem like me
check your native functions,whether it is returning properly or not,If it is not returned please add return statements.