无法使用github bump demo在android中加载.so文件

时间:2012-11-16 09:57:02

标签: android shared-libraries bump

我从github上下载了bump demo但是当我正在运行它时,它一直在用错误日志作为

11-16 12:33:01.632: ERROR/AndroidRuntime(4298): FATAL EXCEPTION: main
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): java.lang.UnsatisfiedLinkError: Library
android-api not found 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
java.lang.Runtime.loadLibrary(Runtime.java:461)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at     
java.lang.System.loadLibrary(System.java:557)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at com.bump.api.BumpAPI.<init>   
(BumpAPI.java:122)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at      
 java.lang.Class.newInstanceImpl(Native Method)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 java.lang.Class.newInstance(Class.java:1429)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 android.app.ActivityThread.handleCreateService(ActivityThread.java:2940)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 android.app.ActivityThread.access$3300(ActivityThread.java:125)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 android.os.Handler.dispatchMessage(Handler.java:99)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 android.os.Looper.loop(Looper.java:123)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 android.app.ActivityThread.main(ActivityThread.java:4627)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 java.lang.reflect.Method.invokeNative(Native Method)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 java.lang.reflect.Method.invoke(Method.java:521)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
 11-16 12:33:01.632: ERROR/AndroidRuntime(4298):     at 
 dalvik.system.NativeStart.main(Native Method)

虽然我正在使用这一大量代码将其加载到onCreate

 public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    try {
        //System.loadLibrary("mysharedlibrary");
        //crashing on this line
        System.loadLibrary("libgifflen.so");
        } catch (UnsatisfiedLinkError use) {
        Log.e("JNI", "WARNING: Could not load libmysharedlibrary.so");
        System.out.println("warning  "+use.getMessage());
    }
   //.......some other code
 }

我想我错过了很多字符串的东西但是我找不到任何这样的东西或者无法为此获得一些东西

1 个答案:

答案 0 :(得分:0)

这就是我将bump-library导入到我的项目中的方法,并且它可以正常工作。

  1. 在你的eclipse中导入bump-api-library项目

  2. 选择bump-api-library&gt;属性&gt; Android&gt;确保选择“Is Library”&gt;单击“应用”,然后单击“确定”

  3. 选择您的项目&gt;属性&gt; Android&gt;点击“添加”按钮&gt;选择“bump-api-library”&gt;单击“应用”,然后单击“确定”