请各位帮我看下我的 问题出在哪了
这是Applcition.mk的内容
APP_PROJECT_PATH := $(call my-dir)
APP_MODULES := libtutorial-zeroone libtutorial-zerotwo
这是Android.mk的内容
LOCAL_PATH:= $(call my-dir)# first lib, which will be built statically
#
include $(CLEAR_VARS)LOCAL_MODULE := first
LOCAL_SRC_FILES := first.cinclude $(BUILD_SHARED_LIBRARY)# second lib, which will depend on and include the first one
#
include $(CLEAR_VARS)LOCAL_MODULE := second
LOCAL_SRC_FILES := second.c
LOCAL_SHARED_LIBRARIES := firstinclude $(BUILD_SHARED_LIBRARY)两个C文件的内容
first内容
#include "first.h"int first(int x, int y)
{
return x + y;
}
second.c内容
#include "first.h"
#include <jni.h>jint
Java_com_example_twolibs_TwoLibs_add( JNIEnv* env,
jobject this,
jint x,
jint y ){
// void* filehandle = dlopen("/data/data/com.example.twolibs/libtwolib-first.so", RTLD_LAZY );
return first(x, y);
}
可以编译成功
但运行时会报错:
java.lang.UnsatisfiedLinkError: Library second not found
这是Applcition.mk的内容
APP_PROJECT_PATH := $(call my-dir)
APP_MODULES := libtutorial-zeroone libtutorial-zerotwo
这是Android.mk的内容
LOCAL_PATH:= $(call my-dir)# first lib, which will be built statically
#
include $(CLEAR_VARS)LOCAL_MODULE := first
LOCAL_SRC_FILES := first.cinclude $(BUILD_SHARED_LIBRARY)# second lib, which will depend on and include the first one
#
include $(CLEAR_VARS)LOCAL_MODULE := second
LOCAL_SRC_FILES := second.c
LOCAL_SHARED_LIBRARIES := firstinclude $(BUILD_SHARED_LIBRARY)两个C文件的内容
first内容
#include "first.h"int first(int x, int y)
{
return x + y;
}
second.c内容
#include "first.h"
#include <jni.h>jint
Java_com_example_twolibs_TwoLibs_add( JNIEnv* env,
jobject this,
jint x,
jint y ){
// void* filehandle = dlopen("/data/data/com.example.twolibs/libtwolib-first.so", RTLD_LAZY );
return first(x, y);
}
可以编译成功
但运行时会报错:
java.lang.UnsatisfiedLinkError: Library second not found
解决方案 »
- scrollview 滚动条监听
- 模拟http登陆遇到的编码问题
- 怎么搜索局域网中的电脑
- 调用本地短信服务,多个联系人的时候,分隔符怎么统一
- Android shell中有没有类似bashrc/profile这样的自动运行的脚本
- 服务器端产生的json数据为什么客户端接受为空
- Android动态布局问题
- Unable to execute dex:method ID not in [0, 0xffff]: 65536
- ScrollView里嵌套ListView,如何禁用ListView的滚动事件,或者触发ListView滚动时调用父元素ScrollView的滚动事件?
- 按钮监听器,不知道怎么出现尖括号了
- 请问路过的大神,3.0上如何显示menu键
- 怎么在TabHost里显示MapView???
LOCAL_SHARED_LIBRARIES := first 应该写成LOCAL_SHARED_LIBRARIES := /first
但是每次这样push好累啊 谁还有什么号得解决方法啊