Trouble referencing a .so file in android studio
<p>So I am trying to integrate CLE in Android and for this reason I have to add a few .so files. I am following a tutorial from <a href="https://www.codeproject.com/articles/375293/writing-android-gui-using-lua-introduction" rel="nofollow noreferrer">here</a></p>

<p>Everything works fine till integrating the Star libraries, however when I run the program I get the following exception: </p>

<pre><code>Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/data/com.srplab.starcore/lib/libstar_java.so" not found
</code></pre>

<p>Now to include these .so files I have created a folder jniLibs and placed .so files for 3 architectures: </p>

<p><a href="https://i.stack.imgur.com/GAJog.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GAJog.png" alt="enter image description here"></a></p>

<p>I ahve added the following lines of code to my build.gradle: </p>

<pre><code> sourceSets
            {
                main
                        {

                            jniLibs.srcDirs = ['src/main/jnilibs']

                        }
            }
</code></pre>

<p>However again when I run the below piece of code: </p>

<pre><code>try {
            //System.loadLibrary("mysharedlibrary");
            System.load("/data/data/"+getPackageName()+"/libstar_java.so");
        } catch (UnsatisfiedLinkError use) {
            Log.e("JNI", "WARNING: Could not load libmysharedlibrary.so");
            use.printStackTrace();
        }
</code></pre>

<p>I am getting an exception, means the .so files did not load. </p>

<p>What is the proper way of doing this? </p>