Note that there are some explanatory texts on larger screens.

plurals
  1. PONative activity and "unable to load native library"
    primarykey
    data
    text
    <p>I am attempting to build an Android-10 NDK native activity based on the "native-activity" sample project from the Android NDK folder. However, my native activity crashes with the following runtime exception when I open Eclipse and select "Run As -> Android Application" for my project:</p> <blockquote> <p>02-09 03:02:12.599: E/AndroidRuntime(881): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.native_activity/android.app.NativeActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/com.example.native_activity-1/[library name].so</p> </blockquote> <p>However, I have confirmed that the file "lib[library name].so" already exists in the "libs/armeabi" (etc.) paths. My native activity eventually needs to load three ".so" files, but this error persists whether I am attempting to load one ".so" file or all three ".so" files. My "AndroidManifest.xml" file is as follows:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;!-- BEGIN_INCLUDE(manifest) --&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.native_activity" android:versionCode="1" android:versionName="1.0"&gt; &lt;!-- This is the platform API where NativeActivity was introduced. --&gt; &lt;uses-sdk android:minSdkVersion="9" /&gt; &lt;!-- This .apk has no Java code itself, so set hasCode to false. --&gt; &lt;application android:label="@string/app_name" android:hasCode="false"&gt; &lt;!-- Our activity is the built-in NativeActivity framework class. This will take care of integrating with our NDK code. --&gt; &lt;activity android:name="android.app.NativeActivity" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden"&gt; &lt;!-- Tell NativeActivity the name of or .so --&gt; &lt;meta-data android:name="android.app.lib_name" android:value="[library name]" /&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; &lt;!-- END_INCLUDE(manifest) --&gt; </code></pre> <p>What needs to be done to fix this runtime exception?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload