建筑系统应用有了prebuilt .so库 [英] Building System App With Prebuilt .so Library

查看:298
本文介绍了建筑系统应用有了prebuilt .so库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经困在这里了一个星期试图建立一个第三方与我的应用程序一起.so库到定制的Andr​​oid系统。我跟着的http://www.maxters.net/2012/05/adding-$p$pbuilt-shared-library-to-android-build-system/和共享库成功添加。所以作为LIB prebuilt到Android构建系统。现在我可以看到在../输出/目标/产品/ crespo4g / OBJ / lib目录/.

不过,此目录中的库不会闪烁时迁移到设备。而我的.so lib目录不是在/数据/数据​​/ my_app_name / lib中出现了两种。因此,的UnsatisfiedLinkError 执行时出现的的System.loadLibrary()

我觉得有三种方式来解决这个问题,但就是不知道如何实现:


  1. 也许我的应用程序没有指示编译器。所以我与我的应用程序作为一个整体一起,所以。所以LIB没有编译与我的应用程序的系统映像。但我没有用LOCAL_STATIC_LIBRARIES:= libXX申报?,什么错

  2. 有没有建立我的.so lib放到/系统/ lib中/一种方式?哪里有这么库在/系统/ lib目录/源自?

我是新来的Andr​​oid建筑,请帮助..

谢谢!


解决方案

您可能要检查你的<一个Makefile反对意见href=\"http://stackoverflow.com/questions/14687287/adding-$p$pbuilt-apk-with-shared-libraries-to-aosp\">this回答和<一个href=\"http://stackoverflow.com/questions/11037765/where-to-place-so-file-so-that-it-gets-included-in-the-final-build\">this 之一,以及在此线程组的意见

更新
我原来的makefile文件是不正确的,但是这也为我工作建设ICS:

  LOCAL_PATH:= $(叫我-DIR)
包括$(CLEAR_VARS)
LOCAL_MODULE:= libmozglue
LOCAL_SRC_FILES:= libmozglue.so
LOCAL_MODULE_SUFFIX:=的.so
LOCAL_MODULE_CLASS:= SHARED_LIBRARIES
LOCAL_MODULE_TAGS:=可选
包括$(BUILD_ preBUILT)包括$(CLEAR_VARS)
LOCAL_MODULE:= libplugin容器
LOCAL_SRC_FILES:= libplugin-container.so
LOCAL_MODULE_SUFFIX:=的.so
LOCAL_MODULE_CLASS:= SHARED_LIBRARIES
LOCAL_MODULE_TAGS:=可选
包括$(BUILD_ preBUILT)

其中上面是我包括在我的自定义系统,建立一个系统的应用程序通过Android版Firefox所需的机库。

I've been stuck here for a week trying to build a 3rd party .so library along with my app into custom Android system. I followed http://www.maxters.net/2012/05/adding-prebuilt-shared-library-to-android-build-system/ and successfully add the .so lib as prebuilt shared library to Android Build System. Now I can see the .so lib at ../out/target/product/crespo4g/obj/lib/.

But the libraries in this directory are not going to be migrated to device when flashing. And my .so lib is not appeared at /data/data/my_app_name/lib either. So UnsatisfiedLinkError occurs when executing System.loadLibrary().

I thought there are three ways to solve this, but just don't know how to implement:

  1. Maybe my app failed to indicate to compiler that my .so is along with my app as a whole, so the .so lib is not compiled into the system image with my app. But I did declare by "LOCAL_STATIC_LIBRARIES := libXX", anything wrong?
  2. Is there a way to build my .so lib into /system/lib/? Where are the so libs under /system/lib/ derived from?

I am new to Android building, please help..

Thanks!

解决方案

You might want to check you makefile against advice in this answer and this one as well as the advice in this groups thread

UPDATE My original makefile was incorrect but this does work for me building ICS:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libmozglue
LOCAL_SRC_FILES := libmozglue.so
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_TAGS := optional
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := libplugin-container
LOCAL_SRC_FILES := libplugin-container.so
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_TAGS := optional
include $(BUILD_PREBUILT)

where the above are the native libraries required by firefox for android that I include as a system app in my custom system build.

这篇关于建筑系统应用有了prebuilt .so库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆