App crashes when doing ```class MainActivity : App...
# android
j
App crashes when doing
Copy code
class MainActivity : AppCompatActivity() {
    companion object {
        init {
            System.loadLibrary("encrypt")
        }
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        tv_cipher.text = encryptString("test")
    }

    external fun encryptString(plaintext: String): String
}
Anything wrong? Library is already inside their respective architectures under
src/main/jniLibs/<archi>
google 3
stackoverflow 2
t
does your app binary (open with zip file manager ) contains
.so
file with expected name ?
j
I dont know how to open app as zip in ubuntu. But as when i do Build APK > Analyze
The .so files are inside their libs/archi
Error thrown is
has unexpected e_machine: 62 (EM_X86_64)
v
it looks like your library encrypt doesn’t support the current architecture of you device
j
Stackoverflow link here.